diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/930519/UNCRATED b/.gitmodules similarity index 100% rename from cde/programs/dtksh/ksh93/ship/ksh93/930519/UNCRATED rename to .gitmodules diff --git a/cde/.gitignore b/cde/.gitignore index e73446ec1..03da06818 100644 --- a/cde/.gitignore +++ b/cde/.gitignore @@ -824,7 +824,9 @@ programs/dtinfo/tools/misc/pmaker programs/dtinfo/tools/misc/treeres # program/dtksh +programs/dtksh/FEATURE programs/dtksh/dtksh +programs/dtksh/init.c programs/dtksh/examples/CallDataTest4 programs/dtksh/examples/CallbackTest2 programs/dtksh/examples/DtCursorTest2 @@ -846,211 +848,6 @@ programs/dtksh/examples/WorkProcTest1 programs/dtksh/examples/XCursorTest1 programs/dtksh/examples/XdrawTest programs/dtksh/examples/crMovesText1 -programs/dtksh/ksh93/bin -programs/dtksh/ksh93/include -programs/dtksh/ksh93/lib -programs/dtksh/ksh93/man -programs/dtksh/ksh93/man/man1/sh.1 -programs/dtksh/ksh93/man/man1/sh.1.old -programs/dtksh/ksh93/man/man3/LIBAST.3 -programs/dtksh/ksh93/man/man3/LIBAST.3.old -programs/dtksh/ksh93/man/man3/ast.3 -programs/dtksh/ksh93/man/man3/ast.3.old -programs/dtksh/ksh93/man/man3/chr.3 -programs/dtksh/ksh93/man/man3/chr.3.old -programs/dtksh/ksh93/man/man3/compatibility.3 -programs/dtksh/ksh93/man/man3/compatibility.3.old -programs/dtksh/ksh93/man/man3/error.3 -programs/dtksh/ksh93/man/man3/error.3.old -programs/dtksh/ksh93/man/man3/find.3 -programs/dtksh/ksh93/man/man3/find.3.old -programs/dtksh/ksh93/man/man3/fmt.3 -programs/dtksh/ksh93/man/man3/fmt.3.old -programs/dtksh/ksh93/man/man3/fmtls.3 -programs/dtksh/ksh93/man/man3/fmtls.3.old -programs/dtksh/ksh93/man/man3/fs3d.3 -programs/dtksh/ksh93/man/man3/fs3d.3.old -programs/dtksh/ksh93/man/man3/ftwalk.3 -programs/dtksh/ksh93/man/man3/ftwalk.3.old -programs/dtksh/ksh93/man/man3/getcwd.3 -programs/dtksh/ksh93/man/man3/getcwd.3.old -programs/dtksh/ksh93/man/man3/hash.3 -programs/dtksh/ksh93/man/man3/hash.3.old -programs/dtksh/ksh93/man/man3/iblocks.3 -programs/dtksh/ksh93/man/man3/iblocks.3.old -programs/dtksh/ksh93/man/man3/int.3 -programs/dtksh/ksh93/man/man3/int.3.old -programs/dtksh/ksh93/man/man3/magic.3 -programs/dtksh/ksh93/man/man3/magic.3.old -programs/dtksh/ksh93/man/man3/mem.3 -programs/dtksh/ksh93/man/man3/mem.3.old -programs/dtksh/ksh93/man/man3/modecanon.3 -programs/dtksh/ksh93/man/man3/modecanon.3.old -programs/dtksh/ksh93/man/man3/nval.3 -programs/dtksh/ksh93/man/man3/nval.3.old -programs/dtksh/ksh93/man/man3/optget.3 -programs/dtksh/ksh93/man/man3/optget.3.old -programs/dtksh/ksh93/man/man3/path.3 -programs/dtksh/ksh93/man/man3/path.3.old -programs/dtksh/ksh93/man/man3/preroot.3 -programs/dtksh/ksh93/man/man3/preroot.3.old -programs/dtksh/ksh93/man/man3/proc.3 -programs/dtksh/ksh93/man/man3/proc.3.old -programs/dtksh/ksh93/man/man3/re.3 -programs/dtksh/ksh93/man/man3/re.3.old -programs/dtksh/ksh93/man/man3/setenviron.3 -programs/dtksh/ksh93/man/man3/setenviron.3.old -programs/dtksh/ksh93/man/man3/sfdisc.3 -programs/dtksh/ksh93/man/man3/sfdisc.3.old -programs/dtksh/ksh93/man/man3/sfio.3 -programs/dtksh/ksh93/man/man3/sfio.3.old -programs/dtksh/ksh93/man/man3/sig.3 -programs/dtksh/ksh93/man/man3/sig.3.old -programs/dtksh/ksh93/man/man3/spawnveg.3 -programs/dtksh/ksh93/man/man3/spawnveg.3.old -programs/dtksh/ksh93/man/man3/stak.3 -programs/dtksh/ksh93/man/man3/stak.3.old -programs/dtksh/ksh93/man/man3/stk.3 -programs/dtksh/ksh93/man/man3/stk.3.old -programs/dtksh/ksh93/man/man3/strcopy.3 -programs/dtksh/ksh93/man/man3/strcopy.3.old -programs/dtksh/ksh93/man/man3/strdup.3 -programs/dtksh/ksh93/man/man3/strdup.3.old -programs/dtksh/ksh93/man/man3/strelapsed.3 -programs/dtksh/ksh93/man/man3/strelapsed.3.old -programs/dtksh/ksh93/man/man3/strerror.3 -programs/dtksh/ksh93/man/man3/strerror.3.old -programs/dtksh/ksh93/man/man3/stresc.3 -programs/dtksh/ksh93/man/man3/stresc.3.old -programs/dtksh/ksh93/man/man3/streval.3 -programs/dtksh/ksh93/man/man3/streval.3.old -programs/dtksh/ksh93/man/man3/strgid.3 -programs/dtksh/ksh93/man/man3/strgid.3.old -programs/dtksh/ksh93/man/man3/strmatch.3 -programs/dtksh/ksh93/man/man3/strmatch.3.old -programs/dtksh/ksh93/man/man3/stropt.3 -programs/dtksh/ksh93/man/man3/stropt.3.old -programs/dtksh/ksh93/man/man3/strperm.3 -programs/dtksh/ksh93/man/man3/strperm.3.old -programs/dtksh/ksh93/man/man3/strsignal.3 -programs/dtksh/ksh93/man/man3/strsignal.3.old -programs/dtksh/ksh93/man/man3/strsort.3 -programs/dtksh/ksh93/man/man3/strsort.3.old -programs/dtksh/ksh93/man/man3/strtape.3 -programs/dtksh/ksh93/man/man3/strtape.3.old -programs/dtksh/ksh93/man/man3/strton.3 -programs/dtksh/ksh93/man/man3/strton.3.old -programs/dtksh/ksh93/man/man3/struid.3 -programs/dtksh/ksh93/man/man3/struid.3.old -programs/dtksh/ksh93/man/man3/swap.3 -programs/dtksh/ksh93/man/man3/swap.3.old -programs/dtksh/ksh93/man/man3/tab.3 -programs/dtksh/ksh93/man/man3/tab.3.old -programs/dtksh/ksh93/man/man3/tm.3 -programs/dtksh/ksh93/man/man3/tm.3.old -programs/dtksh/ksh93/man/man3/tok.3 -programs/dtksh/ksh93/man/man3/tok.3.old -programs/dtksh/ksh93/man/man3/touch.3 -programs/dtksh/ksh93/man/man3/touch.3.old -programs/dtksh/ksh93/man/man3/vdelta.3 -programs/dtksh/ksh93/man/man3/vdelta.3.old -programs/dtksh/ksh93/man/man3/vecargs.3 -programs/dtksh/ksh93/man/man3/vecargs.3.old -programs/dtksh/ksh93/man/man3/vmalloc.3 -programs/dtksh/ksh93/man/man3/vmalloc.3.old -programs/dtksh/ksh93/ship/SHIPiffe.sh -programs/dtksh/ksh93/ship/SHIPin -programs/dtksh/ksh93/ship/SHIPop.c -programs/dtksh/ksh93/ship/SHIPprobe -programs/dtksh/ksh93/ship/SHIPproto.c -programs/dtksh/ksh93/ship/ksh93/950807/BUILT -programs/dtksh/ksh93/ship/ksh93/950807/ERROR -programs/dtksh/ksh93/ship/ksh93/in.log -programs/dtksh/ksh93/ship/lib0ast/950811/BUILT -programs/dtksh/ksh93/ship/lib0ast/950811/ERROR -programs/dtksh/ksh93/ship/lib0ast/in.log -programs/dtksh/ksh93/ship/libAST/930519/BUILT -programs/dtksh/ksh93/ship/libAST/930519/ERROR -programs/dtksh/ksh93/ship/libAST/in.log -programs/dtksh/ksh93/ship/libast/950811/BUILT -programs/dtksh/ksh93/ship/libast/950811/ERROR -programs/dtksh/ksh93/ship/libast/in.log -programs/dtksh/ksh93/ship/libcmd/950811/BUILT -programs/dtksh/ksh93/ship/libcmd/950811/ERROR -programs/dtksh/ksh93/ship/libcmd/in.log -programs/dtksh/ksh93/ship/libodelta/950811/BUILT -programs/dtksh/ksh93/ship/libodelta/950811/ERROR -programs/dtksh/ksh93/ship/libodelta/in.log -programs/dtksh/ksh93/ship/libvdelta/950811/BUILT -programs/dtksh/ksh93/ship/libvdelta/950811/ERROR -programs/dtksh/ksh93/ship/libvdelta/in.log -programs/dtksh/ksh93/ship/pax/950811/BUILT -programs/dtksh/ksh93/ship/pax/950811/ERROR -programs/dtksh/ksh93/ship/pax/in.log -programs/dtksh/ksh93/ship/shipiffe -programs/dtksh/ksh93/ship/shipop -programs/dtksh/ksh93/ship/shipproto -programs/dtksh/ksh93/src/cmd/ksh93/FEATURE/ -programs/dtksh/ksh93/src/cmd/ksh93/MAM.list -programs/dtksh/ksh93/src/cmd/ksh93/MAM.time -programs/dtksh/ksh93/src/cmd/ksh93/ksh -programs/dtksh/ksh93/src/cmd/ksh93/ksh.msg -programs/dtksh/ksh93/src/cmd/ksh93/shcomp -programs/dtksh/ksh93/src/cmd/ksh93/suid_exec -programs/dtksh/ksh93/src/cmd/pax/bax -programs/dtksh/ksh93/src/cmd/pax/cpio -programs/dtksh/ksh93/src/cmd/pax/nocom -programs/dtksh/ksh93/src/cmd/pax/pax -programs/dtksh/ksh93/src/cmd/pax/tar -programs/dtksh/ksh93/src/cmd/pax/FEATURE/ -programs/dtksh/ksh93/src/cmd/pax/MAM.list -programs/dtksh/ksh93/src/cmd/pax/MAM.time -programs/dtksh/ksh93/src/lib/lib0ast/MAM.list -programs/dtksh/ksh93/src/lib/lib0ast/MAM.time -programs/dtksh/ksh93/src/lib/lib0ast/hostinfo -programs/dtksh/ksh93/src/lib/lib0ast/prototyped.h -programs/dtksh/ksh93/src/lib/libAST/MAM.list -programs/dtksh/ksh93/src/lib/libAST/MAM.time -programs/dtksh/ksh93/src/lib/libAST/prototyped.h -programs/dtksh/ksh93/src/lib/libast/FEATURE/ -programs/dtksh/ksh93/src/lib/libast/MAM.list -programs/dtksh/ksh93/src/lib/libast/MAM.time -programs/dtksh/ksh93/src/lib/libast/align.h -programs/dtksh/ksh93/src/lib/libast/ast_botch.h -programs/dtksh/ksh93/src/lib/libast/ast_fcntl.h -programs/dtksh/ksh93/src/lib/libast/ast_fs.h -programs/dtksh/ksh93/src/lib/libast/ast_hdr.h -programs/dtksh/ksh93/src/lib/libast/ast_lib.h -programs/dtksh/ksh93/src/lib/libast/ast_mode.h -programs/dtksh/ksh93/src/lib/libast/ast_param.h -programs/dtksh/ksh93/src/lib/libast/ast_time.h -programs/dtksh/ksh93/src/lib/libast/ast_tty.h -programs/dtksh/ksh93/src/lib/libast/ast_types.h -programs/dtksh/ksh93/src/lib/libast/ast_unistd.h -programs/dtksh/ksh93/src/lib/libast/ast_wait.h -programs/dtksh/ksh93/src/lib/libast/conf -programs/dtksh/ksh93/src/lib/libast/conflib.h -programs/dtksh/ksh93/src/lib/libast/conflim.h -programs/dtksh/ksh93/src/lib/libast/confmap.c -programs/dtksh/ksh93/src/lib/libast/confmap.h -programs/dtksh/ksh93/src/lib/libast/confstr.c -programs/dtksh/ksh93/src/lib/libast/conftab.c -programs/dtksh/ksh93/src/lib/libast/conftab.h -programs/dtksh/ksh93/src/lib/libast/confuni.h -programs/dtksh/ksh93/src/lib/libast/int.h -programs/dtksh/ksh93/src/lib/libast/limits.h -programs/dtksh/ksh93/src/lib/libast/pathconf.c -programs/dtksh/ksh93/src/lib/libast/preroot.h -programs/dtksh/ksh93/src/lib/libast/sig.h -programs/dtksh/ksh93/src/lib/libast/sysconf.c -programs/dtksh/ksh93/src/lib/libcmd/FEATURE/ -programs/dtksh/ksh93/src/lib/libcmd/MAM.list -programs/dtksh/ksh93/src/lib/libcmd/MAM.time -programs/dtksh/ksh93/src/lib/libcmd/cmd.req -programs/dtksh/ksh93/src/lib/libodelta/MAM.list -programs/dtksh/ksh93/src/lib/libodelta/MAM.time -programs/dtksh/ksh93/src/lib/libvdelta/MAM.list -programs/dtksh/ksh93/src/lib/libvdelta/MAM.time # programs/dtlogin programs/dtlogin/config/0015.sun.env @@ -1162,10 +959,6 @@ programs/fontaliases/sun/ja/dtinfo.pcf.gz programs/fontaliases/sun/ja/dtinfo.pcf.Z programs/fontaliases/sun/ja/fonts.dir -# programs/ksh93 -programs/dtksh/ksh93/man/man1/sh.1 -programs/dtksh/ksh93/man/man3/nval.3 - # programs/localized programs/localized/C/types/*.dt programs/localized/C/types/*.dt.tmsg diff --git a/cde/Makefile.imake b/cde/Makefile.imake index 541bf0187..abc4e51ca 100644 --- a/cde/Makefile.imake +++ b/cde/Makefile.imake @@ -1,5 +1,5 @@ # $TOG: Makefile /main/15 1999/10/12 09:33:30 mgreess $ - RELEASE = Release 2.3.2a + RELEASE = Release 2.3.2b PRODUCT = CDE SHELL = /bin/sh RM = rm -f @@ -21,6 +21,8 @@ MAKE_CMD = $(MAKE) $(MAKE_OPTS) NMAKE_CMD = $(NMAKE) $(MAKE_OPTS) FLAGS = $(MFLAGS) -f Makefile.ini BOOTSTRAPCFLAGS="$(BOOTSTRAPCFLAGS)" +CDE_CONFIGURATION_TOP = /etc/dt +CDE_INSTALLATION_TOP = /usr/dt all: @$(MAKE_CMD) xmakefile-exists || $(MAKE) all-initial diff --git a/cde/README b/cde/README index 348e86645..0d8725eb2 100644 --- a/cde/README +++ b/cde/README @@ -1,7 +1,7 @@ ************************************* The Common Desktop Environment is released under the terms of the LGPL -V.2 license. You may reuse and redistribute this code under the terms +V2 license. You may reuse and redistribute this code under the terms of this license. See the COPYING file for details. ************************************* @@ -20,12 +20,20 @@ http://sourceforge.net/projects/cdesktopenv/ Or via git: -git clone git://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code +git clone --recursive git://git.code.sf.net/p/cdesktopenv/code cdesktopenv-code The git repository will always be more up to date than the downloadable tarballs we make available, so if you have problems, please try the latest version from git master. +As of 2.3.2b, a new ksh93 submodule is used in place of the original +ksh93 source code. If you have already cloned the repo (without the +--recursive flag) you will need to update the ksh submode with +something like: + +cd desktopenv-code +git submodule update --init + ************************************ Installing this release: @@ -47,7 +55,7 @@ There are also a lot of other documents and information there that you might find useful. ************************************ -Support: +Support: You can join the development mailing list here: diff --git a/cde/admin/IntegTools/dbTools/udbParseLib.awk b/cde/admin/IntegTools/dbTools/udbParseLib.awk index 0156ba384..74f04247d 100644 --- a/cde/admin/IntegTools/dbTools/udbParseLib.awk +++ b/cde/admin/IntegTools/dbTools/udbParseLib.awk @@ -350,9 +350,10 @@ function tokenize() { # allow escaping of significant syntax characters # gsub("[\\][{]","{") - gsub("\\:",":") - gsub("\\;",";") - gsub("\\=","=") + # These cause warnings in newer nawk, and aren't really necessary. + # gsub("\\:",":") + # gsub("\\;",";") + # gsub("\=","=") gsub("[\\][}]","}") # diff --git a/cde/config/cf/DtInfo.tmpl b/cde/config/cf/DtInfo.tmpl index 3a5eb0568..ecbdff458 100644 --- a/cde/config/cf/DtInfo.tmpl +++ b/cde/config/cf/DtInfo.tmpl @@ -414,7 +414,7 @@ TEMPLATE_OBJS=TemplateDB//**/*.o #if defined(i386Architecture) || defined(AMD64Architecture) || defined(AlphaArchitecture) || defined(ARMArchitecture) || defined(AArch64Architecture) # define ByteOrderDefines LittleEndianDefines -#elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(AIXArchitecture) || defined(HPArchitecture) +#elif defined(HAL32V7Architecture) || defined(SunArchitecture) || defined(AIXArchitecture) || defined(HPArchitecture) || defined(PpcArchitecture) # define ByteOrderDefines BigEndianDefines #else # define ByteOrderDefines DefaultEndianDefines diff --git a/cde/config/imake/imakemdep.h b/cde/config/imake/imakemdep.h index da4f3f4e7..2c34c861b 100644 --- a/cde/config/imake/imakemdep.h +++ b/cde/config/imake/imakemdep.h @@ -298,16 +298,16 @@ char *cpp_argv[ARGUMENTS] = { "-D__amd64__", # endif # ifdef __ppc__ - {"-D__powerpc__", "1"}, + "-D__powerpc__", # endif # ifdef __ppc64__ - {"-D__powerpc64__", "1"}, + "-D__powerpc64__", # endif # ifdef __powerpc__ - {"-D__powerpc__", "1"}, + "-D__powerpc__", # endif # ifdef __powerpc64__ - {"-D__powerpc64__", "1"}, + "-D__powerpc64__", # endif # if defined(__GNUC__) && !defined(__llvm__) diff --git a/cde/copyright b/cde/copyright index e639713ba..5a15917e9 100644 --- a/cde/copyright +++ b/cde/copyright @@ -1,7 +1,7 @@ - Common Desktop Environment Version 2.3.2a (devel) + Common Desktop Environment Version 2.3.2b (devel) (c) Copyright 1993-2012 The Open Group (c) Copyright 2012-2021 CDE Project contributors, see CONTRIBUTORS for details diff --git a/cde/doc/common/help/HELPEnt.sgm b/cde/doc/common/help/HELPEnt.sgm index b5186d9fb..2a2e8c5c9 100644 --- a/cde/doc/common/help/HELPEnt.sgm +++ b/cde/doc/common/help/HELPEnt.sgm @@ -1,5 +1,5 @@ -Common Desktop Environment 2.3.2a, +Common Desktop Environment 2.3.2b, © Copyright 1993-2012 The Open Group © Copyright 2012-2020 CDE Project contributors, see CONTRIBUTORS for details diff --git a/cde/include/Dt/Dt.h b/cde/include/Dt/Dt.h index 7888fe4a9..8411ee30a 100644 --- a/cde/include/Dt/Dt.h +++ b/cde/include/Dt/Dt.h @@ -58,7 +58,7 @@ extern "C" { DtREVISION * 100 + \ DtUPDATE_LEVEL) -#define DtVERSION_STRING "CDE Version 2.3.2a" +#define DtVERSION_STRING "CDE Version 2.3.2b" /* diff --git a/cde/include/Dt/XlationSvc.h b/cde/include/Dt/XlationSvc.h index ab2763e59..4cbf865ba 100644 --- a/cde/include/Dt/XlationSvc.h +++ b/cde/include/Dt/XlationSvc.h @@ -109,14 +109,15 @@ platforms as part of a translation. /*================================================$SKIP$==*/ #endif /* $DEF$, Platform constants */ -#if defined(SVR4) || defined(_AIX) +#if defined(SVR4) || defined(_AIX) || defined(SYS_NMLN) #define _DtPLATFORM_MAX_LEN SYS_NMLN -#else -#if defined(SYS_NMLN) -#define _DtPLATFORM_MAX_LEN SYS_NMLN -#else +#elif defined(UTSLEN) #define _DtPLATFORM_MAX_LEN UTSLEN -#endif +#else +/* POSIX guarantees that hostnames are limited to 255 bytes, + * but SVR4 platforms commonly allow for 256. + */ +#define _DtPLATFORM_MAX_LEN 257 #endif #define _DtPLATFORM_UNKNOWN ((const char *)0) diff --git a/cde/include/DtI/AccessI.h b/cde/include/DtI/AccessI.h index 4dcc62708..d2e4449ec 100644 --- a/cde/include/DtI/AccessI.h +++ b/cde/include/DtI/AccessI.h @@ -44,6 +44,7 @@ #ifndef _DtHelpAccessI_h #define _DtHelpAccessI_h +#include #ifndef _XtIntrinsic_h /* diff --git a/cde/lib/DtSvc/DtUtil2/XlationSvc.c b/cde/lib/DtSvc/DtUtil2/XlationSvc.c index a7298c0ac..c36f97dee 100644 --- a/cde/lib/DtSvc/DtUtil2/XlationSvc.c +++ b/cde/lib/DtSvc/DtUtil2/XlationSvc.c @@ -2199,18 +2199,15 @@ int _DtXlateGetXlateEnv( /* then look up version number of execution host */ if (ret_AppExecEnvVersion) { -#if defined(sun) || defined(_AIX) || defined(__linux__) || defined(CSRG_BASED) - char version[SYS_NMLN+SYS_NMLN+2]; -#else - char version[UTSLEN+UTSLEN+2]; -#endif + char version[sizeof(names.release)+sizeof(names.version)-1]; char * stdVer = NULL; int verNum = MATCHALL_VER; /* cat release version and do a translation on it to a std value */ /* then convert the std value to a integer */ - strcpy(version,names.release); - strcat(version,names.version); + strncpy(version,names.release,sizeof(names.release)-1); + version[sizeof(names.release)-1] = EOS; + strncat(version,names.version,sizeof(names.version)-1); ret = _DtXlateOpToStdValue(db,names.sysname,0, _DtXLATE_OPER_VERSION,version,&stdVer,NULL); if (ret == 0) diff --git a/cde/lib/csa/agent_p.h b/cde/lib/csa/agent_p.h index 9ed8846c9..6f6142cf8 100644 --- a/cde/lib/csa/agent_p.h +++ b/cde/lib/csa/agent_p.h @@ -33,8 +33,8 @@ #include "ansi_c.h" -extern void _DtCm_init_agent P((void)); -extern void _DtCm_destroy_agent P((void)); -extern void _DtCm_process_updates P((void)); +extern void _DtCm_init_agent(void); +extern void _DtCm_destroy_agent(void); +extern void _DtCm_process_updates(void); #endif /* _AGENT_P_H */ diff --git a/cde/lib/csa/ansi_c.h b/cde/lib/csa/ansi_c.h index 56178ad4c..c3969391c 100644 --- a/cde/lib/csa/ansi_c.h +++ b/cde/lib/csa/ansi_c.h @@ -36,28 +36,19 @@ #include -/* -** For all function declarations, if ANSI, then use a prototype -*/ -#if defined(__STDC__) -#define P(args) args -#else -#define P(args) () -#endif - #ifdef SunOS -extern char *fconvert P((double, int, int*, int*, char*)); -extern int isascii P((int)); -extern int kill P((long, int)); -extern char *mktemp P((char*)); -extern int strcasecmp P((const char*, const char*)); -extern int strncasecmp P((const char*, const char*, size_t)); -extern char *strdup P((const char*)); +extern char *fconvert(double, int, int*, int*, char*)) +extern int isascii(int); +extern int kill(long, int); +extern char *mktemp(char*); +extern int strcasecmp(const char*, const char*); +extern int strncasecmp(const char*, const char*, size_t); +extern char *strdup (const char*); #endif #ifdef NEED_STRCASECMP -int strcasecmp P((const char*, const char*)); -int strncasecmp P((const char*, const char*, size_t)); +int strcasecmp(const char*, const char*); +int strncasecmp(const char*, const char*, size_t); #endif #endif diff --git a/cde/lib/csa/appt4.h b/cde/lib/csa/appt4.h index 9a2dda97f..e72feb51b 100644 --- a/cde/lib/csa/appt4.h +++ b/cde/lib/csa/appt4.h @@ -38,40 +38,42 @@ #include "rtable4.h" #include "ansi_c.h" -extern Appt_4 *_DtCm_make_appt4 P((boolean_t alloc)); +extern Appt_4 *_DtCm_make_appt4(); -extern Appt_4 *_DtCm_copy_one_appt4 P((Appt_4 *a4)); +extern Appt_4 *_DtCm_copy_one_appt4(Appt_4 *a4); -extern Appt_4 *_DtCm_copy_appt4 P((Appt_4 *a4)); +extern Appt_4 *_DtCm_copy_appt4(Appt_4 *a4); -extern Appt_4 *_DtCm_copy_semiprivate_appt4 P((Appt_4 *original)); +extern Appt_4 *_DtCm_copy_semiprivate_appt4(Appt_4 *original); -extern Except_4 *_DtCm_copy_excpt4 P((Except_4 *e4)); +extern Except_4 *_DtCm_copy_excpt4(Except_4 *e4); -extern Abb_Appt_4 *_DtCm_appt_to_abbrev4 P((Appt_4 *original)); +extern Abb_Appt_4 *_DtCm_appt_to_abbrev4(Appt_4 *original); -extern Abb_Appt_4 *_DtCm_appt_to_semiprivate_abbrev4 P((Appt_4 *original)); +extern Abb_Appt_4 *_DtCm_appt_to_semiprivate_abbrev4(Appt_4 *original); -extern void _DtCm_free_appt4 P((Appt_4 *a)); +extern void _DtCm_free_appt4(Appt_4 *a); -extern void _DtCm_free_abbrev_appt4 P((Abb_Appt_4 *a)); +extern void _DtCm_free_abbrev_appt4(Abb_Appt_4 *a); -extern Attribute_4 * _DtCm_make_attr4 P((void)); +extern Attribute_4 * _DtCm_make_attr4(); -extern void _DtCm_free_attr4 P((Attribute_4 *a)); +extern void _DtCm_free_attr4(Attribute_4 *a); -extern Reminder_4 *_DtCm_copy_reminder4 P((Reminder_4 *r4)); +extern Reminder_4 *_DtCm_copy_reminder4(Reminder_4 *r4); -extern void _DtCm_free_reminder4 P((Reminder_4 *r)); +extern void _DtCm_free_reminder4(Reminder_4 *r); -extern void _DtCm_free_keyentry4 P((Uid_4 *k)); +extern void _DtCm_free_keyentry4(Uid_4 *k); -extern Access_Entry_4 *_DtCm_make_access_entry4 P((char *who, int perms)); +extern Access_Entry_4 *_DtCm_make_access_entry4(char *who, int perms); -extern Access_Entry_4 *_DtCm_copy_access_list4 P((Access_Entry_4 *l4)); +extern Access_Entry_4 *_DtCm_copy_access_list4(Access_Entry_4 *l4); -extern void _DtCm_free_access_list4 P((Access_Entry_4 *l)); +extern void _DtCm_free_access_list4(Access_Entry_4 *l); -extern void _DtCm_free_excpt4 P((Except_4 *e)); +extern void _DtCm_free_excpt4(Except_4 *e); + +extern char * _DtCm_get_default_what_string(); #endif diff --git a/cde/lib/csa/attr.h b/cde/lib/csa/attr.h index 8ffc77f92..c98057fd3 100644 --- a/cde/lib/csa/attr.h +++ b/cde/lib/csa/attr.h @@ -110,16 +110,16 @@ extern _DtCmAttrInfo _CSA_entry_attr_info[]; * external function declarations */ -extern CSA_return_code _DtCm_check_cal_csa_attributes P(( +extern CSA_return_code _DtCm_check_cal_csa_attributes( int fvers, uint num_attrs, CSA_attribute *attrs, char *cname, boolean_t checkreadonly, boolean_t firsttime, - boolean_t checkattrnum)); + boolean_t checkattrnum); -extern CSA_return_code _DtCm_check_cal_cms_attributes P(( +extern CSA_return_code _DtCm_check_cal_cms_attributes( int fvers, uint num_attrs, cms_attribute *attrs, @@ -127,154 +127,154 @@ extern CSA_return_code _DtCm_check_cal_cms_attributes P(( char *cname, boolean_t checkreadonly, boolean_t firsttime, - boolean_t checkattrnum)); + boolean_t checkattrnum); -extern CSA_return_code _DtCm_check_entry_attributes P(( +extern CSA_return_code _DtCm_check_entry_attributes( int fversion, uint size, CSA_attribute *attrs, CSA_flags utype, - boolean_t checkattrnum)); + boolean_t checkattrnum); -extern CSA_return_code _DtCm_check_entry_cms_attributes P(( +extern CSA_return_code _DtCm_check_entry_cms_attributes( int fvers, uint num_attrs, cms_attribute *attrs, CSA_flags utype, - boolean_t checkattrnum)); + boolean_t checkattrnum); -extern CSA_return_code _DtCm_copy_cms_attributes P(( +extern CSA_return_code _DtCm_copy_cms_attributes( uint srcsize, cms_attribute *srcattrs, uint *dstsize, - cms_attribute **dstattrs)); + cms_attribute **dstattrs); -extern CSA_return_code _DtCm_copy_cms_attribute P(( +extern CSA_return_code _DtCm_copy_cms_attribute( cms_attribute *to, cms_attribute *from, - boolean_t copyname)); + boolean_t copyname); -extern CSA_return_code _DtCm_copy_cms_attr_val P(( +extern CSA_return_code _DtCm_copy_cms_attr_val( cms_attribute_value *from, - cms_attribute_value **to)); + cms_attribute_value **to); -extern cms_access_entry *_DtCm_copy_cms_access_list P(( - cms_access_entry *alist)); +extern cms_access_entry *_DtCm_copy_cms_access_list( + cms_access_entry *alist); -extern CSA_date_time_list _DtCm_copy_date_time_list P(( - CSA_date_time_list dlist)); +extern CSA_date_time_list _DtCm_copy_date_time_list( + CSA_date_time_list dlist); -extern CSA_return_code _DtCm_cms2csa_attribute P(( +extern CSA_return_code _DtCm_cms2csa_attribute( cms_attribute from, - CSA_attribute *to)); + CSA_attribute *to); -extern CSA_return_code _DtCm_cms2csa_attrval P(( +extern CSA_return_code _DtCm_cms2csa_attrval( cms_attribute_value *from, - CSA_attribute_value **to)); + CSA_attribute_value **to); -extern CSA_return_code _DtCm_cms2csa_access_list P(( +extern CSA_return_code _DtCm_cms2csa_access_list( cms_access_entry *cmslist, - CSA_access_rights **csalist)); + CSA_access_rights **csalist); -extern CSA_return_code _DtCm_csa2cms_access_list P(( +extern CSA_return_code _DtCm_csa2cms_access_list( CSA_access_rights *csalist, - cms_access_entry **cmslist)); + cms_access_entry **cmslist); -extern CSA_return_code _DtCm_copy_reminder P(( +extern CSA_return_code _DtCm_copy_reminder( CSA_reminder *from, - CSA_reminder **to)); + CSA_reminder **to); -extern CSA_return_code _DtCm_copy_opaque_data P(( +extern CSA_return_code _DtCm_copy_opaque_data( CSA_opaque_data *from, - CSA_opaque_data **to)); + CSA_opaque_data **to); -extern void _DtCm_free_csa_access_list P((CSA_access_list alist)); +extern void _DtCm_free_csa_access_list(CSA_access_list alist); -extern void _DtCm_free_cms_attributes P(( +extern void _DtCm_free_cms_attributes( uint size, - cms_attribute *attrs)); + cms_attribute *attrs); -extern void _DtCm_free_attributes P(( +extern void _DtCm_free_attributes( uint size, - CSA_attribute * attrs)); + CSA_attribute * attrs); -extern void _DtCm_free_cms_attribute_values P(( +extern void _DtCm_free_cms_attribute_values( uint size, - cms_attribute *attrs)); + cms_attribute *attrs); -extern void _DtCm_free_attribute_values P(( +extern void _DtCm_free_attribute_values( uint size, - CSA_attribute *attrs)); + CSA_attribute *attrs); -extern void _DtCm_free_cms_attribute_value P(( - cms_attribute_value *val)); +extern void _DtCm_free_cms_attribute_value( + cms_attribute_value *val); -extern void _DtCm_free_attribute_value P(( - CSA_attribute_value *val)); +extern void _DtCm_free_attribute_value( + CSA_attribute_value *val); -extern void _DtCm_free_cms_access_entry P((cms_access_entry *list)); +extern void _DtCm_free_cms_access_entry(cms_access_entry *list); -extern void _DtCm_free_date_time_list P((CSA_date_time_list list)); +extern void _DtCm_free_date_time_list(CSA_date_time_list list); -extern void _DtCm_free_reminder P((CSA_reminder *val)); +extern void _DtCm_free_reminder(CSA_reminder *val); -extern void _DtCm_free_opaque_data P((CSA_opaque_data *val)); +extern void _DtCm_free_opaque_data(CSA_opaque_data *val); -extern char *_DtCm_old_reminder_name_to_name P(( - char *oldname)); +extern char *_DtCm_old_reminder_name_to_name( + char *oldname); -extern int _DtCm_old_reminder_name_to_index P(( - char *name)); +extern int _DtCm_old_reminder_name_to_index( + char *name); -extern CSA_return_code _DtCm_get_old_attr_by_name P(( +extern CSA_return_code _DtCm_get_old_attr_by_name( char *name, - _DtCm_old_attrs *attr)); + _DtCm_old_attrs *attr); -extern CSA_return_code _DtCm_get_old_attr_by_index P(( +extern CSA_return_code _DtCm_get_old_attr_by_index( int index, - _DtCm_old_attrs *attr)); + _DtCm_old_attrs *attr); -extern CSA_return_code _DtCm_set_uint32_attrval P(( +extern CSA_return_code _DtCm_set_uint32_attrval( uint numval, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_sint32_attrval P(( +extern CSA_return_code _DtCm_set_sint32_attrval( int numval, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_string_attrval P(( +extern CSA_return_code _DtCm_set_string_attrval( char *strval, cms_attribute_value **val, - CSA_enum type)); + CSA_enum type); -extern CSA_return_code _DtCm_set_user_attrval P(( +extern CSA_return_code _DtCm_set_user_attrval( char *user, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_reminder_attrval P(( +extern CSA_return_code _DtCm_set_reminder_attrval( CSA_reminder *remval, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_access_attrval P(( +extern CSA_return_code _DtCm_set_access_attrval( cms_access_entry *aval, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_opaque_attrval P(( +extern CSA_return_code _DtCm_set_opaque_attrval( CSA_opaque_data *opqval, - cms_attribute_value **val)); + cms_attribute_value **val); -extern CSA_return_code _DtCm_set_csa_access_attrval P(( +extern CSA_return_code _DtCm_set_csa_access_attrval( cms_access_entry *aval, - CSA_attribute_value **val)); + CSA_attribute_value **val); -extern CSA_return_code _DtCm_set_csa_uint32_attrval P(( +extern CSA_return_code _DtCm_set_csa_uint32_attrval( uint numval, - CSA_attribute_value **attrval)); + CSA_attribute_value **attrval); -extern CSA_return_code _DtCm_set_csa_string_attrval P(( +extern CSA_return_code _DtCm_set_csa_string_attrval( char *strval, CSA_attribute_value **attrval, - CSA_enum type)); + CSA_enum type); extern void _DtCm_get_attribute_types(uint size, int *types); diff --git a/cde/lib/csa/calendar.h b/cde/lib/csa/calendar.h index b7ab181e1..68bd39366 100644 --- a/cde/lib/csa/calendar.h +++ b/cde/lib/csa/calendar.h @@ -82,49 +82,49 @@ extern Calendar *_DtCm_active_cal_list; /* function prototypes */ -extern Calendar * _DtCm_new_Calendar P(( - const char *calenadr)); +extern Calendar * _DtCm_new_Calendar( + const char *calenadr); -extern void _DtCm_free_Calendar P(( - Calendar *cal)); +extern void _DtCm_free_Calendar( + Calendar *cal); -extern Calendar *_DtCm_get_Calendar P(( - CSA_session_handle calhandle)); +extern Calendar *_DtCm_get_Calendar( + CSA_session_handle calhandle); -extern uint _DtCm_add_to_entry_list P(( +extern uint _DtCm_add_to_entry_list( Calendar *cal, - caddr_t elist)); + caddr_t elist); -extern void _DtCm_remove_from_entry_list P(( +extern void _DtCm_remove_from_entry_list( Calendar *cal, caddr_t head, - caddr_t tail)); + caddr_t tail); -extern CSA_return_code _DtCm_list_old_cal_attr_names P(( +extern CSA_return_code _DtCm_list_old_cal_attr_names( Calendar *cal, CSA_uint32 *num_names_r, - char **names_r[])); + char **names_r[]); -extern CSA_return_code _DtCm_set_cal_attr P(( +extern CSA_return_code _DtCm_set_cal_attr( Calendar *cal, - CSA_attribute attr)); + CSA_attribute attr); -extern CSA_return_code _DtCm_get_all_cal_attrs P(( +extern CSA_return_code _DtCm_get_all_cal_attrs( Calendar *cal, CSA_uint32 *num_attrs, - CSA_attribute **attrs)); + CSA_attribute **attrs); -extern CSA_return_code _DtCm_get_cal_attrs_by_name P(( +extern CSA_return_code _DtCm_get_cal_attrs_by_name( Calendar *cal, CSA_uint32 num_names, CSA_attribute_reference *names, CSA_uint32 *num_attrs, - CSA_attribute **attrs)); + CSA_attribute **attrs); -extern void _DtCm_reset_cal_attrs P(( - Calendar *cal)); +extern void _DtCm_reset_cal_attrs( + Calendar *cal); -extern void _DtCm_count_entry_in_list P(( - caddr_t elist)); +extern void _DtCm_count_entry_in_list( + caddr_t elist); #endif diff --git a/cde/lib/csa/cmsdata.h b/cde/lib/csa/cmsdata.h index b133612f8..3fc472811 100644 --- a/cde/lib/csa/cmsdata.h +++ b/cde/lib/csa/cmsdata.h @@ -40,21 +40,21 @@ extern _DtCmNameTable *_DtCm_cal_name_tbl; extern _DtCmNameTable *_DtCm_entry_name_tbl; -extern void _DtCm_init_hash P((void)); +extern void _DtCm_init_hash(void); -extern cms_entry *_DtCm_make_cms_entry P((_DtCmNameTable *tbl)); +extern cms_entry *_DtCm_make_cms_entry(_DtCmNameTable *tbl); -extern CSA_return_code _DtCm_copy_cms_entry P(( +extern CSA_return_code _DtCm_copy_cms_entry( cms_entry *e, - cms_entry **e_r)); + cms_entry **e_r); -extern void _DtCm_free_cms_entry P((cms_entry *entry)); +extern void _DtCm_free_cms_entry(cms_entry *entry); -extern void _DtCm_free_cms_entries P((cms_entry *entry)); +extern void _DtCm_free_cms_entries(cms_entry *entry); -extern CSA_return_code _DtCmGrowAttrArray P(( +extern CSA_return_code _DtCmGrowAttrArray( uint *num_attr, cms_attribute **attrs, - cms_attribute *attr)); + cms_attribute *attr); #endif diff --git a/cde/lib/csa/cmxdr.h b/cde/lib/csa/cmxdr.h index e983646ba..0c58b8e01 100644 --- a/cde/lib/csa/cmxdr.h +++ b/cde/lib/csa/cmxdr.h @@ -39,27 +39,27 @@ * xdr routines for xapia csa data structures */ -bool_t xdr_CSA_extension P((XDR *xdrs, CSA_extension *objp)); +bool_t xdr_CSA_extension(XDR *xdrs, CSA_extension *objp); -bool_t xdr_CSA_date_time_entry P((XDR *xdrs, CSA_date_time_entry *objp)); +bool_t xdr_CSA_date_time_entry(XDR *xdrs, CSA_date_time_entry *objp); -bool_t xdr_CSA_date_time_list P((XDR *xdrs, CSA_date_time_list *objp)); +bool_t xdr_CSA_date_time_list(XDR *xdrs, CSA_date_time_list *objp); -bool_t xdr_CSA_calendar_user P((XDR *xdrs, CSA_calendar_user *objp)); +bool_t xdr_CSA_calendar_user(XDR *xdrs, CSA_calendar_user *objp); -bool_t xdr_CSA_access_rights P((XDR *xdrs, CSA_access_rights *objp)); +bool_t xdr_CSA_access_rights(XDR *xdrs, CSA_access_rights *objp); -bool_t xdr_CSA_access_list P((XDR *xdrs, CSA_access_list *objp)); +bool_t xdr_CSA_access_list(XDR *xdrs, CSA_access_list *objp); -bool_t xdr_CSA_attendee P((XDR *xdrs, CSA_attendee *objp)); +bool_t xdr_CSA_attendee(XDR *xdrs, CSA_attendee *objp); -bool_t xdr_CSA_attendee_list P((XDR *xdrs, CSA_attendee_list *objp)); +bool_t xdr_CSA_attendee_list(XDR *xdrs, CSA_attendee_list *objp); -bool_t xdr_CSA_opaque_data P((XDR *xdrs, CSA_opaque_data *objp)); +bool_t xdr_CSA_opaque_data(XDR *xdrs, CSA_opaque_data *objp); -bool_t xdr_CSA_reminder P((XDR *xdrs, CSA_reminder *objp)); +bool_t xdr_CSA_reminder(XDR *xdrs, CSA_reminder *objp); -bool_t xdr_CSA_attribute_value P((XDR *xdrs, CSA_attribute_value *objp)); +bool_t xdr_CSA_attribute_value(XDR *xdrs, CSA_attribute_value *objp); #endif diff --git a/cde/lib/csa/connection.h b/cde/lib/csa/connection.h index 059b7c0f0..880a59663 100644 --- a/cde/lib/csa/connection.h +++ b/cde/lib/csa/connection.h @@ -73,40 +73,40 @@ typedef struct conn { } _DtCm_Connection; #ifdef SunOS -extern enum clnt_stat _DtCm_clnt_call P(( +extern enum clnt_stat _DtCm_clnt_call( _DtCm_Connection *conn, u_long proc, xdrproc_t inproc, caddr_t in, xdrproc_t outproc, caddr_t out, - struct timeval tout)); + struct timeval tout); #endif -extern CSA_return_code _DtCm_add_registration P(( +extern CSA_return_code _DtCm_add_registration( _DtCm_Client_Info *ci, char *cal, - unsigned long update_type)); + unsigned long update_type); -extern void _DtCm_remove_registration P(( +extern void _DtCm_remove_registration( _DtCm_Client_Info *ci, - char *cal)); + char *cal); -extern CSA_return_code _DtCm_create_udp_client P(( +extern CSA_return_code _DtCm_create_udp_client( char *host, int version, int timeout, - _DtCm_Client_Info **clnt)); + _DtCm_Client_Info **clnt); -extern CSA_return_code _DtCm_create_tcp_client P(( +extern CSA_return_code _DtCm_create_tcp_client( char *host, int version, int timeout, - _DtCm_Client_Info **clnt)); + _DtCm_Client_Info **clnt); -extern CSA_return_code _DtCm_get_server_rpc_version P((char *host, int *vers)); +extern CSA_return_code _DtCm_get_server_rpc_version(char *host, int *vers); -extern CSA_return_code _DtCm_clntstat_to_csastat P((enum clnt_stat clntstat)); +extern CSA_return_code _DtCm_clntstat_to_csastat(enum clnt_stat clntstat); extern enum clnt_stat _DtCm_clnt_call(_DtCm_Connection *conn, u_long proc, xdrproc_t inproc, caddr_t in, diff --git a/cde/lib/csa/convert2-4.h b/cde/lib/csa/convert2-4.h index 3890b5fdc..5be873b52 100644 --- a/cde/lib/csa/convert2-4.h +++ b/cde/lib/csa/convert2-4.h @@ -37,13 +37,13 @@ rpc.cmsd version 4 data types */ -extern Table_Args_4 *_DtCm_tableargs2_to_tableargs4 P((Table_Args_2*)); -extern Table_Args_4 *_DtCm_tabledelargs2_to_tabledelargs4 P((Table_Args_2*, Options_4)); -extern Registration_4 *_DtCm_reg2_to_reg4 P((Registration_2*)); -extern Access_Args_4 *_DtCm_accargs2_to_accargs4 P((Access_Args_2*)); -extern Table_Res_4 *_DtCm_tableres2_to_tableres4 P((Table_Res_2*)); -extern Table_Status_4 _DtCm_tablestat2_to_tablestat4 P((Table_Status_2)); -extern Access_Status_4 _DtCm_accstat2_to_accstat4 P((Access_Status_2)); -extern Registration_Status_4 _DtCm_regstat2_to_regstat4 P((Registration_Status_2)); +extern Table_Args_4 *_DtCm_tableargs2_to_tableargs4(Table_Args_2*); +extern Table_Args_4 *_DtCm_tabledelargs2_to_tabledelargs4(Table_Args_2*, Options_4); +extern Registration_4 *_DtCm_reg2_to_reg4(Registration_2*); +extern Access_Args_4 *_DtCm_accargs2_to_accargs4(Access_Args_2*); +extern Table_Res_4 *_DtCm_tableres2_to_tableres4(Table_Res_2*); +extern Table_Status_4 _DtCm_tablestat2_to_tablestat4(Table_Status_2); +extern Access_Status_4 _DtCm_accstat2_to_accstat4(Access_Status_2); +extern Registration_Status_4 _DtCm_regstat2_to_regstat4(Registration_Status_2); #endif diff --git a/cde/lib/csa/convert3-4.h b/cde/lib/csa/convert3-4.h index 015a0a3c3..a80bf19fd 100644 --- a/cde/lib/csa/convert3-4.h +++ b/cde/lib/csa/convert3-4.h @@ -37,13 +37,13 @@ rpc.cmsd version 4 data types */ -extern Table_Args_4 *_DtCm_tableargs3_to_tableargs4 P((Table_Args_3*)); -extern Table_Args_4 *_DtCm_tabledelargs3_to_tabledelargs4 P((Table_Args_3*, Options_4)); -extern Registration_4 *_DtCm_reg3_to_reg4 P((Registration_3*)); -extern Access_Args_4 *_DtCm_accargs3_to_accargs4 P((Access_Args_3*)); -extern Table_Res_4 *_DtCm_tableres3_to_tableres4 P((Table_Res_3*)); -extern Table_Status_4 _DtCm_tablestat3_to_tablestat4 P((Table_Status_3)); -extern Access_Status_4 _DtCm_accstat3_to_accstat4 P((Access_Status_3)); -extern Registration_Status_4 _DtCm_regstat3_to_regstat4 P((Registration_Status_3)); +extern Table_Args_4 *_DtCm_tableargs3_to_tableargs4(Table_Args_3*); +extern Table_Args_4 *_DtCm_tabledelargs3_to_tabledelargs4(Table_Args_3*, Options_4); +extern Registration_4 *_DtCm_reg3_to_reg4(Registration_3*); +extern Access_Args_4 *_DtCm_accargs3_to_accargs4(Access_Args_3*); +extern Table_Res_4 *_DtCm_tableres3_to_tableres4(Table_Res_3*); +extern Table_Status_4 _DtCm_tablestat3_to_tablestat4(Table_Status_3); +extern Access_Status_4 _DtCm_accstat3_to_accstat4(Access_Status_3); +extern Registration_Status_4 _DtCm_regstat3_to_regstat4(Registration_Status_3); #endif diff --git a/cde/lib/csa/convert4-2.h b/cde/lib/csa/convert4-2.h index 177195719..ca973b1cc 100644 --- a/cde/lib/csa/convert4-2.h +++ b/cde/lib/csa/convert4-2.h @@ -37,18 +37,18 @@ rpc.cmsd version 2 data types */ -extern Table_Res_2 *_DtCm_tableres4_to_tableres2 P((Table_Res_4 *)); -extern Table_Status_2 _DtCm_tablestat4_to_tablestat2 P((Table_Status_4)); -extern Registration_Status_2 _DtCm_regstat4_to_regstat2 P((Registration_Status_4)); -extern Access_Status_2 _DtCm_accstat4_to_accstat2 P((Access_Status_4)); -extern Access_Args_2 *_DtCm_accargs4_to_accargs2 P((Access_Args_4*)); -extern Uid_2 *_DtCm_uid4_to_uid2 P((Uid_4*)); -extern Range_2 *_DtCm_range4_to_range2 P((Range_4*)); -extern Appt_2 *_DtCm_appt4_to_appt2 P((Appt_4*)); -extern void _DtCm_id4_to_id2 P((Id_4*, Id_2*)); -extern Access_Entry_2 *_DtCm_acclist4_to_acclist2 P((Access_Entry_4*)); -extern Uid_2 *_DtCm_uidopt4_to_uid2 P((Uidopt_4*)); -extern void _DtCm_free_attr2 P((Attribute_2 *a)); -extern void _DtCm_free_appt2 P((Appt_2 *a)); +extern Table_Res_2 *_DtCm_tableres4_to_tableres2(Table_Res_4 *); +extern Table_Status_2 _DtCm_tablestat4_to_tablestat2(Table_Status_4); +extern Registration_Status_2 _DtCm_regstat4_to_regstat2(Registration_Status_4); +extern Access_Status_2 _DtCm_accstat4_to_accstat2(Access_Status_4); +extern Access_Args_2 *_DtCm_accargs4_to_accargs2(Access_Args_4*); +extern Uid_2 *_DtCm_uid4_to_uid2(Uid_4*); +extern Range_2 *_DtCm_range4_to_range2(Range_4*); +extern Appt_2 *_DtCm_appt4_to_appt2(Appt_4*); +extern void _DtCm_id4_to_id2(Id_4*, Id_2*); +extern Access_Entry_2 *_DtCm_acclist4_to_acclist2(Access_Entry_4*); +extern Uid_2 *_DtCm_uidopt4_to_uid2(Uidopt_4*); +extern void _DtCm_free_attr2(Attribute_2 *a); +extern void _DtCm_free_appt2(Appt_2 *a); #endif diff --git a/cde/lib/csa/convert4-3.h b/cde/lib/csa/convert4-3.h index 177408622..216d281ea 100644 --- a/cde/lib/csa/convert4-3.h +++ b/cde/lib/csa/convert4-3.h @@ -37,19 +37,19 @@ rpc.cmsd version 3 data types */ -extern Table_Res_3 *_DtCm_tableres4_to_tableres3 P((Table_Res_4*)); -extern Table_Status_3 _DtCm_tablestat4_to_tablestat3 P((Table_Status_4)); -extern Registration_Status_3 _DtCm_regstat4_to_regstat3 P((Registration_Status_4)); -extern Access_Status_3 _DtCm_accstat4_to_accstat3 P((Access_Status_4)); -extern Access_Args_3 *_DtCm_accargs4_to_accargs3 P((Access_Args_4*)); -extern Uid_3 *_DtCm_uid4_to_uid3 P((Uid_4*)); -extern Range_3 *_DtCm_range4_to_range3 P((Range_4*)); -extern Appt_3 *_DtCm_appt4_to_appt3 P((Appt_4*)); -extern void _DtCm_id4_to_id3 P((Id_4*, Id_3*)); -extern Access_Entry_3 *_DtCm_acclist4_to_acclist3 P((Access_Entry_4*)); -extern Keyrange_3 *_DtCm_keyrange4_to_keyrange3 P((Keyrange_4*)); -extern Uid_3 *_DtCm_uidopt4_to_uid3 P((Uidopt_4*)); -extern void _DtCm_free_attr3 P((Attribute_3 *a)); -extern void _DtCm_free_appt3 P((Appt_3 *appts)); +extern Table_Res_3 *_DtCm_tableres4_to_tableres3(Table_Res_4*); +extern Table_Status_3 _DtCm_tablestat4_to_tablestat3(Table_Status_4); +extern Registration_Status_3 _DtCm_regstat4_to_regstat3(Registration_Status_4); +extern Access_Status_3 _DtCm_accstat4_to_accstat3(Access_Status_4); +extern Access_Args_3 *_DtCm_accargs4_to_accargs3(Access_Args_4*); +extern Uid_3 *_DtCm_uid4_to_uid3(Uid_4*); +extern Range_3 *_DtCm_range4_to_range3(Range_4*); +extern Appt_3 *_DtCm_appt4_to_appt3(Appt_4*); +extern void _DtCm_id4_to_id3(Id_4*, Id_3*); +extern Access_Entry_3 *_DtCm_acclist4_to_acclist3(Access_Entry_4*); +extern Keyrange_3 *_DtCm_keyrange4_to_keyrange3(Keyrange_4*); +extern Uid_3 *_DtCm_uidopt4_to_uid3(Uidopt_4*); +extern void _DtCm_free_attr3(Attribute_3 *a); +extern void _DtCm_free_appt3(Appt_3 *appts); #endif diff --git a/cde/lib/csa/convert4-5.h b/cde/lib/csa/convert4-5.h index 611e2c666..68f24755a 100644 --- a/cde/lib/csa/convert4-5.h +++ b/cde/lib/csa/convert4-5.h @@ -39,29 +39,29 @@ /* * functions to convert v4 data structures */ -extern CSA_return_code _DtCm_accessentry4_to_cmsaccesslist P(( +extern CSA_return_code _DtCm_accessentry4_to_cmsaccesslist( Access_Entry_4 *a4, - cms_access_entry **alist)); + cms_access_entry **alist); -extern CSA_return_code _DtCm_appt4_to_attrs P(( +extern CSA_return_code _DtCm_appt4_to_attrs( char *calname, Appt_4 *a4, uint num_attrs, cms_attribute *attrs, - boolean_t rerule)); + boolean_t rerule); -extern int _DtCm_eventtype4_to_type P((Event_Type_4 tag)); +extern int _DtCm_eventtype4_to_type(Event_Type_4 tag); -extern char *_DtCm_eventtype4_to_subtype P((Event_Type_4 tag)); +extern char *_DtCm_eventtype4_to_subtype(Event_Type_4 tag); -extern CSA_sint32 _DtCm_interval4_to_rtype P((Interval_4 val)); +extern CSA_sint32 _DtCm_interval4_to_rtype(Interval_4 val); -extern CSA_sint32 _DtCm_apptstatus4_to_status P((Appt_Status_4 stat)); +extern CSA_sint32 _DtCm_apptstatus4_to_status(Appt_Status_4 stat); -extern CSA_sint32 _DtCm_privacy4_to_classification P((Privacy_Level_4 p)); +extern CSA_sint32 _DtCm_privacy4_to_classification(Privacy_Level_4 p); -extern CSA_return_code _DtCmAttr4ToReminderValue P(( +extern CSA_return_code _DtCmAttr4ToReminderValue( Attribute_4 *remval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); #endif diff --git a/cde/lib/csa/convert5-4.h b/cde/lib/csa/convert5-4.h index 2d8021d6c..c99e2de7f 100644 --- a/cde/lib/csa/convert5-4.h +++ b/cde/lib/csa/convert5-4.h @@ -39,61 +39,61 @@ /* * conversion routines for rpc.cmsd version 5 to rpc.cmsd version 4 data types */ -extern CSA_return_code _DtCm_cmsattrs_to_apptdata P(( +extern CSA_return_code _DtCm_cmsattrs_to_apptdata( uint num_attrs, cms_attribute *attrs, - Appt_4 *appt4)); + Appt_4 *appt4); -extern CSA_return_code _DtCm_attrs_to_apptdata P(( +extern CSA_return_code _DtCm_attrs_to_apptdata( uint size, CSA_attribute *attrs, - Appt_4 *appt)); + Appt_4 *appt); -extern CSA_return_code _DtCm_cms_entry_to_appt4 P(( +extern CSA_return_code _DtCm_cms_entry_to_appt4( cms_entry *entry, - Appt_4 **appt4)); + Appt_4 **appt4); -extern CSA_return_code _DtCm_attrs_to_appt4 P(( +extern CSA_return_code _DtCm_attrs_to_appt4( uint num_attrs, CSA_attribute *attrs, - Appt_4 **appt4_r)); + Appt_4 **appt4_r); -extern CSA_return_code _DtCm_scope_to_options4 P(( +extern CSA_return_code _DtCm_scope_to_options4( CSA_enum scope, - Options_4 *opt)); + Options_4 *opt); -extern CSA_return_code _DtCm_csaaccesslist_toaccessentry4 P(( +extern CSA_return_code _DtCm_csaaccesslist_toaccessentry4( CSA_access_list alist, - Access_Entry_4 **a4)); + Access_Entry_4 **a4); -extern int _DtCm_string_to_eventtype4 P(( +extern int _DtCm_string_to_eventtype4( char *val, - Event_Type_4 *tag)); + Event_Type_4 *tag); -extern int _DtCm_rtype_to_interval4 P(( +extern int _DtCm_rtype_to_interval4( int val, - Interval_4 *period)); + Interval_4 *period); -extern int _DtCm_status_to_apptstatus4 P(( +extern int _DtCm_status_to_apptstatus4( int val, - Appt_Status_4 *astat)); + Appt_Status_4 *astat); -extern int _DtCm_classification_to_privacy4 P(( +extern int _DtCm_classification_to_privacy4( int val, - Privacy_Level_4 *privacy)); + Privacy_Level_4 *privacy); -extern CSA_return_code _DtCm_attrs_to_eventtype4 P(( +extern CSA_return_code _DtCm_attrs_to_eventtype4( cms_attribute_value *type, cms_attribute_value *stype, - Tag_4 *tag)); + Tag_4 *tag); -extern CSA_return_code _DtCm_remove_reminder P((char *rem, Appt_4 *appt)); +extern CSA_return_code _DtCm_remove_reminder(char *rem, Appt_4 *appt); -extern CSA_return_code _DtCm_add_reminder P(( +extern CSA_return_code _DtCm_add_reminder( char *rem, CSA_reminder * val, - Appt_4 *appt)); + Appt_4 *appt); -extern int _DtCmAccessRightToV4AccessType P((unsigned int access)); +extern int _DtCmAccessRightToV4AccessType(unsigned int access); #endif diff --git a/cde/lib/csa/debug.h b/cde/lib/csa/debug.h index 26fb5d266..c42385819 100644 --- a/cde/lib/csa/debug.h +++ b/cde/lib/csa/debug.h @@ -39,8 +39,8 @@ #define DP(a) #endif /* CM_DEBUG */ -extern void _DtCm_print_tick P((long)); +extern void _DtCm_print_tick(long); -extern void _DtCm_print_errmsg P((const char *)); +extern void _DtCm_print_errmsg(const char *); #endif /* _DEBUG_H */ diff --git a/cde/lib/csa/entry.h b/cde/lib/csa/entry.h index d3085e0a0..d8e09ac18 100644 --- a/cde/lib/csa/entry.h +++ b/cde/lib/csa/entry.h @@ -52,76 +52,76 @@ typedef struct _libentry { /* function prototypes */ -extern _DtCm_libentry *_DtCm_get_libentry P((CSA_entry_handle entryh)); +extern _DtCm_libentry *_DtCm_get_libentry(CSA_entry_handle entryh); -extern CSA_return_code _DtCm_make_libentry P(( +extern CSA_return_code _DtCm_make_libentry( cms_entry *cmsentry, - _DtCm_libentry **entry_r)); + _DtCm_libentry **entry_r); -extern CSA_return_code _DtCm_get_entry_detail P((_DtCm_libentry *entry)); +extern CSA_return_code _DtCm_get_entry_detail(_DtCm_libentry *entry); -extern CSA_return_code _DtCm_get_entry_attr_names P(( +extern CSA_return_code _DtCm_get_entry_attr_names( _DtCm_libentry *entry, CSA_uint32 *num_names_r, - char **names_r[])); + char **names_r[]); -extern CSA_return_code _DtCm_get_entry_attrs_by_name P(( +extern CSA_return_code _DtCm_get_entry_attrs_by_name( _DtCm_libentry *entry, CSA_uint32 num_names, CSA_attribute_reference *names, CSA_uint32 *num_attrs, - CSA_attribute **attrs)); + CSA_attribute **attrs); -extern CSA_return_code _DtCm_get_all_entry_attrs P(( +extern CSA_return_code _DtCm_get_all_entry_attrs( _DtCm_libentry *entry, CSA_uint32 *num_attrs, - CSA_attribute **attrs)); + CSA_attribute **attrs); -extern CSA_return_code _DtCm_libentry_to_entryh P(( +extern CSA_return_code _DtCm_libentry_to_entryh( _DtCm_libentry *elist, CSA_uint32 *size, - CSA_entry_handle **entries_r)); + CSA_entry_handle **entries_r); -extern CSA_return_code _DtCmCmsentriesToLibentries P(( +extern CSA_return_code _DtCmCmsentriesToLibentries( _DtCmNameTable **tbl, cms_entry *entries, - _DtCm_libentry **libentries)); + _DtCm_libentry **libentries); -extern CSA_return_code _DtCm_appt4_to_libentries P(( +extern CSA_return_code _DtCm_appt4_to_libentries( char *calname, Appt_4 *appt4, - _DtCm_libentry **libentries)); + _DtCm_libentry **libentries); -extern CSA_return_code _DtCm_libentries_to_appt4 P(( +extern CSA_return_code _DtCm_libentries_to_appt4( _DtCm_libentry *libentries, - Appt_4 **appt4)); + Appt_4 **appt4); -extern CSA_return_code _DtCm_reminder4_to_csareminder P(( +extern CSA_return_code _DtCm_reminder4_to_csareminder( Reminder_4 *r4, CSA_uint32 *num_rems, - CSA_reminder_reference **rems)); + CSA_reminder_reference **rems); -extern _DtCm_libentry *_DtCm_convert_entry_wheader P((_DtCm_libentry *entry)); +extern _DtCm_libentry *_DtCm_convert_entry_wheader(_DtCm_libentry *entry); -extern void _DtCm_free_libentries_from_list P(( +extern void _DtCm_free_libentries_from_list( _DtCm_libentry *head, - _DtCm_libentry *tail)); + _DtCm_libentry *tail); -extern void _DtCm_free_libentries P((_DtCm_libentry *entries)); +extern void _DtCm_free_libentries(_DtCm_libentry *entries); -extern void _DtCm_free_entry_handles P(( +extern void _DtCm_free_entry_handles( uint num_entries, - CSA_entry_handle *entries)); + CSA_entry_handle *entries); -extern void _DtCm_free_reminder_references P(( +extern void _DtCm_free_reminder_references( uint num_rems, - CSA_reminder_reference *rems)); + CSA_reminder_reference *rems); -extern void _DtCm_free_entry_content P((uint dummy, _DtCm_libentry *entry)); +extern void _DtCm_free_entry_content(uint dummy, _DtCm_libentry *entry); -extern CSA_return_code _DtCm_cms2csa_reminder_ref P(( +extern CSA_return_code _DtCm_cms2csa_reminder_ref( cms_reminder_ref *cmsrems, CSA_uint32 *num_rems, - CSA_reminder_reference **csarems)); + CSA_reminder_reference **csarems); #endif diff --git a/cde/lib/csa/free.h b/cde/lib/csa/free.h index a90a2b800..9d428af3b 100644 --- a/cde/lib/csa/free.h +++ b/cde/lib/csa/free.h @@ -49,7 +49,7 @@ extern void *_DtCm_alloc_entry(uint num_elem); extern CSA_return_code _DtCm_free(void *ptr); -extern void _DtCm_free_character_pointers P((uint num_elem, void *vptr)); +extern void _DtCm_free_character_pointers(uint num_elem, void *vptr); #endif diff --git a/cde/lib/csa/hash.h b/cde/lib/csa/hash.h index 8597b3a5d..b692a4b10 100644 --- a/cde/lib/csa/hash.h +++ b/cde/lib/csa/hash.h @@ -33,13 +33,13 @@ #include "ansi_c.h" -extern void * _DtCmMakeHash P((int size)); +extern void * _DtCmMakeHash(int size); -extern void ** _DtCmGetHash P((void * tbl, const unsigned char * key)); +extern void ** _DtCmGetHash(void * tbl, const unsigned char * key); -extern void ** _DtCmFindHash P((void * tbl,const unsigned char * key)); +extern void ** _DtCmFindHash(void * tbl,const unsigned char * key); -extern void _DtCmDestroyHash P((void * t, int (*ptr)(void *, void *, unsigned char *), void * usr_arg)); +extern void _DtCmDestroyHash(void * tbl, int (*des_func)(), void * usr_arg); #endif /* _HASH_H */ diff --git a/cde/lib/csa/laccess.h b/cde/lib/csa/laccess.h index f0b808b9d..c06abee09 100644 --- a/cde/lib/csa/laccess.h +++ b/cde/lib/csa/laccess.h @@ -33,8 +33,8 @@ #include "ansi_c.h" -extern boolean_t _DtCmIsSamePath P((char *str1, char *str2)); +extern boolean_t _DtCmIsSamePath(char *str1, char *str2); -extern boolean_t _DtCmIsSameUser P((char *user1, char *user2)); +extern boolean_t _DtCmIsSameUser(char *user1, char *user2); #endif diff --git a/cde/lib/csa/lutil.h b/cde/lib/csa/lutil.h index 174ccc0b2..8d54e14a1 100644 --- a/cde/lib/csa/lutil.h +++ b/cde/lib/csa/lutil.h @@ -33,16 +33,16 @@ #include "ansi_c.h" -extern char *_DtCmGetPrefix P((char *str, char sep)); +extern char *_DtCmGetPrefix(char *str, char sep); -extern char *_DtCmGetLocalHost P((void)); +extern char *_DtCmGetLocalHost(); -extern char *_DtCmGetLocalDomain P((char *hostname)); +extern char *_DtCmGetLocalDomain(char *hostname); -extern char *_DtCmGetHostAtDomain P((void)); +extern char *_DtCmGetHostAtDomain(); -extern char *_DtCmGetUserName P((void)); +extern char *_DtCmGetUserName(); -extern boolean_t _DtCmIsUserName P((char *user)); +extern boolean_t _DtCmIsUserName(char *user); #endif diff --git a/cde/lib/csa/match.h b/cde/lib/csa/match.h index 02d820ba5..857f05ce6 100644 --- a/cde/lib/csa/match.h +++ b/cde/lib/csa/match.h @@ -36,7 +36,7 @@ #include "cm.h" #include "rtable4.h" -extern CSA_return_code _DtCmHashCriteria P(( +extern CSA_return_code _DtCmHashCriteria( _DtCmNameTable *tbl, CSA_uint32 num_attrs, CSA_attribute *csaattrs, @@ -52,14 +52,14 @@ extern CSA_return_code _DtCmHashCriteria P(( long *id, CSA_uint32 *hnum, cms_attribute **hattrs, - CSA_enum **hops)); + CSA_enum **hops); -extern void _DtCmFreeHashedArrays P(( +extern void _DtCmFreeHashedArrays( CSA_uint32 hnum, cms_attribute *hattrs, - CSA_enum *hops)); + CSA_enum *hops); -extern Appt_4 *_DtCm_match_appts P(( +extern Appt_4 *_DtCm_match_appts( Appt_4 *appts, long id, boolean_t no_end_time_range, @@ -67,7 +67,7 @@ extern Appt_4 *_DtCm_match_appts P(( time_t end2, CSA_uint32 num_attrs, cms_attribute *attrs, - CSA_enum *ops)); + CSA_enum *ops); extern boolean_t _DtCm_match_one_appt( Appt_4 *appt, @@ -75,45 +75,45 @@ extern boolean_t _DtCm_match_one_appt( cms_attribute * attrs, CSA_enum *ops); -extern Reminder_4 *_DtCm_match_reminders P(( +extern Reminder_4 *_DtCm_match_reminders( Reminder_4 *rems, uint num_names, - char **names)); + char **names); -extern CSA_return_code _DtCm_check_operator P(( +extern CSA_return_code _DtCm_check_operator( uint size, CSA_attribute *csaattrs, cms_attribute *cmsattrs, - CSA_enum *ops)); + CSA_enum *ops); -extern boolean_t _DtCm_match_sint32_attribute P(( +extern boolean_t _DtCm_match_sint32_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); -extern boolean_t _DtCm_match_uint32_attribute P(( +extern boolean_t _DtCm_match_uint32_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); -extern boolean_t _DtCm_match_time_attribute P(( +extern boolean_t _DtCm_match_time_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); -extern boolean_t _DtCm_match_time_duration_attribute P(( +extern boolean_t _DtCm_match_time_duration_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); -extern boolean_t _DtCm_match_string_attribute P(( +extern boolean_t _DtCm_match_string_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); -extern boolean_t _DtCm_match_reminder_attribute P(( +extern boolean_t _DtCm_match_reminder_attribute( cms_attribute_value *val1, cms_attribute_value *val2, - CSA_enum op)); + CSA_enum op); #endif diff --git a/cde/lib/csa/nametbl.h b/cde/lib/csa/nametbl.h index b948dc951..bcf63beb0 100644 --- a/cde/lib/csa/nametbl.h +++ b/cde/lib/csa/nametbl.h @@ -52,22 +52,22 @@ typedef struct { char **names; } _DtCmNameTable; -extern _DtCmNameTable *_DtCm_make_name_table P(( +extern _DtCmNameTable *_DtCm_make_name_table( int size, - char **names)); + char **names); -extern void _DtCm_free_name_table P((_DtCmNameTable *tbl)); +extern void _DtCm_free_name_table(_DtCmNameTable *tbl); -extern CSA_return_code _DtCm_add_name_to_table P(( +extern CSA_return_code _DtCm_add_name_to_table( _DtCmNameTable *tbl, int index, - char *newname)); + char *newname); -extern int _DtCm_get_index_from_table P(( +extern int _DtCm_get_index_from_table( _DtCmNameTable *tbl, - char *name)); + char *name); -extern CSA_return_code _DtCmExtendNameTable P(( +extern CSA_return_code _DtCmExtendNameTable( char *name, int index, int type, @@ -75,7 +75,7 @@ extern CSA_return_code _DtCmExtendNameTable P(( int basesize, char **basenames, _DtCmNameTable **tbl, - int **types)); + int **types); #endif /* _NAMETBL_H */ diff --git a/cde/lib/csa/rpccalls.h b/cde/lib/csa/rpccalls.h index 43b9f53ff..91d70772d 100644 --- a/cde/lib/csa/rpccalls.h +++ b/cde/lib/csa/rpccalls.h @@ -40,98 +40,98 @@ * interface to cm rpc calls */ -extern CSA_return_code _DtCm_rpc_open_calendar P((Calendar *cal)); +extern CSA_return_code _DtCm_rpc_open_calendar(Calendar *cal); -extern CSA_return_code _DtCm_rpc_create_calendar P(( +extern CSA_return_code _DtCm_rpc_create_calendar( Calendar *cal, CSA_uint32 num_attrs, - CSA_attribute * attrs)); + CSA_attribute * attrs); -extern CSA_return_code _DtCm_rpc_delete_calendar P((Calendar *cal)); +extern CSA_return_code _DtCm_rpc_delete_calendar(Calendar *cal); -extern CSA_return_code _DtCm_rpc_register_client P(( +extern CSA_return_code _DtCm_rpc_register_client( Calendar *cal, - unsigned long type)); + unsigned long type); -extern CSA_return_code _DtCm_rpc_unregister_client P(( +extern CSA_return_code _DtCm_rpc_unregister_client( Calendar *cal, - unsigned long type)); + unsigned long type); -extern CSA_return_code _DtCm_rpc_enumerate_sequence P(( +extern CSA_return_code _DtCm_rpc_enumerate_sequence( Calendar *cal, _DtCm_libentry *entry, time_t start, time_t end, - _DtCm_libentry **elist_r)); + _DtCm_libentry **elist_r); -extern CSA_return_code _DtCm_rpc_lookup_entries P(( +extern CSA_return_code _DtCm_rpc_lookup_entries( Calendar *cal, CSA_uint32 size, CSA_attribute * attrs, CSA_enum *ops, - _DtCm_libentry **entries_r)); + _DtCm_libentry **entries_r); -extern CSA_return_code _DtCm_rpc_lookup_entry_by_id P(( +extern CSA_return_code _DtCm_rpc_lookup_entry_by_id( Calendar *cal, - _DtCm_libentry *entry)); + _DtCm_libentry *entry); -extern CSA_return_code _DtCm_rpc_lookup_reminder P(( +extern CSA_return_code _DtCm_rpc_lookup_reminder( Calendar *cal, time_t tick, CSA_uint32 num_names, char **reminder_names, CSA_uint32 *num_rems, - CSA_reminder_reference **rems)); + CSA_reminder_reference **rems); -extern CSA_return_code _DtCm_rpc_set_cal_attrs P(( +extern CSA_return_code _DtCm_rpc_set_cal_attrs( Calendar *cal, CSA_uint32 num_attrs, - CSA_attribute * attrs)); + CSA_attribute * attrs); -extern CSA_return_code _DtCm_rpc_get_cal_attrs P(( +extern CSA_return_code _DtCm_rpc_get_cal_attrs( Calendar *cal, int index, CSA_uint32 num_attrs, - char **names)); + char **names); -extern CSA_return_code _DtCm_rpc_insert_entry P(( +extern CSA_return_code _DtCm_rpc_insert_entry( Calendar *cal, CSA_uint32 num_attrs, CSA_attribute * attrs, - _DtCm_libentry **entry_r)); + _DtCm_libentry **entry_r); -extern CSA_return_code _DtCm_rpc_delete_entry P(( +extern CSA_return_code _DtCm_rpc_delete_entry( Calendar *cal, _DtCm_libentry *entry, - CSA_enum scope)); + CSA_enum scope); -extern CSA_return_code _DtCm_rpc_update_entry P(( +extern CSA_return_code _DtCm_rpc_update_entry( Calendar *cal, _DtCm_libentry *oentry, CSA_uint32 num_attrs, CSA_attribute * attrs, CSA_enum scope, - _DtCm_libentry **nentry)); + _DtCm_libentry **nentry); -extern CSA_return_code _DtCm_rpc_list_calendar_attributes P(( +extern CSA_return_code _DtCm_rpc_list_calendar_attributes( Calendar *cal, CSA_uint32 *number_names, - char ***names_r)); + char ***names_r); -extern CSA_return_code _DtCm_rpc_list_calendars P(( +extern CSA_return_code _DtCm_rpc_list_calendars( char *location, CSA_uint32 *number_names, - CSA_calendar_user **names_r)); + CSA_calendar_user **names_r); -extern CSA_return_code _DtCm_do_unregistration P(( +extern CSA_return_code _DtCm_do_unregistration( _DtCm_Connection *conn, char *cal, - unsigned long update_type)); + unsigned long update_type); -extern CSA_return_code _DtCm_do_registration P(( +extern CSA_return_code _DtCm_do_registration( _DtCm_Connection *conn, char *cal, - unsigned long update_type)); + unsigned long update_type); #endif diff --git a/cde/lib/csa/table.h b/cde/lib/csa/table.h index 52f1a447e..03352b7d4 100644 --- a/cde/lib/csa/table.h +++ b/cde/lib/csa/table.h @@ -42,24 +42,24 @@ * Interface to rpc calls of version 2-4 */ -extern CSA_return_code _DtCm_table_create P((Calendar *cal)); +extern CSA_return_code _DtCm_table_create(Calendar *cal); -extern CSA_return_code _DtCm_table_get_access P(( +extern CSA_return_code _DtCm_table_get_access( Calendar *cal, - cms_access_entry **acclist)); + cms_access_entry **acclist); -extern CSA_return_code _DtCm_table_set_access P(( +extern CSA_return_code _DtCm_table_set_access( Calendar *cal, - CSA_access_list alist)); + CSA_access_list alist); -extern CSA_return_code _DtCm_table_lookup_reminder P(( +extern CSA_return_code _DtCm_table_lookup_reminder( Calendar *cal, CSA_uint32 num_names, char **reminder_names, CSA_uint32 *num_rems, - CSA_reminder_reference **rems)); + CSA_reminder_reference **rems); -extern CSA_return_code _DtCm_table_lookup_range P(( +extern CSA_return_code _DtCm_table_lookup_range( Calendar *cal, long start1, long start2, @@ -70,11 +70,11 @@ extern CSA_return_code _DtCm_table_lookup_range P(( uint num_attrs, cms_attribute *attrs, CSA_enum *ops, - _DtCm_libentry **appts)); + _DtCm_libentry **appts); -extern CSA_return_code _DtCm_table_lookup P(( +extern CSA_return_code _DtCm_table_lookup( Calendar *cal, - _DtCm_libentry *entry)); + _DtCm_libentry *entry); /* * This routine looks up events of a repeating sequence. @@ -85,44 +85,44 @@ extern CSA_return_code _DtCm_table_lookup P(( * in the key of the first entry which will be returned in the cms_key * structure pointed to by key. */ -extern CSA_return_code _DtCm_table_lookup_key_range P(( +extern CSA_return_code _DtCm_table_lookup_key_range( Calendar *cal, _DtCm_libentry *entry, long id, time_t start, time_t end, cms_key *key, - _DtCm_libentry **elist_r)); + _DtCm_libentry **elist_r); -extern CSA_return_code _DtCm_table_insert P(( +extern CSA_return_code _DtCm_table_insert( Calendar *cal, uint num_attrs, CSA_attribute * attrs, - _DtCm_libentry **entries)); + _DtCm_libentry **entries); -extern CSA_return_code _DtCm_table_delete P(( +extern CSA_return_code _DtCm_table_delete( Calendar *cal, _DtCm_libentry *entry, - CSA_enum scope)); + CSA_enum scope); -extern CSA_return_code _DtCm_table_update P(( +extern CSA_return_code _DtCm_table_update( Calendar *cal, _DtCm_libentry *oentry, uint num_attrs, CSA_attribute * attrs, CSA_enum scope, - _DtCm_libentry **nentry)); + _DtCm_libentry **nentry); -extern CSA_return_code _DtCm_table_size P(( +extern CSA_return_code _DtCm_table_size( Calendar *cal, - int *size)); + int *size); -extern CSA_return_code _DtCm_table_unregister_target P(( +extern CSA_return_code _DtCm_table_unregister_target( _DtCm_Connection *conn, - char *cal)); + char *cal); -extern CSA_return_code _DtCm_table_register_target P(( +extern CSA_return_code _DtCm_table_register_target( _DtCm_Connection *conn, - char *cal)); + char *cal); #endif diff --git a/cde/lib/csa/updateattrs.h b/cde/lib/csa/updateattrs.h index be8791614..638a0d853 100644 --- a/cde/lib/csa/updateattrs.h +++ b/cde/lib/csa/updateattrs.h @@ -37,7 +37,7 @@ #include "cm.h" #include "nametbl.h" -extern CSA_return_code _DtCmUpdateAttributes P(( +extern CSA_return_code _DtCmUpdateAttributes( uint numsrc, cms_attribute *srcattrs, uint *numdst, @@ -45,34 +45,34 @@ extern CSA_return_code _DtCmUpdateAttributes P(( _DtCmNameTable **tbl, boolean_t caltbl, int **types, - boolean_t makecopy)); + boolean_t makecopy); -extern CSA_return_code _DtCmUpdateAttribute P(( +extern CSA_return_code _DtCmUpdateAttribute( cms_attribute *from, - cms_attribute *to)); + cms_attribute *to); -extern CSA_return_code _DtCmUpdateAccessListAttrVal P(( +extern CSA_return_code _DtCmUpdateAccessListAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmUpdateSint32AttrVal P(( +extern CSA_return_code _DtCmUpdateSint32AttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmUpdateStringAttrVal P(( +extern CSA_return_code _DtCmUpdateStringAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmUpdateReminderAttrVal P(( +extern CSA_return_code _DtCmUpdateReminderAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmUpdateDateTimeListAttrVal P(( +extern CSA_return_code _DtCmUpdateDateTimeListAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmUpdateOpaqueDataAttrVal P(( +extern CSA_return_code _DtCmUpdateOpaqueDataAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); #endif diff --git a/cde/lib/csa/xtclient.h b/cde/lib/csa/xtclient.h index 077b8d8b3..7be2b5442 100644 --- a/cde/lib/csa/xtclient.h +++ b/cde/lib/csa/xtclient.h @@ -34,6 +34,6 @@ #include #include "ansi_c.h" -extern void _DtCm_register_xtcallback P((XtAppContext appct)); +extern void _DtCm_register_xtcallback(XtAppContext appct); #endif /* _XTCLIENT_H */ diff --git a/cde/lib/tt/bin/ttauth/ttauth.man b/cde/lib/tt/bin/ttauth/ttauth.man index 93d8cfdaf..34cfd2717 100644 --- a/cde/lib/tt/bin/ttauth/ttauth.man +++ b/cde/lib/tt/bin/ttauth/ttauth.man @@ -18,7 +18,7 @@ .\" not be used in advertising or otherwise to promote the sale, use or .\" other dealings in this Software without prior written authorization .\" from The Open Group. -.TH TTAUTH 1 "Release 2.3.2a" "CDE" +.TH TTAUTH 1 "Release 2.3.2b" "CDE" .SH NAME ttauth \- ToolTalk authority file utility .SH SYNOPSIS diff --git a/cde/lib/tt/bin/tttar/tttar_file_utils.C b/cde/lib/tt/bin/tttar/tttar_file_utils.C index e911c29de..52dfb579e 100644 --- a/cde/lib/tt/bin/tttar/tttar_file_utils.C +++ b/cde/lib/tt/bin/tttar/tttar_file_utils.C @@ -231,8 +231,8 @@ realtrees( _Tt_string_list_ptr paths, bool_t follow_symlinks ) * symlink instead of the path of the * linked file. */ - char *dir = dirname( (char *)path ); - char *base = basename( (char *)path ); + char *dir = dirname_tt( (char *)path ); + char *base = basename_tt( (char *)path ); resolved_path = _tt_get_realpath( dir, resolved_path_buf ); if (resolved_path != NULL) { @@ -354,10 +354,9 @@ append_real_subtrees( _Tt_string_list_ptr realtrees, _Tt_string path ) } /* append_real_subtrees() */ /* - * basename() - Return the last component of a pathname. + * basename_tt() - Return the last component of a pathname. */ -#if !defined(__linux__) -char *basename( char *pathname ) { +char *basename_tt( char *pathname ) { char *the_basename; the_basename = strrchr( pathname, '/' ); @@ -368,14 +367,13 @@ char *basename( char *pathname ) { } return the_basename; } -#endif /* - * dirname() - Return the pathname minus the basename, or "." if the + * dirname_tt() - Return the pathname minus the basename, or "." if the * basename is all there is. Caller is responsible for free()ing * the storage returned. */ -char *dirname( char *pathname ) { +char *dirname_tt( char *pathname ) { char *the_basename; char *the_dirname; diff --git a/cde/lib/tt/bin/tttar/tttar_file_utils.h b/cde/lib/tt/bin/tttar/tttar_file_utils.h index 87de5bb0e..0c4c661b9 100644 --- a/cde/lib/tt/bin/tttar/tttar_file_utils.h +++ b/cde/lib/tt/bin/tttar/tttar_file_utils.h @@ -49,7 +49,7 @@ _Tt_string_list_ptr realtrees( _Tt_string_list_ptr paths, bool_t follow_symlinks ); void append_real_subtrees( _Tt_string_list_ptr realtrees, _Tt_string path ); -char *basename( char *pathname ); -char *dirname( char *pathname ); +char *basename_tt( char *pathname ); +char *dirname_tt( char *pathname ); #endif /* _LSTAR_FILE_UTILS_H */ diff --git a/cde/lib/tt/tooltalk.tmpl b/cde/lib/tt/tooltalk.tmpl index a06b920ab..a749ace2d 100644 --- a/cde/lib/tt/tooltalk.tmpl +++ b/cde/lib/tt/tooltalk.tmpl @@ -6,7 +6,7 @@ /* TT_VERSION defines the version string which is imbedded in all the */ /* binaries and shipped libraries. */ -TT_VERSION = "CDE Version 2.3.2a" +TT_VERSION = "CDE Version 2.3.2b" TT_VERSION_DEFINE = -DTT_VERSION_STRING=\"$(TT_VERSION)\" diff --git a/cde/programs/dtappbuilder/src/abmf/write_c.c b/cde/programs/dtappbuilder/src/abmf/write_c.c index f991f6061..263e57cc5 100644 --- a/cde/programs/dtappbuilder/src/abmf/write_c.c +++ b/cde/programs/dtappbuilder/src/abmf/write_c.c @@ -350,10 +350,10 @@ write_func_def_params( va_list va_params ) { -#if defined(__ppc) || defined(__linux__) -#define va_start_params() __va_copy(params, va_params) -#elif defined(CSRG_BASED) +#if defined(va_copy) || defined(CSRG_BASED) #define va_start_params() va_copy(params, va_params) +#elif defined(__ppc) || defined(__linux__) +#define va_start_params() __va_copy(params, va_params) #else #define va_start_params() (params = va_params) #endif diff --git a/cde/programs/dtcalc/calctool.c b/cde/programs/dtcalc/calctool.c index 28bae5b5f..30be94ee7 100644 --- a/cde/programs/dtcalc/calctool.c +++ b/cde/programs/dtcalc/calctool.c @@ -318,7 +318,7 @@ clear_display(void) v->defState = 1 ; i = 0 ; mpcim(&i, v->MPdisp_val) ; - STRCPY(v->display, make_number(v->MPdisp_val, FALSE)) ; + strcpy(v->display, make_number(v->MPdisp_val, FALSE)) ; set_item(DISPLAYITEM, v->display) ; v->hyperbolic = 0 ; @@ -419,7 +419,7 @@ void doerr(char *errmes) { if (!v->started) return ; - STRCPY(v->display, errmes) ; + strcpy(v->display, errmes) ; set_item(DISPLAYITEM, v->display) ; v->error = 1 ; beep() ; @@ -434,7 +434,7 @@ get_bool_resource(enum res_type rtype, int *boolval) int len, n ; if ((val = get_resource(rtype)) == NULL) return(0) ; - STRCPY(tempstr, val) ; + strcpy(tempstr, val) ; len = strlen(tempstr) ; for (n = 0; n < len; n++) if (isupper(tempstr[n])) tempstr[n] = tolower(tempstr[n]) ; @@ -504,9 +504,9 @@ get_label(int n) temp = buttons[n].str; if(temp != NULL) - STRCPY(v->pstr, temp) ; + strcpy(v->pstr, temp) ; else - STRCPY(v->pstr, ""); + strcpy(v->pstr, ""); } /* Extract command line options. */ @@ -546,7 +546,7 @@ get_options(int argc, char *argv[]) sprintf(msg, opts[(int) O_MODE], next); getparam(next, argv, msg) ; XtFree(msg); - STRCPY(strval, next) ; + strcpy(strval, next) ; len = strlen(strval) ; for (i = 0; i < len; i++) { @@ -571,7 +571,7 @@ get_options(int argc, char *argv[]) break ; case 'b' : INC ; getparam(next, argv, opts[(int) O_BASE]) ; - STRCPY(strval, next) ; + strcpy(strval, next) ; len = strlen(strval) ; for (i = 0; i < len; i++) { @@ -605,7 +605,7 @@ get_options(int argc, char *argv[]) sprintf(msg, opts[(int) O_DISPLAY], next); getparam(next, argv, msg) ; XtFree(msg); - STRCPY(strval, next) ; + strcpy(strval, next) ; len = strlen(strval) ; for (i = 0; i < len; i++) { @@ -645,7 +645,7 @@ get_options(int argc, char *argv[]) sprintf(msg, opts[(int) O_TRIG], next); getparam(next, argv, msg) ; XtFree(msg); - STRCPY(strval, next) ; + strcpy(strval, next) ; len = strlen(strval) ; for (i = 0; i < len; i++) { @@ -695,14 +695,14 @@ getparam(char *s, char *argv[], char *errmes) { char *msg; - if (*argv != NULL && argv[0][0] != '-') STRCPY(s, *argv) ; + if (*argv != NULL && argv[0][0] != '-') strcpy(s, *argv) ; else { msg = (char *) XtMalloc(strlen(mess[(int) MESS_PARAM]) + strlen(errmes) + 3); sprintf(msg, mess[(int) MESS_PARAM], errmes); _DtSimpleError (v->appname, DtError, NULL, msg); - FPRINTF(stderr, mess[(int) MESS_PARAM], errmes) ; + fprintf(stderr, mess[(int) MESS_PARAM], errmes) ; exit(1) ; } } @@ -783,8 +783,8 @@ get_rcfile(char *name) } else if (isval == 'f') { - SSCANF(&line[3], "%s", tmp) ; - STRCPY(v->fun_vals[i], convert(tmp)) ; + sscanf(&line[3], "%s", tmp) ; + strcpy(v->fun_vals[i], convert(tmp)) ; } else if (isval == 'r') { @@ -800,18 +800,18 @@ get_rcfile(char *name) line[strlen(line)-1] = '\0' ; if (isval == 'c') { - STRCPY(tmp, make_number(v->MPcon_vals[i], TRUE)) ; - SPRINTF(v->con_names[i], "%1d: %s [%s]", + strcpy(tmp, make_number(v->MPcon_vals[i], TRUE)) ; + sprintf(v->con_names[i], "%1d: %s [%s]", i, tmp, &line[n]) ; } else - SPRINTF(v->fun_names[i], "%1d: %s [%s]", + sprintf(v->fun_names[i], "%1d: %s [%s]", i, tmp, &line[n]) ; break ; } } } - FCLOSE(rcfd) ; + fclose(rcfd) ; } /* Get a string resource from database. */ @@ -822,7 +822,7 @@ get_str_resource(enum res_type rtype, char *strval) int i, len ; if ((val = get_resource(rtype)) == NULL) return(0) ; - STRCPY(strval, val) ; + strcpy(strval, val) ; len = strlen(strval) ; if(rtype != R_TRIG && rtype != R_DISPLAY) { @@ -1013,7 +1013,7 @@ make_eng_sci(int *MPnumber) } } - STRCPY(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ; + strcpy(fixed, make_fixed(MPmant, MAX_DIGITS-6)) ; len = strlen(fixed) ; for (i = 0; i < len; i++) *optr++ = fixed[i] ; @@ -1515,7 +1515,7 @@ process_stack(int startop, int startnum, int n) int i ; int nptr ; /* Pointer to next number from numeric stack. */ - STRCPY(sdisp, v->display) ; /* Save current display. */ + strcpy(sdisp, v->display) ; /* Save current display. */ nptr = startnum ; v->pending = 0 ; v->cur_op = '?' ; /* Current operation is initially undefined. */ @@ -1546,7 +1546,7 @@ process_stack(int startop, int startnum, int n) v->opsptr = startop - 1 ; push_op(-1) ; save_pending_values(KEY_LPAR) ; - STRCPY(v->display, sdisp) ; /* Restore current display. */ + strcpy(v->display, sdisp) ; /* Restore current display. */ } @@ -1557,8 +1557,8 @@ process_str(char *str, enum menu_type mtype) char save[80]; len = strlen(str) ; - STRCPY(save, v->display) ; - STRCPY(v->display, " ") ; + strcpy(save, v->display) ; + strcpy(v->display, " ") ; set_item(DISPLAYITEM, v->display); for (i = 0 ; i < len; i++) { @@ -1568,7 +1568,7 @@ process_str(char *str, enum menu_type mtype) { if(mtype == M_FUN) { - STRCPY(v->display, save); + strcpy(v->display, save); set_item(DISPLAYITEM, v->display); v->error = 0; } @@ -1613,11 +1613,11 @@ read_rcfiles(void) /* Read .dtcalcrc's from home and current directories. */ for (n = 0; n < MAXREGS; n++) { - STRCPY(tmp, make_number(v->MPcon_vals[n], FALSE)) ; - SPRINTF(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ; + strcpy(tmp, make_number(v->MPcon_vals[n], FALSE)) ; + sprintf(name, "%1d: %s [%s]", n, tmp, v->con_names[n]) ; - STRCPY(v->con_names[n], name) ; - STRCPY(v->fun_vals[n], "") ; /* Initially empty function strings. */ + strcpy(v->con_names[n], name) ; + strcpy(v->fun_vals[n], "") ; /* Initially empty function strings. */ } if ((home = getenv("HOME")) == NULL) @@ -1638,7 +1638,7 @@ show_display(int *MPval) { if (!v->error) { - STRCPY(v->display, make_number(MPval, TRUE)) ; + strcpy(v->display, make_number(MPval, TRUE)) ; set_item(DISPLAYITEM, v->display) ; } } @@ -1647,9 +1647,9 @@ show_display(int *MPval) void usage(char *progname) { - FPRINTF(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ; - FPRINTF(stderr, "%s", ustrs[(int) USAGE2]) ; - FPRINTF(stderr, "%s", ustrs[(int) USAGE3]) ; + fprintf(stderr, ustrs[(int) USAGE1], PATCHLEVEL) ; + fprintf(stderr, "%s", ustrs[(int) USAGE2]) ; + fprintf(stderr, "%s", ustrs[(int) USAGE3]) ; exit(1) ; } @@ -1668,7 +1668,7 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen struct passwd *entry ; /* The user's /etc/passwd entry. */ rcexists = 0 ; - SPRINTF(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ; + sprintf(rcname, "%s/%s", getcwd(pathname, MAXPATHLEN), RCNAME) ; if (access(rcname, F_OK) == 0) rcexists = 1 ; else { @@ -1677,17 +1677,17 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen if ((entry = getpwuid(getuid())) == NULL) return ; home = entry->pw_dir ; } - SPRINTF(rcname, "%s/%s", home, RCNAME) ; + sprintf(rcname, "%s/%s", home, RCNAME) ; if (access(rcname, F_OK) == 0) rcexists = 1 ; } - STRCPY(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ; - MKTEMP(tmp_filename) ; + strcpy(tmp_filename, "/tmp/.dtcalcrcXXXXXX") ; + mktemp(tmp_filename) ; if ((tmpfd = fopen(tmp_filename, "w+")) == NULL) return ; if (rcexists) { rcfd = fopen(rcname, "r") ; - SPRINTF(sval, " %1d", cfno) ; + sprintf(sval, " %1d", cfno) ; while (fgets(str, MAXLINE, rcfd)) { if (exists) @@ -1695,40 +1695,40 @@ write_rcfile(enum menu_type mtype, int exists, int cfno, char *val, char *commen switch (mtype) { case M_CON : sval[0] = 'c' ; - if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ; + if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ; sval[0] = 'C' ; - if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ; + if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ; break ; case M_FUN : sval[0] = 'f' ; - if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ; + if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ; sval[0] = 'F' ; - if (!strncmp(str, sval, 2)) FPUTS("#", tmpfd) ; + if (!strncmp(str, sval, 2)) fputs("#", tmpfd) ; break; default: break; } } - FPRINTF(tmpfd, "%s", str) ; + fprintf(tmpfd, "%s", str) ; } - FCLOSE(rcfd) ; + fclose(rcfd) ; } switch (mtype) { - case M_CON : FPRINTF(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ; + case M_CON : fprintf(tmpfd, "\nC%1d %s %s\n", cfno, val, comment) ; break ; case M_FUN : if(strcmp(val, "") != 0) - FPRINTF(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ; + fprintf(tmpfd, "\nF%1d %s %s\n", cfno, val, comment) ; break; default: break; } - UNLINK(rcname) ; + unlink(rcname) ; rcfd = fopen(rcname, "w") ; - REWIND(tmpfd) ; - while (fgets(str, MAXLINE, tmpfd)) FPRINTF(rcfd, "%s", str) ; - FCLOSE(rcfd) ; - FCLOSE(tmpfd); - UNLINK(tmp_filename) ; + rewind(tmpfd) ; + while (fgets(str, MAXLINE, tmpfd)) fprintf(rcfd, "%s", str) ; + fclose(rcfd) ; + fclose(tmpfd); + unlink(tmp_filename) ; } @@ -1738,7 +1738,7 @@ write_resources(char *filename) char intval[5] ; int MPtemp[MP_SIZE]; - SPRINTF(intval, "%d", v->accuracy) ; + sprintf(intval, "%d", v->accuracy) ; put_resource(R_ACCURACY, intval) ; put_resource(R_DISPLAYED, v->display) ; put_resource(R_BASE, base_str[(int) v->base]) ; diff --git a/cde/programs/dtcalc/calctool.h b/cde/programs/dtcalc/calctool.h index 25833ded5..806d0f7e5 100644 --- a/cde/programs/dtcalc/calctool.h +++ b/cde/programs/dtcalc/calctool.h @@ -31,6 +31,9 @@ * (c) Copyright 1993, 1994 Sun Microsystems, Inc. * * (c) Copyright 1993, 1994 Novell, Inc. * */ +#ifndef _calctool_h +#define _calctool_h + #include @@ -88,14 +91,6 @@ extern char *_DtGetMessage(char *filename, int set, int n, char *s); #endif #endif /* sun */ -/* For all function declarations, if ANSI then use a prototype. */ - -#if defined(__STDC__) -#define P(args) args -#else /* ! __STDC__ */ -#define P(args) () -#endif /* STDC */ - #ifdef hpux #define HIL_PC101_KBD 1 #define HIL_ITF_KBD 2 @@ -116,19 +111,6 @@ extern char *_DtGetMessage(char *filename, int set, int n, char *s); #define MP_SIZE 150 /* Size of the multiple precision values. */ -#define FCLOSE (void) fclose /* To make lint happy. */ -#define FPRINTF (void) fprintf -#define FPUTS (void) fputs -#define FREE (void) free -#define MEMCPY (void) memcpy -#define MKTEMP (void) mktemp -#define REWIND (void) rewind -#define SPRINTF (void) sprintf -#define SSCANF (void) sscanf -#define STRCPY (void) strcpy -#define STRNCAT (void) strncat -#define UNLINK (void) unlink - /* Various pseudo events used by the dtcalc program. */ #define KEYBOARD_DOWN 100 /* Keyboard character was pressed. */ #define KEYBOARD_UP 101 /* Keyboard character was released. */ @@ -581,205 +563,206 @@ extern ApplicationArgs application_args; #define dmax(a, b) (double) max(a, b) #define dmin(a, b) (double) min(a, b) -BOOLEAN ibool P((double)) ; -BOOLEAN ibool2 P((double)) ; +BOOLEAN ibool(double); +BOOLEAN ibool2(double); -char *convert P((char *)) ; -char *get_resource P((enum res_type)) ; -char *make_eng_sci P((int *)) ; -char *make_fixed P((int *, int)) ; -char *make_number P((int *, BOOLEAN)) ; +char *convert(char *); +char *get_resource(enum res_type); +char *make_eng_sci(int *); +char *make_fixed(int *, int); +char *make_number(int *, BOOLEAN); -double mppow_di P((double *, int *)) ; -double mppow_ri P((float *, int *)) ; -double setbool P((BOOLEAN)) ; +double mppow_di(double *, int *); +double mppow_ri(float *, int *); +double setbool(BOOLEAN); -int char_val P((char)) ; -int get_bool_resource P((enum res_type, int *)) ; -int get_index P((char)) ; -int get_int_resource P((enum res_type, int *)) ; -int get_str_resource P((enum res_type, char *)) ; -int main P((int, char **)) ; +int char_val(char); +int get_bool_resource(enum res_type, int *); +int get_index(char); +int get_int_resource(enum res_type, int *); +int get_str_resource(enum res_type, char *); +int main(int, char **); -void beep P(()) ; -void check_ow_beep P(()) ; -void clear_display P(()) ; -void doerr P((char *)) ; -void do_accuracy P(()) ; -void do_ascii P(()) ; -void do_base P(()) ; -void set_base P(()) ; -void do_business P(()) ; -void do_calc P(()) ; -void do_dtcalc P((int, char **)) ; -void do_clear P(()) ; -void do_constant P(()) ; -void do_delete P(()) ; -void do_exchange P(()) ; -void do_expno P(()) ; -void do_factorial P((int *, int *)) ; -void do_frame P(()) ; -void do_function P(()) ; -void do_immed P(()) ; -void do_keys P(()) ; -void do_mode P(()) ; -void do_none P(()) ; -void do_number P(()) ; -void do_numtype P(()) ; -void do_paren P(()) ; -void set_numtype P((enum num_type dtype)); -void do_nothing P(()) ; -void do_pending P(()) ; -void do_point P(()) ; -void do_portion P(()) ; -double do_round P((double, int)) ; -void do_shift P(()) ; -void do_sto_rcl P(()) ; -void do_trig P(()) ; -void do_trigtype P(()) ; -void draw_button P((int, enum fcp_type, int, int, int)) ; -void get_display P(()) ; -void get_key_val P((char *, char *)) ; -void get_label P((int)) ; -void get_options P((int, char **)) ; -void getparam P((char *, char **, char *)) ; -void get_rcfile P((char *)) ; -void grey_button P((int, int, int)) ; -void grey_buttons P((enum base_type)) ; -void handle_menu_selection P((int, int)) ; -void handle_selection P(()) ; -void initialize P(()) ; -void init_cmdline_opts P(()) ; -void init_graphics P(()) ; -void init_options P(()) ; -void init_text P(()) ; -void init_vars P(()) ; -void key_init P(()) ; -void load_resources P(()) ; -void make_frames P(()) ; -void make_items P(()) ; -void make_modewin P(()) ; -void make_fin_registers P(()) ; -void make_registers P((int)) ; -void MPstr_to_num P((char *, enum base_type, int *)) ; -void paren_disp P((char)) ; -void process_event P((int)) ; -void process_item P((int)) ; -void process_parens P((char)) ; -void process_stack P((int, int, int)) ; -void process_str P((char *, enum menu_type)) ; -void push_num P((int *)) ; -void push_op P((int)) ; -void put_resource P((enum res_type, char *)) ; -void read_rcfiles P(()) ; -void read_resources P(()) ; -void redraw_buttons P(()) ; -void save_cmdline P((int, char **)) ; -void save_pending_values P((int)) ; -void save_resources P((char *)) ; -void blank_display P(()) ; -void ErrorDialog P((char *string)); -void set_item P((enum item_type, char *)) ; -void set_title P((enum fcp_type, char *)) ; -void show_ascii_frame P(()) ; -void show_display P((int *)) ; -void srand48 P(()) ; -void start_tool P(()) ; -void switch_hands P((int)) ; -void usage P((char *)) ; -void win_display P((enum fcp_type, int)) ; -void write_cmdline P(()) ; -void write_rcfile P((enum menu_type, int, int, char *, char *)) ; -void write_resources P((char *)) ; -void RestoreSession P(()) ; -void TimerEvent P(( XtPointer, XtIntervalId *)) ; -void ErrDialog P(( char *, Widget )); +void beep(void); +void check_ow_beep(void); +void clear_display(void); +void doerr(char *); +void do_accuracy(void); +void do_ascii(void); +void do_base(void); +void set_base(enum base_type type); +void do_business(void); +void do_calc(void); +void do_dtcalc(int, char **); +void do_clear(void); +void do_constant(void); +void do_delete(void); +void do_exchange(void); +void do_expno(void); +void do_factorial(int *, int *); +void do_frame(void); +void do_function(void); +void do_immed(void); +void do_keys(void); +void do_mode(void); +void do_none(void); +void do_number(void); +void do_numtype(void); +void do_paren(void); +void set_numtype(enum num_type dtype); +void do_nothing(void); +void do_pending(void); +void do_point(void); +void do_portion(void); +double do_round(double, int); +void do_shift(void); +void do_sto_rcl(void); +void do_trig(void); +void do_trigtype(void); +void draw_button(int, enum fcp_type, int, int, int); +void get_display(void); +void get_key_val(char *, char *); +void get_label(int); +void get_options(int, char **); +void getparam(char *, char **, char *); +void get_rcfile(char *); +void grey_button(int, int, int); +void grey_buttons(enum base_type); +void handle_menu_selection(int, int); +void handle_selection(void); +void initialize(void); +void init_cmdline_opts(void); +void init_graphics(void); +void init_options(void); +void init_text(void); +void init_vars(void); +void key_init(void); +void load_resources(void); +void make_frames(void); +void make_items(void); +void make_modewin(void); +void make_fin_registers(void); +void make_registers(int); +void MPstr_to_num(char *, enum base_type, int *); +void paren_disp(char); +void process_event(int); +void process_item(int); +void process_parens(char); +void process_stack(int, int, int); +void process_str(char *, enum menu_type); +void push_num(int *); +void push_op(int); +void put_resource(enum res_type, char *); +void read_rcfiles(void); +void read_resources(void); +void redraw_buttons(void); +void save_cmdline(int, char **); +void save_pending_values(int); +void save_resources(char *); +void blank_display(void); +void ErrorDialog(char *string); +void set_item(enum item_type, char *); +void set_title(enum fcp_type, char *); +void show_ascii_frame(void); +void show_display(int *); +void srand48(long); +void start_tool(void); +void switch_hands(int); +void usage(char *); +void win_display(enum fcp_type, int); +void write_cmdline(void); +void write_rcfile(enum menu_type, int, int, char *, char *); +void write_resources(char *); +void RestoreSession(void); +void TimerEvent(XtPointer, XtIntervalId *); +void ErrDialog(char *, Widget ); /* MP routines not found in the Brent FORTRAN package. */ -void mpacos P((int *, int *)) ; -void mpacosh P((int *, int *)) ; -void mpasinh P((int *, int *)) ; -void mpatanh P((int *, int *)) ; -void mplog10 P((int *, int *)) ; +void mpacos(int *, int *); +void mpacosh(int *, int *); +void mpasinh(int *, int *); +void mpatanh(int *, int *); +void mplog10(int *, int *); /* Brent MP routines in mp.c. */ -int mpcmpi P((int *, int *)) ; -int mpcmpr P((int *, float *)) ; -int mpcomp P((int *, int *)) ; -int pow_ii P((int *, int *)) ; +int mpcmpi(int *, int *); +int mpcmpr(int *, float *); +int mpcomp(int *, int *); +int pow_ii(int *, int *); -int mpeq P((int *, int *)) ; -int mpge P((int *, int *)) ; -int mpgt P((int *, int *)) ; -int mple P((int *, int *)) ; -int mplt P((int *, int *)) ; +int mpeq(int *, int *); +int mpge(int *, int *); +int mpgt(int *, int *); +int mple(int *, int *); +int mplt(int *, int *); -void mpabs P((int *, int *)) ; -void mpadd P((int *, int *, int *)) ; -void mpadd2 P((int *, int *, int *, int *, int *)) ; -void mpadd3 P((int *, int *, int *, int *, int *)) ; -void mpaddi P((int *, int *, int *)) ; -void mpaddq P((int *, int *, int *, int *)) ; -void mpart1 P((int *, int *)) ; -void mpasin P((int *, int *)) ; -void mpatan P((int *, int *)) ; -void mpcdm P((double *, int *)) ; -void mpchk P((int *, int *)) ; -void mpcim P((int *, int *)) ; -void mpcmd P((int *, double *)) ; -void mpcmf P((int *, int *)) ; -void mpcmi P((int *, int *)) ; -void mpcmim P((int *, int *)) ; -void mpcmr P((int *, float *)) ; -void mpcos P((int *, int *)) ; -void mpcosh P((int *, int *)) ; -void mpcqm P((int *, int *, int *)) ; -void mpcrm P((float *, int *)) ; -void mpdiv P((int *, int *, int *)) ; -void mpdivi P((int *, int *, int *)) ; -void mperr P(()) ; -void mpexp P((int *, int *)) ; -void mpexp1 P((int *, int *)) ; -void mpext P((int *, int *, int *)) ; -void mpgcd P((int *, int *)) ; -void mpln P((int *, int *)) ; -void mplns P((int *, int *)) ; -void mpmaxr P((int *)) ; -void mpmlp P((int *, int *, int *, int *)) ; -void mpmul P((int *, int *, int *)) ; -void mpmul2 P((int *, int *, int *, int *)) ; -void mpmuli P((int *, int *, int *)) ; -void mpmulq P((int *, int *, int *, int *)) ; -void mpneg P((int *, int *)) ; -void mpnzr P((int *, int *, int *, int *)) ; -void mpovfl P((int *)) ; -void mppi P((int *)) ; -void mppwr P((int *, int *, int *)) ; -void mppwr2 P((int *, int *, int *)) ; -void mprec P((int *, int *)) ; -void mproot P((int *, int *, int *)) ; -void mpset P((int *, int *, int *)) ; -void mpsin P((int *, int *)) ; -void mpsin1 P((int *, int *, int *)) ; -void mpsinh P((int *, int *)) ; -void mpsqrt P((int *, int *)) ; -void mpstr P((int *, int *)) ; -void mpsub P((int *, int *, int *)) ; -void mptanh P((int *, int *)) ; -void mpunfl P((int *)) ; +void mpabs(int *, int *); +void mpadd(int *, int *, int *); +void mpadd2(int *, int *, int *, int *, int *); +void mpadd3(int *, int *, int *, int *, int *); +void mpaddi(int *, int *, int *); +void mpaddq(int *, int *, int *, int *); +void mpart1(int *, int *); +void mpasin(int *, int *); +void mpatan(int *, int *); +void mpcdm(double *, int *); +void mpchk(int *, int *); +void mpcim(int *, int *); +void mpcmd(int *, double *); +void mpcmf(int *, int *); +void mpcmi(int *, int *); +void mpcmim(int *, int *); +void mpcmr(int *, float *); +void mpcos(int *, int *); +void mpcosh(int *, int *); +void mpcqm(int *, int *, int *); +void mpcrm(float *, int *); +void mpdiv(int *, int *, int *); +void mpdivi(int *, int *, int *); +void mperr(void); +void mpexp(int *, int *); +void mpexp1(int *, int *); +void mpext(int *, int *, int *); +void mpgcd(int *, int *); +void mpln(int *, int *); +void mplns(int *, int *); +void mpmaxr(int *); +void mpmlp(int *, int *, int *, int *); +void mpmul(int *, int *, int *); +void mpmul2(int *, int *, int *, int *); +void mpmuli(int *, int *, int *); +void mpmulq(int *, int *, int *, int *); +void mpneg(int *, int *); +void mpnzr(int *, int *, int *, int *); +void mpovfl(int *); +void mppi(int *); +void mppwr(int *, int *, int *); +void mppwr2(int *, int *, int *); +void mprec(int *, int *); +void mproot(int *, int *, int *); +void mpset(int *, int *, int *); +void mpsin(int *, int *); +void mpsin1(int *, int *, int *); +void mpsinh(int *, int *); +void mpsqrt(int *, int *); +void mpstr(int *, int *); +void mpsub(int *, int *, int *); +void mptanh(int *, int *); +void mpunfl(int *); /* Help routines */ -void Help P((char *, char *)) ; -void HelpRequestCB P(()) ; -void HelpModeCB P(()) ; -void HelpCloseCB P(()) ; -void HelpHyperlinkCB P(()) ; -void DisplayHelp P((char *, char *)) ; -void CenterMsgCB P(()) ; -void HelpHelp P(()) ; -void SetWmHnts P(()) ; +void Help(char *, char *); +void HelpRequestCB(Widget, caddr_t, caddr_t); +void HelpModeCB(Widget, caddr_t, caddr_t); +void HelpCloseCB(Widget, caddr_t, caddr_t); +void HelpHyperlinkCB(Widget, caddr_t, caddr_t); +void DisplayHelp(char *, char *); +void CenterMsgCB(Widget, XtPointer, XtPointer); +void HelpHelp(void); +void SetWmHnts(void); -void _DtmapCB P((Widget, XtPointer, XtPointer)) ; +void _DtmapCB(Widget, XtPointer, XtPointer); -void set_option_menu P((int, int)) ; +void set_option_menu(int, int); +#endif /* _calctool_h */ diff --git a/cde/programs/dtcalc/ds_common.c b/cde/programs/dtcalc/ds_common.c index 45076a0e8..478acb147 100644 --- a/cde/programs/dtcalc/ds_common.c +++ b/cde/programs/dtcalc/ds_common.c @@ -36,18 +36,14 @@ #include #include "ds_common.h" -#define FREE (void) free -#define STRCPY (void) strcpy - - void read_str(char **str, char *value) { - if (*str != NULL) FREE(*str) ; + if (*str != NULL) free(*str) ; if (value != NULL && strlen(value)) { *str = (char *) malloc((unsigned) (strlen(value) + 1)) ; - STRCPY(*str, value) ; + strcpy(*str, value) ; } else *str = NULL ; } diff --git a/cde/programs/dtcalc/ds_common.h b/cde/programs/dtcalc/ds_common.h index 80da300bb..6077aa536 100644 --- a/cde/programs/dtcalc/ds_common.h +++ b/cde/programs/dtcalc/ds_common.h @@ -38,16 +38,8 @@ #include #include -/* For all function declarations, if ANSI then use a prototype. */ +char *set_bool(int); -#if defined(__STDC__) -#define P(args) args -#else /* ! __STDC__ */ -#define P(args) () -#endif /* STDC */ - -char *set_bool P((int)) ; - -void read_str P((char **, char *)) ; +void read_str(char **, char *); #endif /*_ds_common_h*/ diff --git a/cde/programs/dtcalc/ds_popup.c b/cde/programs/dtcalc/ds_popup.c index 39d9b1d8f..ea475eb0a 100644 --- a/cde/programs/dtcalc/ds_popup.c +++ b/cde/programs/dtcalc/ds_popup.c @@ -50,7 +50,7 @@ extern XmWidgetExtData _XmGetWidgetExtData( #include "calctool.h" #include "motif.h" -void _DtChildPosition P((Widget, Widget, Position *, Position *)) ; +void _DtChildPosition(Widget, Widget, Position *, Position *); /* ARGSUSED */ void diff --git a/cde/programs/dtcalc/ds_popup.h b/cde/programs/dtcalc/ds_popup.h index 5775134db..769747aff 100644 --- a/cde/programs/dtcalc/ds_popup.h +++ b/cde/programs/dtcalc/ds_popup.h @@ -38,14 +38,6 @@ #include #include -/* For all function declarations, if ANSI then use a prototype. */ - -#if defined(__STDC__) -#define P(args) args -#else /* ! __STDC__ */ -#define P(args) () -#endif /* STDC */ - /* Location ops for ds_position_popup(). */ enum ds_location_op { @@ -58,12 +50,12 @@ enum ds_location_op { DS_POPUP_CENTERED /* Center popup within baseframe */ } ; -int ds_position_popup P((Widget, Widget, enum ds_location_op)) ; -int ds_force_popup_on_screen P((Widget, int *, int *)) ; +int ds_position_popup(Widget, Widget, enum ds_location_op); +int ds_force_popup_on_screen(Widget, int *, int *); -void ds_get_screen_size P((Widget, int *, int *)) ; +void ds_get_screen_size(Widget, int *, int *); -void _DtGenericMapWindow P((Widget shell, Widget parent )); -void _DtChildPosition P((Widget w, Widget parent, Position *newX, Position *newY)); +void _DtGenericMapWindow(Widget shell, Widget parent); +void _DtChildPosition(Widget w, Widget parent, Position *newX, Position *newY); #endif /*!_ds_popup_h*/ diff --git a/cde/programs/dtcalc/ds_widget.h b/cde/programs/dtcalc/ds_widget.h index da1291b9b..1becb092e 100644 --- a/cde/programs/dtcalc/ds_widget.h +++ b/cde/programs/dtcalc/ds_widget.h @@ -45,14 +45,6 @@ #include #include -/* For all function declarations, if ANSI then use a prototype. */ - -#if defined(__STDC__) -#define P(args) args -#else /* ! __STDC__ */ -#define P(args) () -#endif /* STDC */ - enum choice_type { CH_ACTIVE, CH_VALUE } ; /* Choice operations. */ /* Text widget operations. */ @@ -74,20 +66,20 @@ struct tW_struct { /* Text widget structure. */ Widget textfield ; /* xmTextWidgetClass. */ } ; -int get_choice P((struct cW_struct *, enum choice_type)) ; +int get_choice(struct cW_struct *, enum choice_type); -struct cW_struct *make_choiceW P((Widget, char *, char **, int, int, - int, void (*)())) ; -struct tW_struct *make_textW P((Widget, char *)) ; +struct cW_struct *make_choiceW(Widget, char *, char **, int, int, + int, void (*)()); +struct tW_struct *make_textW(Widget, char *); -Widget make_butW P((Widget, char *)) ; -Widget make_labelW P((Widget, char *)) ; -Widget make_manW P((char *, Widget, int, int)) ; -Widget make_toggleW P((Widget, char *)) ; +Widget make_butW(Widget, char *); +Widget make_labelW(Widget, char *); +Widget make_manW(char *, Widget, int, int); +Widget make_toggleW(Widget, char *); -void set_choice P((struct cW_struct *, enum choice_type, int)) ; -void set_choice_help P((struct cW_struct *, char *)) ; -void set_text_help P((struct tW_struct *, char *)) ; -void set_text_str P((struct tW_struct *, enum text_type, char *)) ; +void set_choice(struct cW_struct *, enum choice_type, int); +void set_choice_help(struct cW_struct *, char *); +void set_text_help(struct tW_struct *, char *); +void set_text_str(struct tW_struct *, enum text_type, char *); #endif /*_ds_widget_h*/ diff --git a/cde/programs/dtcalc/ds_xlib.h b/cde/programs/dtcalc/ds_xlib.h index 1afdd6fbb..5e50abc18 100644 --- a/cde/programs/dtcalc/ds_xlib.h +++ b/cde/programs/dtcalc/ds_xlib.h @@ -39,31 +39,23 @@ #include #include -/* For all function declarations, if ANSI then use a prototype. */ - -#if defined(__STDC__) -#define P(args) args -#else /* ! __STDC__ */ -#define P(args) () -#endif /* STDC */ - /* Function declarations. */ -char *ds_get_resource P((XrmDatabase, char *, char *)) ; +char *ds_get_resource(XrmDatabase, char *, char *); -int ds_get_choice_value P((Widget)) ; -int ds_get_strwidth P((XFontStruct *, char *)) ; -int ds_save_resources P((XrmDatabase, char *)) ; +int ds_get_choice_value(Widget) ; +int ds_get_strwidth(XFontStruct *, char *); +int ds_save_resources(XrmDatabase, char *) ; -void ds_add_help P((Widget, char *)) ; -void ds_beep P((Display *)) ; -void ds_get_geometry_size P((char *, int *, int *)) ; -void ds_get_frame_size P((Widget, int *, int *, int *, int *)) ; -void ds_put_resource P((XrmDatabase *, char *, char *, char *)) ; -void ds_save_cmdline P((Display *, Window, int, char **)) ; -void ds_set_choice_value P((Widget, int)) ; -void ds_set_frame_size P((Widget, int, int, int, int)) ; +void ds_add_help(Widget, char *); +void ds_beep(Display *); +void ds_get_geometry_size(char *, int *, int *); +void ds_get_frame_size(Widget, int *, int *, int *, int *); +void ds_put_resource(XrmDatabase *, char *, char *, char *); +void ds_save_cmdline(Display *, Window, int, char **); +void ds_set_choice_value(Widget, int); +void ds_set_frame_size(Widget, int, int, int, int); -XrmDatabase ds_load_resources P((Display *)) ; +XrmDatabase ds_load_resources(Display *); #endif /*_ds_xlib_h*/ diff --git a/cde/programs/dtcalc/functions.c b/cde/programs/dtcalc/functions.c index f1d4bcf19..e6ca52e6e 100644 --- a/cde/programs/dtcalc/functions.c +++ b/cde/programs/dtcalc/functions.c @@ -336,7 +336,7 @@ do_business(void) /* Perform special business mode calculations. */ make_registers(FIN) ; v->funstate = 1; - STRCPY(v->display, display_number); + strcpy(v->display, display_number); set_item(DISPLAYITEM, v->display); need_show = FALSE; } @@ -641,15 +641,15 @@ do_expno(void) /* Get exponential number. */ v->pointed = (strchr(v->display, '.') != NULL) ; if (!v->new_input) { - STRCPY(v->display, "1.0 +") ; + strcpy(v->display, "1.0 +") ; v->new_input = v->pointed = 1 ; } else if (!v->pointed) { - STRNCAT(v->display, ". +", 3) ; + strncat(v->display, ". +", 3) ; v->pointed = 1 ; } - else if (!v->key_exp) STRNCAT(v->display, " +", 2) ; + else if (!v->key_exp) strncat(v->display, " +", 2) ; v->toclear = 0 ; v->key_exp = 1 ; v->exp_posn = strchr(v->display, '+') ; @@ -910,7 +910,7 @@ do_number(void) if (v->toclear) { - SPRINTF(v->display, "%c", nextchar) ; + sprintf(v->display, "%c", nextchar) ; v->toclear = 0 ; } else @@ -990,7 +990,7 @@ do_paren(void) if(tmpdb == 0.0) { v->cur_op = '?'; - STRCPY(v->display, "") ; + strcpy(v->display, "") ; set_item(DISPLAYITEM, v->display) ; } else @@ -1009,7 +1009,7 @@ do_paren(void) } else { - STRCPY(v->display, "") ; + strcpy(v->display, "") ; set_item(DISPLAYITEM, v->display) ; } } @@ -1127,10 +1127,10 @@ do_point(void) /* Handle numeric point. */ { if (v->toclear) { - STRCPY(v->display, ".") ; + strcpy(v->display, ".") ; v->toclear = 0 ; } - else STRNCAT(v->display, ".", 1) ; + else strncat(v->display, ".", 1) ; v->pointed = 1 ; } else @@ -1644,7 +1644,7 @@ process_parens(char current) { set_item(DISPLAYITEM, vstrs[(int) V_ERROR]) ; set_item(OPITEM, vstrs[(int) V_CLR]) ; - STRCPY(v->display, vstrs[(int) V_ERROR]) ; + strcpy(v->display, vstrs[(int) V_ERROR]) ; } else { @@ -1664,7 +1664,7 @@ push_num(int *MPval) /* Try to push value onto the numeric stack. */ if (v->numsptr < 0) return ; if (v->numsptr >= MAXSTACK) { - STRCPY(v->display, vstrs[(int) V_NUMSTACK]) ; + strcpy(v->display, vstrs[(int) V_NUMSTACK]) ; set_item(DISPLAYITEM, v->display) ; v->error = 1 ; beep() ; @@ -1686,7 +1686,7 @@ push_op(int val) /* Try to push value onto the operand stack. */ if (v->opsptr < 0) return ; if (v->opsptr >= MAXSTACK) { - STRCPY(v->display, vstrs[(int) V_OPSTACK]) ; + strcpy(v->display, vstrs[(int) V_OPSTACK]) ; set_item(DISPLAYITEM, v->display) ; v->error = 1 ; set_item(OPITEM, vstrs[(int) V_CLR]) ; diff --git a/cde/programs/dtcalc/help.c b/cde/programs/dtcalc/help.c index 0d60cc780..5eea3ad9a 100644 --- a/cde/programs/dtcalc/help.c +++ b/cde/programs/dtcalc/help.c @@ -56,7 +56,7 @@ extern struct button buttons[] ; /* Calculator button values. */ extern Boolean ignore_event; extern XtIntervalId timerId; -extern void _DtChildPosition P((Widget, Widget, Position *, Position *)) ; +extern void _DtChildPosition(Widget, Widget, Position *, Position *); typedef struct _helpStruct { struct _helpStruct *pNext; @@ -65,8 +65,8 @@ typedef struct _helpStruct { Boolean inUse; } HelpStruct; -static Widget GetHelpDialog P(()) ; -static void UnmanageCB P(()) ; +static Widget GetHelpDialog(void); +static void UnmanageCB(Widget, XtPointer, XtPointer) ; void Help(char *helpVolume, char *locationId) diff --git a/cde/programs/dtcalc/motif.c b/cde/programs/dtcalc/motif.c index 78b3f7291..6fbcde177 100644 --- a/cde/programs/dtcalc/motif.c +++ b/cde/programs/dtcalc/motif.c @@ -187,47 +187,47 @@ typedef struct Window icon; } WM_STATE; -void menu_proc P((Widget, XtPointer, XtPointer)) ; -void show_ascii P((Widget, XtPointer, XtPointer)) ; -void write_cf_value P((Widget, XtPointer, XtPointer)) ; -void close_cf P((Widget, XtPointer, XtPointer)) ; -void close_ascii P((Widget, XtPointer, XtPointer)) ; -void move_cf P((Widget, XtPointer, XtPointer)) ; -void FocusInCB P((Widget, XtPointer, XtPointer)) ; -void map_popup P((Widget, XtPointer, XtPointer)) ; +void menu_proc(Widget, XtPointer, XtPointer); +void show_ascii(Widget, XtPointer, XtPointer); +void write_cf_value(Widget, XtPointer, XtPointer); +void close_cf(Widget, XtPointer, XtPointer); +void close_ascii(Widget, XtPointer, XtPointer); +void move_cf(Widget, XtPointer, XtPointer); +void FocusInCB(Widget, XtPointer, XtPointer); +void map_popup(Widget, XtPointer, XtPointer); -static int event_is_keypad P((XEvent *)) ; -static int get_next_event P((Widget, int, XEvent *)) ; -static int is_window_showing P((Widget)) ; +static int event_is_keypad(XEvent *); +static int get_next_event(Widget, int, XEvent *); +static int is_window_showing(Widget); -static KeySym keypad_keysym P((XEvent *)) ; +static KeySym keypad_keysym(XEvent *); -static void modelineValueChanged P((Widget, XtPointer, XtPointer)) ; -static void dtcalc_kkeyboard_create P((Widget)) ; -static void dtcalc_kpanel_create P((Widget)) ; -static void confirm_callback P((Widget, XtPointer, XtPointer)) ; -static void create_cfframe P(()) ; -static void create_menu P((enum menu_type, Widget, int)) ; -static void do_button P((Widget, XtPointer, XtPointer)) ; -static void do_confirm_notice P((Widget, char *)) ; -static void do_continue_notice P((Widget, char *)) ; -static void close_reg P((Widget, XtPointer, XtPointer)) ; -static void event_proc P((Widget, XtPointer, XEvent *, Boolean *)) ; -static void frame_interpose P((Widget, XtPointer, XEvent *, Boolean *)) ; -static void menu_handler P((Widget, XtPointer, XEvent *, Boolean *)) ; -static void popupHandler P((Widget, XtPointer, XEvent *, Boolean *)) ; -static void new_cf_value P((Widget, XtPointer, XtPointer)) ; -static void do_memory P((Widget, XtPointer, XtPointer)) ; -static void switch_mode P((enum mode_type)) ; -static void update_cf_value P(()) ; -static void xerror_interpose P((Display *, XErrorEvent *)) ; +static void modelineValueChanged(Widget, XtPointer, XtPointer); +static void dtcalc_kkeyboard_create(Widget); +static void dtcalc_kpanel_create(Widget); +static void confirm_callback(Widget, XtPointer, XtPointer); +static void create_cfframe(void); +static void create_menu(enum menu_type, Widget, int); +static void do_button(Widget, XtPointer, XtPointer); +static void do_confirm_notice(Widget, char *); +static void do_continue_notice(Widget, char *); +static void close_reg(Widget, XtPointer, XtPointer); +static void event_proc(Widget, XtPointer, XEvent *, Boolean *); +static void frame_interpose(Widget, XtPointer, XEvent *, Boolean *); +static void menu_handler(Widget, XtPointer, XEvent *, Boolean *); +static void popupHandler(Widget, XtPointer, XEvent *, Boolean *); +static void new_cf_value(Widget, XtPointer, XtPointer); +static void do_memory(Widget, XtPointer, XtPointer); +static void switch_mode(enum mode_type); +static void update_cf_value(void); +static void xerror_interpose(Display *, XErrorEvent *); -static Widget button_create P((Widget, int, int, int, int)) ; -static void save_state P((Widget, XtPointer, XtPointer)) ; -static void SaveSession P(( char *, char * )) ; -static void setCalcHints P(()) ; +static Widget button_create(Widget, int, int, int, int); +static void save_state(Widget, XtPointer, XtPointer); +static void SaveSession(char *, char *); +static void setCalcHints(void); -static char * _DtcalcStripSpaces P(( char * )) ; +static char * _DtcalcStripSpaces(char *); static void ProcessMotifSelection(Widget); static void create_menu_bar(Widget parent); @@ -295,7 +295,7 @@ main(int argc, char **argv) tmpStr = GETMESSAGE(2, 31, "Could not open display.\n"); msg = XtNewString(tmpStr); - FPRINTF(stderr, "%s", msg) ; + fprintf(stderr, "%s", msg) ; exit(1) ; } @@ -446,7 +446,7 @@ button_create(Widget owner, int row, int column, int maxrows, int maxcols) if (mtype != M_NONE) create_menu(mtype, button, n) ; val = (v->curwin << 16) + n ; XtAddCallback(button, XmNactivateCallback, do_button, (XtPointer) val) ; - XtAddCallback(button, XmNhelpCallback, HelpRequestCB, (XtPointer) val) ; + XtAddCallback(button, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) val) ; XtAddEventHandler(button, KeyPressMask | KeyReleaseMask, FALSE, event_proc, NULL) ; @@ -504,7 +504,7 @@ dtcalc_initialize_rframe(Widget owner, int type) XmNdefaultPosition, FALSE, NULL) ; - SPRINTF(str, "register%1d", 0) ; + sprintf(str, "register%1d", 0) ; X->registers[0] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -518,7 +518,7 @@ dtcalc_initialize_rframe(Widget owner, int type) for (i = 1; i < MAXREGS; i++) { - SPRINTF(str, "register%1d", i) ; + sprintf(str, "register%1d", i) ; X->registers[i] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -587,7 +587,7 @@ dtcalc_initialize_rframe(Widget owner, int type) XmNdefaultPosition, FALSE, NULL) ; - SPRINTF(str, "fregister%1d", 0) ; + sprintf(str, "fregister%1d", 0) ; X->fregisters[0] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -601,7 +601,7 @@ dtcalc_initialize_rframe(Widget owner, int type) for (i = 1; i < FINREGS; i++) { - SPRINTF(str, "fregister%1d", i) ; + sprintf(str, "fregister%1d", i) ; X->fregisters[i] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -615,7 +615,7 @@ dtcalc_initialize_rframe(Widget owner, int type) NULL) ; } - SPRINTF(str, "fregistervals%1d", 0) ; + sprintf(str, "fregistervals%1d", 0) ; X->fregistersvals[0] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -632,7 +632,7 @@ dtcalc_initialize_rframe(Widget owner, int type) for (i = 1; i < FINREGS; i++) { - SPRINTF(str, "fregistervals%1d", i) ; + sprintf(str, "fregistervals%1d", i) ; X->fregistersvals[i] = XtVaCreateManagedWidget(str, xmLabelWidgetClass, form, @@ -806,7 +806,7 @@ dtcalc_kpanel_create(Widget owner) XmNleftAttachment, XmATTACH_FORM, XmNnavigationType, XmTAB_GROUP, NULL) ; - XtAddCallback(X->textFrame, XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->textFrame, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer)HELP_DISPLAY) ; X->textForm = XtVaCreateManagedWidget("textForm", @@ -816,7 +816,7 @@ dtcalc_kpanel_create(Widget owner) XmNbackground, tmp_pixelbg, XmNforeground, tmp_pixelfg, NULL) ; - XtAddCallback(X->textForm, XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->textForm, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer)HELP_DISPLAY) ; X->modevals[(int) DISPLAYITEM] = XtVaCreateManagedWidget("display", @@ -833,7 +833,7 @@ dtcalc_kpanel_create(Widget owner) XmNbackground, tmp_pixelbg, XmNforeground, tmp_pixelfg, NULL) ; - XtAddCallback(X->modevals[(int) DISPLAYITEM], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[(int) DISPLAYITEM], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_DISPLAY) ; XtAddEventHandler(X->modevals[(int) DISPLAYITEM], KeyPressMask | KeyReleaseMask, FALSE, event_proc, NULL) ; @@ -851,7 +851,7 @@ dtcalc_kpanel_create(Widget owner) XmNleftAttachment, XmATTACH_FORM, XmNnavigationType, XmTAB_GROUP, NULL) ; - XtAddCallback(X->modeFrame, XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modeFrame, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODELINE) ; X->modeline = XtVaCreateManagedWidget("modeline", @@ -859,7 +859,7 @@ dtcalc_kpanel_create(Widget owner) X->modeFrame, XmNshadowThickness, 0, NULL) ; - XtAddCallback(X->modeline, XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modeline, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODELINE) ; label_string = XmStringCreateLocalized (" "); @@ -873,7 +873,7 @@ dtcalc_kpanel_create(Widget owner) XmNalignment, XmALIGNMENT_CENTER, XmNlabelString, label_string, NULL) ; - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODELINE) ; i = (int) HYPITEM; @@ -887,7 +887,7 @@ dtcalc_kpanel_create(Widget owner) XmNalignment, XmALIGNMENT_CENTER, XmNlabelString, label_string, NULL) ; - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODELINE) ; i = (int) INVITEM; @@ -901,7 +901,7 @@ dtcalc_kpanel_create(Widget owner) XmNalignment, XmALIGNMENT_CENTER, XmNlabelString, label_string, NULL) ; - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODELINE) ; XmStringFree(label_string); @@ -952,7 +952,7 @@ dtcalc_kpanel_create(Widget owner) XtSetArg(args[n], XmNmenuHistory, modeArry[(int)v->modetype]); n++; X->modevals[i] = XmCreateOptionMenu(X->modeline, "mode", args, n); XtManageChild (X->modevals[i]); - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_MODE) ; XtOverrideTranslations(X->modevals[i], trans_table); @@ -1016,7 +1016,7 @@ dtcalc_kpanel_create(Widget owner) XtSetArg(args[n], XmNmenuHistory, X->baseWidgArry[(int)v->base]); n++; X->modevals[i] = XmCreateOptionMenu(X->modeline, "base", args, n); XtManageChild (X->modevals[i]); - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_BASE) ; XtOverrideTranslations(X->modevals[i], trans_table); @@ -1070,7 +1070,7 @@ dtcalc_kpanel_create(Widget owner) XtSetArg(args[n], XmNmenuHistory, X->numWidgArry[(int)v->dtype]); n++; X->modevals[i] = XmCreateOptionMenu(X->modeline, "num", args, n); XtManageChild (X->modevals[i]); - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_NOTATION) ; XtOverrideTranslations(X->modevals[i], trans_table); @@ -1128,7 +1128,7 @@ dtcalc_kpanel_create(Widget owner) XtSetArg(args[n], XmNmenuHistory, X->ttypeWidgArry[(int)v->ttype]); n++; X->modevals[i] = XmCreateOptionMenu(X->modeline, "trig", args, n); XtManageChild (X->modevals[i]); - XtAddCallback(X->modevals[i], XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->modevals[i], XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_TRIG) ; XtOverrideTranslations(X->modevals[i], trans_table); @@ -1825,7 +1825,7 @@ ProcessMotifSelection(Widget W) display[i+1] = '\0'; } - STRCPY(v->display, display); + strcpy(v->display, display); XtFree(display); } @@ -2054,7 +2054,7 @@ get_resource(enum res_type rtype) { char str[MAXLINE] ; - STRCPY(str, calc_res[(int) rtype]) ; + strcpy(str, calc_res[(int) rtype]) ; return(ds_get_resource(X->rDB, v->appname, str)) ; } @@ -2174,7 +2174,7 @@ make_frames(void) { tool_label = (char *) calloc(1, strlen(lstrs[(int) L_UCALC]) + 3); - SPRINTF(tool_label, "%s", lstrs[(int) L_UCALC]); + sprintf(tool_label, "%s", lstrs[(int) L_UCALC]); } else read_str(&tool_label, v->titleline) ; @@ -2227,7 +2227,7 @@ make_registers(int type) { for (i = 0; i < MAXREGS; i++) { - SPRINTF(line, "%s: %s", menu_entries[i + 10].str, + sprintf(line, "%s: %s", menu_entries[i + 10].str, make_number(v->MPmvals[i], FALSE)) ; { @@ -2350,7 +2350,7 @@ new_cf_value(Widget widget, XtPointer client_data, XtPointer call_data) XmStringFree(cstr) ; XtRemoveAllCallbacks(X->CFpi_butHelp, XmNactivateCallback); - XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, HelpRequestCB, + XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_CONSTANT); } else @@ -2363,7 +2363,7 @@ new_cf_value(Widget widget, XtPointer client_data, XtPointer call_data) XmStringFree(cstr) ; XtRemoveAllCallbacks(X->CFpi_butHelp, XmNactivateCallback); - XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, HelpRequestCB, + XtAddCallback(X->CFpi_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_FUNCTION); } @@ -2633,7 +2633,7 @@ show_ascii_frame(void) /* Display ASCII popup. */ XtAddCallback(X->Api_butOK, XmNactivateCallback, show_ascii, NULL) ; XtAddCallback(X->Api_butClose, XmNactivateCallback, close_ascii, (XtPointer) NULL) ; - XtAddCallback(X->Api_butHelp, XmNactivateCallback, HelpRequestCB, + XtAddCallback(X->Api_butHelp, XmNactivateCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer) HELP_ASCII) ; j = 0; @@ -2975,7 +2975,7 @@ update_cf_value(void) } /* need to run a "compute" of what was typed in */ len = strlen(X->vval) ; - STRCPY(str, X->vval); + strcpy(str, X->vval); if(X->vval[len - 1] != '=') { /* need to add an '=' at the end of the string so it @@ -3007,8 +3007,8 @@ update_cf_value(void) toclear = v->toclear; tstate = v->tstate; pending = v->pending; - STRCPY(display, v->display); - STRCPY(fnum, v->fnum); + strcpy(display, v->display); + strcpy(fnum, v->fnum); mpstr(v->MPdisp_val, MPdisp_val); mpstr(v->MPlast_input, MPlast_input); mpstr(v->MPresult, MPresult); @@ -3025,7 +3025,7 @@ update_cf_value(void) /* get the computed value */ accuracy = v->accuracy; v->accuracy = 9 ; - STRCPY(result, make_number(v->MPresult, FALSE)) ; + strcpy(result, make_number(v->MPresult, FALSE)) ; v->accuracy = accuracy ; /* return to previous state */ @@ -3036,8 +3036,8 @@ update_cf_value(void) v->toclear = toclear; v->tstate = tstate; v->pending = pending; - STRCPY(v->display, display); - STRCPY(v->fnum, fnum); + strcpy(v->display, display); + strcpy(v->fnum, fnum); mpstr(MPdisp_val, v->MPdisp_val); mpstr(MPlast_input, v->MPlast_input); mpstr(MPresult, v->MPresult); @@ -3048,7 +3048,7 @@ update_cf_value(void) ptr = DtStrchr(result, 'e'); if (n != 1 || ptr != NULL || v->error == TRUE) { - SPRINTF(message, "%s\n%s", vstrs[(int) V_INVCON], + sprintf(message, "%s\n%s", vstrs[(int) V_INVCON], vstrs[(int) V_NOCHANGE]) ; do_continue_notice(X->CFframe, message) ; set_item(OPITEM, "") ; @@ -3066,7 +3066,7 @@ update_cf_value(void) { len = strlen(result); - STRCPY(str, result); + strcpy(str, result); for(i=0; i < len; i++) str[i] = str[i+1]; MPstr_to_num(str, DEC, v->MPcon_vals[X->cfno]) ; @@ -3085,7 +3085,7 @@ update_cf_value(void) len--; } } - SPRINTF(v->con_names[X->cfno], "%1d: %s [%s]", + sprintf(v->con_names[X->cfno], "%1d: %s [%s]", X->cfno, result, X->dval) ; break ; case M_FUN : tmpStr = GETMESSAGE(3, 45, "."); @@ -3100,14 +3100,14 @@ update_cf_value(void) ptr = DtStrchr(X->vval, tmpStr[0]); } } - STRCPY(v->fun_vals[X->cfno], convert(X->vval)) ; + strcpy(v->fun_vals[X->cfno], convert(X->vval)) ; if(strcmp(X->vval, "") != 0) { - SPRINTF(v->fun_names[X->cfno], "%1d: %s [%s]", + sprintf(v->fun_names[X->cfno], "%1d: %s [%s]", X->cfno, X->vval, X->dval) ; } else - STRCPY(v->fun_names[X->cfno], ""); + strcpy(v->fun_names[X->cfno], ""); break; default : break; } @@ -3211,13 +3211,13 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data) X->dval[40] = '\0'; X->vval = XmTextFieldGetString(X->CFpi_vtext->textfield); X->cfval = XmTextFieldGetString(X->CFpi_cftext->textfield); - SSCANF(X->cfval, "%d", &X->cfno) ; + sscanf(X->cfval, "%d", &X->cfno) ; if ((strcmp(X->cfval, "") == 0) || X->cfval[0] < '0' || X->cfval[0] > '9' || X->cfno < 0 || X->cfno > 9) { - SPRINTF(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON] + sprintf(str, "%s", (X->CFtype == M_CON) ? vstrs[(int) V_LCON] : vstrs[(int) V_LFUN]) ; - SPRINTF(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ; + sprintf(message, "%s\n%s", str, vstrs[(int) V_RANGE]) ; do_continue_notice(X->CFframe, message) ; return ; } @@ -3234,10 +3234,10 @@ write_cf_value(Widget widget, XtPointer client_data, XtPointer call_data) } if (X->cfexists) { - SPRINTF(str, mess[(int) MESS_CON], + sprintf(str, mess[(int) MESS_CON], (X->CFtype == M_CON) ? vstrs[(int) V_UCON] : vstrs[(int) V_UFUN], X->cfno) ; - SPRINTF(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ; + sprintf(message, "%s\n%s", str, vstrs[(int) V_OWRITE]) ; XtUnmanageChild(X->CFframe) ; do_confirm_notice(X->CFframe, message) ; } @@ -3310,7 +3310,7 @@ create_menu_bar(Widget parent) XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM); n++; X->menubar = XmCreateMenuBar(parent, "mainMenu", args, n); XtManageChild(X->menubar); - XtAddCallback(X->menubar, XmNhelpCallback, HelpRequestCB, + XtAddCallback(X->menubar, XmNhelpCallback, (void (*)(Widget, XtPointer, XtPointer)) HelpRequestCB, (XtPointer)HELP_MENUBAR); mnemonic = GETMESSAGE(2, 13, "O"); @@ -4402,7 +4402,7 @@ RestoreSession(void) if (get_str_resource(R_DISPLAYED, str)) { - STRCPY(v->display, str); + strcpy(v->display, str); MPstr_to_num(str, v->base, v->MPdisp_val) ; } diff --git a/cde/programs/dtcalc/text.c b/cde/programs/dtcalc/text.c index 9afc6ca83..ce3e70d3b 100644 --- a/cde/programs/dtcalc/text.c +++ b/cde/programs/dtcalc/text.c @@ -43,7 +43,7 @@ extern struct menu_entry menu_entries[] ; /* All the menu strings. */ extern Vars v ; /* Calctool variables and options. */ -void init_mess P(()) ; +void init_mess(void); /* The following are all the strings used by the dtcalc program. * They are initialized in init_text() to the local language equivalents. @@ -395,16 +395,16 @@ init_text(void) /* Setup text strings depending upon language. */ calc_res[(int) R_MENUBAR] = DGET("postMenuBar") ; calc_res[(int) R_KEYS] = DGET("keys") ; - STRCPY(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ; - STRCPY(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ; - STRCPY(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ; - STRCPY(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ; - STRCPY(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ; - STRCPY(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ; - STRCPY(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ; - STRCPY(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ; - STRCPY(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ; - STRCPY(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ; + strcpy(v->con_names[0], LGET(GETMESSAGE(3, 119, "kilometers per hour <=> miles per hour."))) ; + strcpy(v->con_names[1], LGET(GETMESSAGE(3, 120, "square root of 2."))) ; + strcpy(v->con_names[2], LGET(GETMESSAGE(3, 121, "e."))) ; + strcpy(v->con_names[3], LGET(GETMESSAGE(3, 122, "pi."))) ; + strcpy(v->con_names[4], LGET(GETMESSAGE(3, 123, "centimeters <=> inch."))) ; + strcpy(v->con_names[5], LGET(GETMESSAGE(3, 124, "degrees in a radian."))) ; + strcpy(v->con_names[6], LGET(GETMESSAGE(3, 125, "2 ^ 20."))) ; + strcpy(v->con_names[7], LGET(GETMESSAGE(3, 126, "grams <=> ounce."))) ; + strcpy(v->con_names[8], LGET(GETMESSAGE(3, 127, "kilojoules <=> British thermal units."))) ; + strcpy(v->con_names[9], LGET(GETMESSAGE(3, 128, "cubic centimeters <=> cubic inches."))) ; /* Keyboard equivalents for the dtcalc menu entries. */ diff --git a/cde/programs/dtcm/dtcm/alarm.h b/cde/programs/dtcm/dtcm/alarm.h index 11fa1e667..751db3d7b 100644 --- a/cde/programs/dtcm/dtcm/alarm.h +++ b/cde/programs/dtcm/dtcm/alarm.h @@ -53,15 +53,14 @@ #include #include -#include "ansi_c.h" -extern void compose P((Calendar*, CSA_reminder_reference *, char**)); -extern void flash_it P((XtPointer, XtIntervalId*)); -extern void mail_it P((XtPointer, XtIntervalId*, CSA_reminder_reference *)); -extern void open_it P((XtPointer, XtIntervalId*, CSA_reminder_reference *)); -extern void postup_show_proc P((Calendar*, CSA_reminder_reference *)); -extern void reminder_driver P((XtPointer, XtIntervalId*)); -extern void ring_it P((XtPointer, XtIntervalId*)); -extern void slp P((int x)); +extern void compose(Calendar*, CSA_reminder_reference *, char**); +extern void flash_it(XtPointer, XtIntervalId*); +extern void mail_it(XtPointer, XtIntervalId*, CSA_reminder_reference *); +extern void open_it(XtPointer, XtIntervalId*, CSA_reminder_reference *); +extern void postup_show_proc(Calendar*, CSA_reminder_reference *); +extern void reminder_driver(XtPointer, XtIntervalId*); +extern void ring_it(XtPointer, XtIntervalId*); +extern void slp(int x); #endif diff --git a/cde/programs/dtcm/dtcm/blist.h b/cde/programs/dtcm/dtcm/blist.h index 2a16e5486..dedb60287 100644 --- a/cde/programs/dtcm/dtcm/blist.h +++ b/cde/programs/dtcm/dtcm/blist.h @@ -52,7 +52,6 @@ #ifndef _BLIST_H #define _BLIST_H -#include "ansi_c.h" #include "util.h" /* @@ -107,11 +106,11 @@ typedef struct browser_state { struct browser_state *next; } BrowserState; -extern void blist_clean P((Browselist*, Boolean)); -extern void blist_init_names P((Calendar*)); -extern void blist_init_ui P((Calendar*)); -extern void blist_reset P((Calendar*)); -extern void make_browselist P((Calendar*)); -extern void show_browselist P((Calendar*)); +extern void blist_clean(Browselist*, Boolean); +extern void blist_init_names(Calendar*); +extern void blist_init_ui(Calendar*); +extern void blist_reset(Calendar*); +extern void make_browselist(Calendar*); +extern void show_browselist(Calendar*); #endif diff --git a/cde/programs/dtcm/dtcm/browser.h b/cde/programs/dtcm/dtcm/browser.h index 5f8c578e9..41494a156 100644 --- a/cde/programs/dtcm/dtcm/browser.h +++ b/cde/programs/dtcm/dtcm/browser.h @@ -52,7 +52,6 @@ #ifndef _BROWSER_H #define _BROWSER_H -#include "ansi_c.h" #include "timeops.h" #include "calendar.h" @@ -112,23 +111,23 @@ typedef struct { #define MB_PREVMONTH 4 #define MB_NEXTMONTH 5 -extern void br_display P((Calendar*)); -extern Boolean browser_exists P(()); -extern void browser_reset_list P((Calendar*)); -extern Boolean browser_showing P(()); -extern void make_browser P(()); -extern void mb_draw_chartgrid P(()); -extern void mb_draw_appts P(()); -extern void mb_update_segs P(()); -extern void mb_update_busyicon P(()); -extern void mb_init_blist P(()); -extern void mb_init_canvas P(()); -extern void mb_deregister_names P(()); -extern void mb_refresh_canvas P(()); -extern void sched_proc P(()); -extern void set_default_reminders P(()); -extern void set_default_scope_plus P(()); -extern void set_default_what P(()); -extern void mb_refigure_chart P((Calendar *)); +extern void br_display(Calendar *); +extern Boolean browser_exists(void); +extern void browser_reset_list(Calendar*); +extern Boolean browser_showing(void); +extern void make_browser(Calendar *c); +extern void mb_draw_chartgrid(Browser *b, Calendar *c); +extern void mb_draw_appts(Browser *b, int start, int end, Calendar *c); +extern void mb_update_segs(Browser *, Tick, Tick, int *, int *); +extern void mb_update_busyicon(void); +extern void mb_init_blist(void); +extern void mb_init_canvas(Calendar *c); +extern void mb_deregister_names(char *, Calendar *); +extern void mb_refresh_canvas(Browser *b, Calendar *c); +extern void sched_proc(void); +extern void set_default_reminders(void); +extern void set_default_scope_plus(void); +extern void set_default_what(void); +extern void mb_refigure_chart(Calendar *); #endif diff --git a/cde/programs/dtcm/dtcm/calendar.h b/cde/programs/dtcm/dtcm/calendar.h index 10b68bfff..046c03731 100644 --- a/cde/programs/dtcm/dtcm/calendar.h +++ b/cde/programs/dtcm/dtcm/calendar.h @@ -56,7 +56,6 @@ #include #include #include -#include "ansi_c.h" #include "util.h" #include "timeops.h" #include "props.h" @@ -324,68 +323,68 @@ extern int _csa_tick_to_iso8601(time_t, char *); (int)(r2)->y<=(int)(r1)->y+(int)(r1)->height) -extern void cache_dims P((Calendar*, Dimension, - Dimension)); -extern char* cm_get_relname P(()); -extern Boolean in_range P((time_t, time_t, time_t)); -extern int report_err P((char*)); -extern void reset_alarm P((Calendar*)); -extern CSA_return_code reset_timer P((Calendar*)); -extern CSA_return_code paint_canvas P((Calendar*, XRectangle*, - Render_Type)); -extern void switch_it P((Calendar*, char*, - WindowType)); -extern int yyyerror P((char*)); -extern void gr_clear_area P((new_XContext*, int, int, - Dimension, Dimension)); -extern void gr_clear_box P((new_XContext*, int, int, int, - int)); -extern void gr_make_grayshade P((new_XContext*, int, int, int, - int, int)); -extern void gr_make_gray P((new_XContext*, int, int, int, - int, int)); -extern void gr_make_rgbcolor P((new_XContext*, Colormap, int, +extern void cache_dims(Calendar*, Dimension, + Dimension); +extern char* cm_get_relname(void); +extern Boolean in_range(time_t, time_t, time_t); +extern int report_err(char*); +extern void reset_alarm(Calendar*); +extern CSA_return_code reset_timer(Calendar*); +extern CSA_return_code paint_canvas(Calendar*, XRectangle*, + Render_Type); +extern void switch_it(Calendar*, char*, + WindowType); +extern int yyyerror(char*); +extern void gr_clear_area(new_XContext*, int, int, + Dimension, Dimension); +extern void gr_clear_box(new_XContext*, int, int, int, + int); +extern void gr_make_grayshade(new_XContext*, int, int, int, + int, int); +extern void gr_make_gray(new_XContext*, int, int, int, + int, int); +extern void gr_make_rgbcolor(new_XContext*, Colormap, int, int, int, int, int, int, - int)); -extern int gr_nchars P((int, char*, Cal_Font *)); -extern void gr_draw_rgb_box P((new_XContext*, int, int, int, - int, int, int, Colormap)); -extern void gr_dissolve_box P((new_XContext*, int, int, int, - int, int)); -extern int gr_center P((int, char*, Cal_Font *)); -extern void gr_text P((new_XContext*, int, int, + int); +extern int gr_nchars(int, char*, Cal_Font *); +extern void gr_draw_rgb_box (new_XContext*, int, int, int, + int, int, int, Colormap); +extern void gr_dissolve_box (new_XContext*, int, int, int, + int, int); +extern int gr_center(int, char*, Cal_Font *); +extern void gr_text(new_XContext*, int, int, Cal_Font *, char*, - XRectangle*)); -extern void gr_text_rgb P((new_XContext*, int, int, + XRectangle*); +extern void gr_text_rgb(new_XContext*, int, int, Cal_Font *, char*, Pixel, - Colormap, XRectangle*)); -extern void gr_draw_line P((new_XContext*, int, int, int, + Colormap, XRectangle*); +extern void gr_draw_line(new_XContext*, int, int, int, int, GR_Line_Style, - XRectangle*)); -extern void gr_draw_box P((new_XContext*, int, int, int, - int, XRectangle*)); -extern void gr_draw_glyph P((new_XContext*, new_XContext*, - Pixmap, int, int, int, int)); -extern void gr_set_clip_rectangles P((new_XContext*, int, int, - XRectangle*, int, int)); -extern void gr_clear_clip_rectangles P((new_XContext*)); -extern Boolean gr_init P((new_XContext*, Widget)); -extern new_XContext *gr_create_xcontext P((Calendar*, Widget, GR_depth, - XtAppContext)); -extern Boolean today_inrange P((Calendar*, time_t)); -extern void update_browse_menu_names P((Calendar*)); -extern char* get_user_calendar P(()); -extern void destroy_paint_cache P((Paint_cache *, int)); -extern void invalidate_cache P((Calendar *)); + XRectangle*); +extern void gr_draw_box(new_XContext*, int, int, int, + int, XRectangle*); +extern void gr_draw_glyph(new_XContext*, new_XContext*, + Pixmap, int, int, int, int); +extern void gr_set_clip_rectangles(new_XContext*, int, int, + XRectangle*, int, int); +extern void gr_clear_clip_rectangles(new_XContext*); +extern Boolean gr_init(new_XContext*, Widget); +extern new_XContext *gr_create_xcontext(Calendar*, Widget, GR_depth, + XtAppContext); +extern Boolean today_inrange(Calendar*, time_t); +extern void update_browse_menu_names(Calendar*); +extern char* get_user_calendar(void); +extern void destroy_paint_cache(Paint_cache *, int); +extern void invalidate_cache(Calendar *); -extern CSA_return_code allocate_paint_cache P((CSA_entry_handle *, int, Paint_cache **)); +extern CSA_return_code allocate_paint_cache(CSA_entry_handle *, int, Paint_cache **); -extern Boolean fontlist_to_font P((XmFontList, Cal_Font *)); -extern void CalTextExtents P((Cal_Font *, char *, int, - int *, int *, int *, int *)); -extern void CalDrawString P((Display *, Drawable, +extern Boolean fontlist_to_font(XmFontList, Cal_Font *); +extern void CalTextExtents (Cal_Font *, char *, int, + int *, int *, int *, int *); +extern void CalDrawString (Display *, Drawable, Cal_Font *, GC, int, int, - char *, int)); -extern void CalFontExtents P((Cal_Font *, - XFontSetExtents *)); + char *, int); +extern void CalFontExtents (Cal_Font *, + XFontSetExtents *); #endif diff --git a/cde/programs/dtcm/dtcm/cm_i18n.h b/cde/programs/dtcm/dtcm/cm_i18n.h index d685d4880..dc5f03e28 100644 --- a/cde/programs/dtcm/dtcm/cm_i18n.h +++ b/cde/programs/dtcm/dtcm/cm_i18n.h @@ -92,10 +92,10 @@ extern char *cm_printf(); int is_comment(); int match_locale(); -extern int cm_get_fonts P((char *)); -extern int is_comment P((char[MAX_LINE_LEN])); -extern int match_locale P((char *, char[MAX_LINE_LEN])); -extern void ps_i18n_header P((FILE *, Widget)); -extern char* euc_to_octal P((char *)); -extern char* cm_get_i18n_date P((Widget, char *)); -extern char* cm_printf P((double, int)); +extern int cm_get_fonts(char *); +extern int is_comment(char[MAX_LINE_LEN]); +extern int match_locale(char *, char[MAX_LINE_LEN]); +extern void ps_i18n_header(FILE *, Widget); +extern char* euc_to_octal(char *); +extern char* cm_get_i18n_date(Widget, char *); +extern char* cm_printf(double, int); diff --git a/cde/programs/dtcm/dtcm/common.h b/cde/programs/dtcm/dtcm/common.h index 292fe80ae..fbc2ddc0e 100644 --- a/cde/programs/dtcm/dtcm/common.h +++ b/cde/programs/dtcm/dtcm/common.h @@ -52,22 +52,20 @@ #ifndef _COMMON_H #define _COMMON_H -#include "ansi_c.h" - #if LATER typedef struct { int data_version; char* target; } Cdata; -extern Cdata *get_cdata P(()); -extern void free_cd_from_blist P(()); +extern Cdata *get_cdata(); +extern void free_cd_from_blist(); #endif -extern void reset_values P(()); -extern void backup_values P(()); -extern void blist_write_names P(()); -extern Boolean duplicate_cd P(()); -extern char *get_appt_str P(()); -extern void common_update_lists P(()); +extern void reset_values(void); +extern void backup_values(void); +extern void blist_write_names(void); +extern Boolean duplicate_cd(void); +extern char *get_appt_str(void); +extern void common_update_lists(void); #endif diff --git a/cde/programs/dtcm/dtcm/datefield.h b/cde/programs/dtcm/dtcm/datefield.h index 13bff71ae..23a92810a 100644 --- a/cde/programs/dtcm/dtcm/datefield.h +++ b/cde/programs/dtcm/dtcm/datefield.h @@ -53,16 +53,15 @@ #define _DATEFIELD_H #include -#include "ansi_c.h" #include "props.h" #include "timeops.h" /* ** External function declaration */ -extern char *get_date_from_widget P((Tick, Widget, OrderingType, - SeparatorType)); -extern void set_date_in_widget P((Tick, Widget, OrderingType, - SeparatorType)); +extern char *get_date_from_widget(Tick, Widget, OrderingType, + SeparatorType); +extern void set_date_in_widget(Tick, Widget, OrderingType, + SeparatorType); #endif diff --git a/cde/programs/dtcm/dtcm/dayglance.h b/cde/programs/dtcm/dtcm/dayglance.h index b4617250f..728494c07 100644 --- a/cde/programs/dtcm/dtcm/dayglance.h +++ b/cde/programs/dtcm/dtcm/dayglance.h @@ -53,7 +53,6 @@ #define _DAYGLANCE_H #include -#include "ansi_c.h" #include "props.h" #define MOBOX_AREA_WIDTH (int)(c->view->winw*.4) @@ -82,17 +81,17 @@ typedef struct dayglance { Widget *month_panels; } Day; -extern void init_dayview P((Calendar*)); -extern void day_button P((Widget, XtPointer, XtPointer)); -extern void init_mo P((Calendar*)); -extern void monthbox_datetoxy P((Calendar*)); -extern void monthbox_xytodate P((Calendar*, int x, int y)); -extern void paint_dayview P((Calendar*, Boolean, - XRectangle*, Boolean)); -extern void paint_day P((Calendar*)); -extern void print_day_range P((Calendar*, Tick, Tick)); -extern void day_event P((XEvent*)); -extern int morning P((int)); -extern void paint_day_header P((Calendar *, Tick, void *)); -extern void cleanup_after_dayview P((Calendar *)); +extern void init_dayview(Calendar*); +extern void day_button(Widget, XtPointer, XtPointer); +extern void init_mo(Calendar*); +extern void monthbox_datetoxy(Calendar*); +extern void monthbox_xytodate(Calendar*, int x, int y); +extern void paint_dayview(Calendar*, Boolean, + XRectangle*, Boolean); +extern void paint_day(Calendar*); +extern void print_day_range (Calendar*, Tick, Tick); +extern void day_event(XEvent*); +extern int morning(int); +extern void paint_day_header(Calendar *, Tick, void *); +extern void cleanup_after_dayview(Calendar *); #endif diff --git a/cde/programs/dtcm/dtcm/deskset.h b/cde/programs/dtcm/dtcm/deskset.h index d9c528a9c..0e7af2461 100644 --- a/cde/programs/dtcm/dtcm/deskset.h +++ b/cde/programs/dtcm/dtcm/deskset.h @@ -54,7 +54,6 @@ #include #include -#include "ansi_c.h" /* ** Location ops for ds_position_popup(). @@ -72,10 +71,10 @@ typedef enum { /* ** Function declarations. */ -extern int ds_force_popup_on_screen P((Widget, int*, int*)) ; -extern void ds_get_screen_size P((Widget, int*, int*)) ; -extern int ds_position_popup P((Widget, Widget, - ds_location_op)) ; -extern char *ds_relname P(()); +extern int ds_force_popup_on_screen(Widget, int*, int*); +extern void ds_get_screen_size(Widget, int*, int*); +extern int ds_position_popup(Widget, Widget, + ds_location_op); +extern char *ds_relname(); #endif diff --git a/cde/programs/dtcm/dtcm/dnd.h b/cde/programs/dtcm/dtcm/dnd.h index a19b8766e..ed5144dc2 100644 --- a/cde/programs/dtcm/dtcm/dnd.h +++ b/cde/programs/dtcm/dtcm/dnd.h @@ -52,8 +52,6 @@ #ifndef _DND_H #define _DND_H -#include "ansi_c.h" - typedef enum {SingleEditorList, SingleEditorIcon, GroupEditorList, @@ -72,12 +70,12 @@ typedef struct { #define DRAG_THRESHOLD 4 -extern void cm_register_drop_site P((Calendar *c, Widget w)); -extern void ApptDragStart P((Widget, XEvent *, Calendar *, - EditorType)); -extern void TranslationDragStart P((Widget, XEvent *, String *, - Cardinal *)); -extern void DtcmProcessPress P((Widget, XEvent *, String *, - Cardinal *)); +extern void cm_register_drop_site(Calendar *c, Widget w); +extern void ApptDragStart(Widget, XEvent *, Calendar *, + EditorType); +extern void TranslationDragStart(Widget, XEvent *, String *, + Cardinal *); +extern void DtcmProcessPress(Widget, XEvent *, String *, + Cardinal *); #endif diff --git a/cde/programs/dtcm/dtcm/dssw.h b/cde/programs/dtcm/dtcm/dssw.h index d0b4fcc9a..cbfe7b602 100644 --- a/cde/programs/dtcm/dtcm/dssw.h +++ b/cde/programs/dtcm/dtcm/dssw.h @@ -53,7 +53,6 @@ #define _DSSW_H #include -#include "ansi_c.h" #include "calendar.h" #define DATE_LEN 100 @@ -121,21 +120,21 @@ typedef struct { ** DSSW external function declarations ** *******************************************************************************/ -extern void build_dssw P((DSSW*, Calendar*, Widget, Boolean, Boolean)); -extern Boolean dssw_appt_to_form P((DSSW*, CSA_entry_handle)); -extern Boolean dssw_attrs_to_form P((DSSW*, Dtcm_appointment*)); -extern Boolean dssw_form_to_appt P((DSSW*, Dtcm_appointment*, char*, - Tick)); -extern Boolean dssw_form_flags_to_appt P((DSSW*, Dtcm_appointment*, char*, - Tick, int *)); -extern Boolean dssw_form_to_todo P((DSSW*, Dtcm_appointment*, char*, - Tick)); -extern void load_dssw_times P((DSSW*, Tick, Tick, Boolean)); -extern void get_dssw_times P((DSSW*)); -extern void get_dssw_vals P((DSSW*, Tick)); -extern void set_dssw_defaults P((DSSW*, Tick, Boolean)); -extern void set_dssw_times P((DSSW*)); -extern void set_dssw_vals P((DSSW*, Tick)); -extern void set_dssw_menus P((DSSW*, Props *)); +extern void build_dssw(DSSW*, Calendar*, Widget, Boolean, Boolean); +extern Boolean dssw_appt_to_form(DSSW*, CSA_entry_handle); +extern Boolean dssw_attrs_to_form(DSSW*, Dtcm_appointment*); +extern Boolean dssw_form_to_appt(DSSW*, Dtcm_appointment*, char*, + Tick); +extern Boolean dssw_form_flags_to_appt(DSSW*, Dtcm_appointment*, char*, + Tick, int *); +extern Boolean dssw_form_to_todo(DSSW*, Dtcm_appointment*, char*, + Tick); +extern void load_dssw_times(DSSW*, Tick, Tick, Boolean); +extern void get_dssw_times(DSSW*); +extern void get_dssw_vals(DSSW*, Tick); +extern void set_dssw_defaults(DSSW*, Tick, Boolean); +extern void set_dssw_times(DSSW*); +extern void set_dssw_vals(DSSW*, Tick); +extern void set_dssw_menus(DSSW*, Props *); #endif diff --git a/cde/programs/dtcm/dtcm/editor.h b/cde/programs/dtcm/dtcm/editor.h index aa5c99490..4a71f5b5a 100644 --- a/cde/programs/dtcm/dtcm/editor.h +++ b/cde/programs/dtcm/dtcm/editor.h @@ -53,7 +53,6 @@ #define _EDITOR_H #include -#include "ansi_c.h" #include "calendar.h" #include "misc.h" #include "dssw.h" @@ -115,27 +114,27 @@ typedef struct { ** Editor external function declarations ** *******************************************************************************/ -extern void add_to_appt_list P((CSA_entry_handle, Editor*)); -extern void add_all_appt P((Editor*)); -extern void build_editor_list P((Editor*, Tick, Glance, CSA_entry_handle**, - CSA_uint32*)); -extern int build_editor_view P((Editor*, Glance, Boolean)); -extern Boolean editor_change P((Dtcm_appointment*, CSA_entry_handle, - CSA_entry_handle*, Calendar*)); -extern void editor_clean_up P((Editor*)); -extern Boolean editor_created P((Editor*)); -extern Boolean editor_delete P((CSA_entry_handle, Calendar*)); -extern Boolean editor_insert P((Dtcm_appointment*, CSA_entry_handle*, - Calendar*)); -extern CSA_entry_handle editor_nth_appt P((Editor*, int)); -extern Boolean editor_showing P((Editor*)); -extern Boolean editor_view_showing P((Editor*)); -extern void get_editor_vals P((Editor*)); -extern void set_editor_defaults P((Editor*, Tick, Tick, Boolean)); -extern void set_editor_title P((Editor*, char *)); -extern void set_editor_vals P((Editor*, Tick, Tick)); -extern void show_editor P((Calendar*, Tick, Tick, Boolean)); -extern void show_editor_view P((Calendar*, Glance)); -extern void e_make_editor P((Calendar*)); +extern void add_to_appt_list(CSA_entry_handle, Editor*); +extern void add_all_appt(Editor*); +extern void build_editor_list(Editor*, Tick, Glance, CSA_entry_handle**, + CSA_uint32*); +extern int build_editor_view(Editor*, Glance, Boolean); +extern Boolean editor_change(Dtcm_appointment*, CSA_entry_handle, + CSA_entry_handle*, Calendar*); +extern void editor_clean_up (Editor*); +extern Boolean editor_created(Editor*); +extern Boolean editor_delete(CSA_entry_handle, Calendar*); +extern Boolean editor_insert(Dtcm_appointment*, CSA_entry_handle*, + Calendar*); +extern CSA_entry_handle editor_nth_appt(Editor*, int); +extern Boolean editor_showing(Editor*); +extern Boolean editor_view_showing(Editor*); +extern void get_editor_vals (Editor*); +extern void set_editor_defaults(Editor*, Tick, Tick, Boolean); +extern void set_editor_title(Editor*, char *); +extern void set_editor_vals (Editor*, Tick, Tick); +extern void show_editor (Calendar*, Tick, Tick, Boolean); +extern void show_editor_view(Calendar*, Glance); +extern void e_make_editor(Calendar*); #endif diff --git a/cde/programs/dtcm/dtcm/find.h b/cde/programs/dtcm/dtcm/find.h index f212369fc..0d5b10b76 100644 --- a/cde/programs/dtcm/dtcm/find.h +++ b/cde/programs/dtcm/dtcm/find.h @@ -52,8 +52,6 @@ #ifndef _FIND_H #define _FIND_H -#include "ansi_c.h" - typedef struct tick_list { Tick tick; struct tick_list *next; @@ -88,7 +86,7 @@ typedef struct { Tick search_to_date; }Find; -extern caddr_t make_find P((Calendar*)); -static Tick f_get_searchdate P((Widget, Props*)); +extern caddr_t make_find(Calendar*); +static Tick f_get_searchdate(Widget, Props*); #endif diff --git a/cde/programs/dtcm/dtcm/format.h b/cde/programs/dtcm/dtcm/format.h index 7b79cbf1b..06e134c6a 100644 --- a/cde/programs/dtcm/dtcm/format.h +++ b/cde/programs/dtcm/dtcm/format.h @@ -53,24 +53,23 @@ #define _FORMAT_H #include -#include "ansi_c.h" #include "props.h" #define DEFAULT_APPT_LEN 50 #define DEFAULT_GAPPT_LEN 80 -extern void format_date P((Tick, OrderingType, char*, int, int, int)); -extern void format_date3 P((Tick, OrderingType, SeparatorType, char*)); -extern Boolean format_line P((Tick, char*, char*, int, Boolean, - DisplayType)); -extern void format_line2 P((Dtcm_appointment*, char*, char*, - DisplayType)); -extern void format_appt P((Dtcm_appointment*, char*, DisplayType, int)); -extern void format_abbrev_appt P((Dtcm_appointment*, char*, Boolean, - DisplayType)); -extern void format_maxchars P((Dtcm_appointment*, char*, int, DisplayType)); -extern void format_gappt P((Dtcm_appointment*, char*, char*, - DisplayType, int)); +extern void format_date(Tick, OrderingType, char*, int, int, int); +extern void format_date3(Tick, OrderingType, SeparatorType, char*); +extern Boolean format_line(Tick, char*, char*, int, Boolean, + DisplayType); +extern void format_line2(Dtcm_appointment*, char*, char*, + DisplayType); +extern void format_appt (Dtcm_appointment*, char*, DisplayType, int); +extern void format_abbrev_appt(Dtcm_appointment*, char*, Boolean, + DisplayType); +extern void format_maxchars(Dtcm_appointment*, char*, int, DisplayType); +extern void format_gappt(Dtcm_appointment*, char*, char*, + DisplayType, int); #endif diff --git a/cde/programs/dtcm/dtcm/goto.h b/cde/programs/dtcm/dtcm/goto.h index 38db3d0b6..6ace726be 100644 --- a/cde/programs/dtcm/dtcm/goto.h +++ b/cde/programs/dtcm/dtcm/goto.h @@ -52,8 +52,6 @@ #ifndef _GOTO_H #define _GOTO_H -#include "ansi_c.h" - typedef struct { Widget frame; Widget form; @@ -65,7 +63,7 @@ typedef struct { Widget goto_message; }Goto; -extern caddr_t make_goto P((Calendar*)); +extern caddr_t make_goto(Calendar*); #define DATESIZ 40 diff --git a/cde/programs/dtcm/dtcm/group_editor.h b/cde/programs/dtcm/dtcm/group_editor.h index fd9c2b408..ae1e757a9 100644 --- a/cde/programs/dtcm/dtcm/group_editor.h +++ b/cde/programs/dtcm/dtcm/group_editor.h @@ -53,7 +53,6 @@ #define _GEDITOR_H #include -#include "ansi_c.h" #include "util.h" #include "calendar.h" #include "misc.h" @@ -127,21 +126,21 @@ typedef struct { ** Group Editor external function declarations ** *******************************************************************************/ -extern void add_to_gaccess_list P((char*, CSA_session_handle, +extern void add_to_gaccess_list(char*, CSA_session_handle, unsigned int, int, GEditor*, - Boolean)); -extern void add_all_gappt P((GEditor*)); -extern void geditor_clean_up P((GEditor*)); -extern CSA_entry_handle geditor_nth_appt P((GEditor*, int, - Access_data**)); -extern Boolean geditor_showing P((GEditor*)); -extern void get_geditor_vals P((GEditor*)); -extern void remove_all_gaccess_data P((GEditor*)); -extern void remove_all_gaccess P((GEditor*)); -extern void remove_from_gaccess_list P((char*, GEditor*)); -extern void set_geditor_defaults P((GEditor*, Tick, Tick)); -extern void set_geditor_title P((GEditor*, char*)); -extern void set_geditor_vals P((GEditor*, Tick, Tick)); -extern void show_geditor P((Calendar*, Tick, Tick)); + Boolean); +extern void add_all_gappt(GEditor*); +extern void geditor_clean_up(GEditor*); +extern CSA_entry_handle geditor_nth_appt(GEditor*, int, + Access_data**); +extern Boolean geditor_showing(GEditor*); +extern void get_geditor_vals(GEditor*); +extern void remove_all_gaccess_data(GEditor*); +extern void remove_all_gaccess(GEditor*); +extern void remove_from_gaccess_list(char*, GEditor*); +extern void set_geditor_defaults(GEditor*, Tick, Tick); +extern void set_geditor_title(GEditor*, char*); +extern void set_geditor_vals(GEditor*, Tick, Tick); +extern void show_geditor(Calendar*, Tick, Tick); #endif diff --git a/cde/programs/dtcm/dtcm/help.h b/cde/programs/dtcm/dtcm/help.h index 54e003052..db2bee79c 100644 --- a/cde/programs/dtcm/dtcm/help.h +++ b/cde/programs/dtcm/dtcm/help.h @@ -114,9 +114,9 @@ #define DURATION_ERROR_HELP "CalendarDurationError" #define ADVANCE_ERROR_HELP "CalendarAdvanceError" -extern void show_main_help P((Widget, XtPointer, XtPointer)); -extern void help_cb P((Widget, XtPointer, XtPointer)); -extern void help_view_cb P((Widget, XtPointer, XtPointer)); +extern void show_main_help(Widget, XtPointer, XtPointer); +extern void help_cb(Widget, XtPointer, XtPointer); +extern void help_view_cb(Widget, XtPointer, XtPointer); #endif diff --git a/cde/programs/dtcm/dtcm/misc.h b/cde/programs/dtcm/dtcm/misc.h index adbdf11e7..03da5578d 100644 --- a/cde/programs/dtcm/dtcm/misc.h +++ b/cde/programs/dtcm/dtcm/misc.h @@ -55,7 +55,6 @@ #include #include #include -#include "ansi_c.h" #include "calendar.h" #include "cm_tty.h" #include "datefield.h" @@ -81,31 +80,31 @@ typedef enum { /* ** External function declarations */ -extern char *cm_mbchar P((char*)); -extern int cm_mbstrlen P((char*)); -extern Widget create_for_menu P((Widget)); -extern Widget create_privacy_menu P((Widget)); -extern Widget create_repeat_menu P((Widget, XtCallbackProc, XtPointer)); -extern Widget create_repeat_scope_menu P((Widget, XmString, XtCallbackProc, - XtPointer)); -extern Widget create_start_stop_time_menu P((Widget, XmString, XtCallbackProc, +extern char *cm_mbchar(char*); +extern int cm_mbstrlen(char*); +extern Widget create_for_menu (Widget); +extern Widget create_privacy_menu(Widget); +extern Widget create_repeat_menu(Widget, XtCallbackProc, XtPointer); +extern Widget create_repeat_scope_menu(Widget, XmString, XtCallbackProc, + XtPointer); +extern Widget create_start_stop_time_menu(Widget, XmString, XtCallbackProc, XtPointer, Props*, Boolean, - Boolean, Widget**, int*)); -extern Widget create_time_scope_menu P((Widget, XmString, XtCallbackProc, - XtPointer)); + Boolean, Widget**, int*); +extern Widget create_time_scope_menu(Widget, XmString, XtCallbackProc, + XtPointer); #ifndef _AIX -extern int dialog_popup P((Widget, ...)); +extern int dialog_popup(Widget, ...); #endif /* _AIX */ -extern void editor_err_msg P((Widget, char*, Validate_op, Pixmap)); -extern void backend_err_msg P((Widget, char*, CSA_return_code, Pixmap)); -extern void get_range P((Glance, time_t, time_t*, time_t*)); -extern boolean_t query_user P((void*)); -extern void set_message P((Widget, char*)); -extern void setup_quit_handler P((Widget, XtCallbackProc, caddr_t)); -extern int ds_is_double_click P((XEvent*, XEvent*)); -extern int cm_select_text P((Widget, Time)); -extern void set_time_submenu P((Widget, Widget, Props*, +extern void editor_err_msg(Widget, char*, Validate_op, Pixmap); +extern void backend_err_msg(Widget, char*, CSA_return_code, Pixmap); +extern void get_range(Glance, time_t, time_t*, time_t*); +extern boolean_t query_user(void*); +extern void set_message (Widget, char*); +extern void setup_quit_handler(Widget, XtCallbackProc, caddr_t); +extern int ds_is_double_click(XEvent*, XEvent*); +extern int cm_select_text(Widget, Time); +extern void set_time_submenu(Widget, Widget, Props*, XtCallbackProc, XtPointer, - Boolean, Boolean, Widget**, int*)); -extern void ManageChildren P((Widget)); + Boolean, Boolean, Widget**, int*); +extern void ManageChildren(Widget); #endif diff --git a/cde/programs/dtcm/dtcm/monthglance.c b/cde/programs/dtcm/dtcm/monthglance.c index 72facdf4e..0a5743bee 100644 --- a/cde/programs/dtcm/dtcm/monthglance.c +++ b/cde/programs/dtcm/dtcm/monthglance.c @@ -286,7 +286,7 @@ paint_month(Calendar *c, Tick key, XRectangle *rect) tm = *_XLocaltime(&key, localtime_buf); tm.tm_mday = 1; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; day = mktime(&tm); #else @@ -466,7 +466,7 @@ layout_month( tm = *_XLocaltime(&date, localtime_buf); tm.tm_mday = 1; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; day = mktime(&tm); #else @@ -703,7 +703,7 @@ count_month_pages(Calendar *c, Tick start_date, int lines_per_box) tm = *_XLocaltime(&start_date, localtime_buf); tm.tm_mday = 1; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; day = (int)mktime(&tm); #else diff --git a/cde/programs/dtcm/dtcm/monthglance.h b/cde/programs/dtcm/dtcm/monthglance.h index 496b556f9..838f45c42 100644 --- a/cde/programs/dtcm/dtcm/monthglance.h +++ b/cde/programs/dtcm/dtcm/monthglance.h @@ -53,7 +53,6 @@ #define _MONTHGLANCE_H #include -#include "ansi_c.h" typedef struct month { Widget *hot_button; @@ -63,13 +62,13 @@ typedef struct month { int dayname_height; } Month; -extern void prepare_to_paint_monthview P((Calendar*, XRectangle*)); -extern void get_time_str P((Dtcm_appointment*, char*)); -extern void month_button P((Widget, XtPointer, XtPointer)); -extern void month_event P((XEvent*)); -extern void paint_grid P((Calendar*, XRectangle*)); -extern void print_month_range P((Calendar*, Tick, Tick)); -extern void cleanup_after_monthview P((Calendar*)); +extern void prepare_to_paint_monthview(Calendar*, XRectangle*); +extern void get_time_str(Dtcm_appointment*, char*); +extern void month_button(Widget, XtPointer, XtPointer); +extern void month_event(XEvent*); +extern void paint_grid(Calendar*, XRectangle*); +extern void print_month_range(Calendar*, Tick, Tick); +extern void cleanup_after_monthview(Calendar*); #endif diff --git a/cde/programs/dtcm/dtcm/props_pu.h b/cde/programs/dtcm/dtcm/props_pu.h index 616229281..ba97dd5b2 100644 --- a/cde/programs/dtcm/dtcm/props_pu.h +++ b/cde/programs/dtcm/dtcm/props_pu.h @@ -31,7 +31,6 @@ #ifndef _PROPS_PU_H #define _PROPS_PU_H -#include "ansi_c.h" #include "dssw.h" #include "props.h" #include "reminders.h" @@ -244,25 +243,25 @@ enum ** External function declarations ** *******************************************************************************/ -extern void create_all_pixmaps P((Props_pu*, Widget)); -extern Boolean get_date_vals_from_ui P((Props_pu*, Props*)); -extern Boolean get_display_vals_from_ui P((Props_pu*, Props*)); -extern Boolean get_editor_vals_from_ui P((Props_pu*, Props*)); -extern Boolean get_gap_vals_from_ui P((Props_pu*, Props*)); -extern Boolean get_printer_vals_from_ui P((Props_pu*, Props*)); -extern Boolean get_props_from_ui P((Props_pu*, Props*, int*)); -extern void set_date_vals_on_ui P((Props_pu*, Props*)); -extern void set_display_vals_on_ui P((Props_pu*, Props*)); -extern void set_editor_vals_on_ui P((Props_pu*, Props*)); -extern void set_gap_vals_on_ui P((Props_pu*, Props*)); -extern void set_printer_vals_on_ui P((Props_pu*, Props*)); -extern void set_props_on_ui P((Props_pu*, Props*)); -extern void set_props_pu_defaults P((Props_pu*, Props*)); -extern void show_props_pu P((Calendar*)); -extern void props_pu_clean_up P((Props_pu*)); -extern Boolean props_pu_showing P((Props_pu*)); -extern Boolean p_flush_changes P((Calendar*)); -extern void show_print_props_pu P((Calendar*)); +extern void create_all_pixmaps(Props_pu*, Widget); +extern Boolean get_date_vals_from_ui(Props_pu*, Props*); +extern Boolean get_display_vals_from_ui(Props_pu*, Props*); +extern Boolean get_editor_vals_from_ui(Props_pu*, Props*); +extern Boolean get_gap_vals_from_ui(Props_pu*, Props*); +extern Boolean get_printer_vals_from_ui(Props_pu*, Props*); +extern Boolean get_props_from_ui(Props_pu*, Props*, int*); +extern void set_date_vals_on_ui(Props_pu*, Props*); +extern void set_display_vals_on_ui(Props_pu*, Props*); +extern void set_editor_vals_on_ui(Props_pu*, Props*); +extern void set_gap_vals_on_ui(Props_pu*, Props*); +extern void set_printer_vals_on_ui(Props_pu*, Props*); +extern void set_props_on_ui (Props_pu*, Props*); +extern void set_props_pu_defaults(Props_pu*, Props*); +extern void show_props_pu(Calendar*); +extern void props_pu_clean_up(Props_pu*); +extern Boolean props_pu_showing(Props_pu*); +extern Boolean p_flush_changes (Calendar*); +extern void show_print_props_pu(Calendar*); extern void p_defaults_proc_helper(XtPointer client_data); diff --git a/cde/programs/dtcm/dtcm/reminders.h b/cde/programs/dtcm/dtcm/reminders.h index 9b742ea72..0adcd7dd6 100644 --- a/cde/programs/dtcm/dtcm/reminders.h +++ b/cde/programs/dtcm/dtcm/reminders.h @@ -54,7 +54,6 @@ #include #include -#include "ansi_c.h" #include "misc.h" #define REMINDER_SCOPE_LEN 5 @@ -114,14 +113,14 @@ typedef struct { ** Editor external function declarations ** *******************************************************************************/ -extern void build_reminders P((Reminders*, Calendar*, Widget)); -extern Reminder_val_op get_reminders_vals P((Reminders*, Boolean)); -extern Boolean reminders_attrs_to_form P((Reminders*, Dtcm_appointment*)); -extern Boolean reminders_appt_to_form P((Reminders*, CSA_entry_handle)); -extern Boolean reminders_form_to_appt P((Reminders*, Dtcm_appointment*, char *)); -extern void set_reminders_defaults P((Reminders*)); -extern void set_reminders_vals P((Reminders*, Boolean)); -extern void reminders_init P((Reminders*, Calendar*, Widget)); +extern void build_reminders(Reminders*, Calendar*, Widget); +extern Reminder_val_op get_reminders_vals(Reminders*, Boolean); +extern Boolean reminders_attrs_to_form(Reminders*, Dtcm_appointment*); +extern Boolean reminders_appt_to_form(Reminders*, CSA_entry_handle); +extern Boolean reminders_form_to_appt(Reminders*, Dtcm_appointment*, char *); +extern void set_reminders_defaults(Reminders*); +extern void set_reminders_vals(Reminders*, Boolean); +extern void reminders_init(Reminders*, Calendar*, Widget); #endif diff --git a/cde/programs/dtcm/dtcm/rfp.h b/cde/programs/dtcm/dtcm/rfp.h index a0a3facda..d4fa85dcb 100644 --- a/cde/programs/dtcm/dtcm/rfp.h +++ b/cde/programs/dtcm/dtcm/rfp.h @@ -53,7 +53,6 @@ #define _RFP_H #include -#include "ansi_c.h" #include "calendar.h" #include "misc.h" @@ -98,20 +97,20 @@ typedef struct { ** RFP (repeat, for, privacy) external function declarations ** *******************************************************************************/ -extern void build_rfp P((RFP*, Calendar*, Widget)); -extern void get_rfp_privacy_val P((RFP*)); -extern void get_rfp_repeat_val P((RFP*, time_t)); -extern void get_rfp_vals P((RFP*, time_t)); -extern Boolean rfp_attrs_to_form P((RFP*, Dtcm_appointment*)); -extern Boolean rfp_appt_to_form P((RFP*, CSA_entry_handle)); -extern Boolean rfp_form_to_appt P((RFP*, Dtcm_appointment*, char*)); -extern Boolean rfp_form_flags_to_appt P((RFP*, Dtcm_appointment*, char*, int *)); -extern void set_rfp_privacy_val P((RFP*)); -extern void set_rfp_repeat_val P((RFP*)); -extern void set_rfp_defaults P((RFP*)); -extern void set_rfp_vals P((RFP*)); -extern void rfp_set_repeat_values P((RFP*)); -extern void rfp_init P((RFP*, Calendar *, Widget)); +extern void build_rfp(RFP*, Calendar*, Widget); +extern void get_rfp_privacy_val(RFP*); +extern void get_rfp_repeat_val(RFP*, time_t); +extern void get_rfp_vals(RFP*, time_t); +extern Boolean rfp_attrs_to_form(RFP*, Dtcm_appointment*); +extern Boolean rfp_appt_to_form(RFP*, CSA_entry_handle); +extern Boolean rfp_form_to_appt(RFP*, Dtcm_appointment*, char*); +extern Boolean rfp_form_flags_to_appt(RFP*, Dtcm_appointment*, char*, int *); +extern void set_rfp_privacy_val(RFP*); +extern void set_rfp_repeat_val(RFP*); +extern void set_rfp_defaults(RFP*); +extern void set_rfp_vals(RFP*); +extern void rfp_set_repeat_values(RFP*); +extern void rfp_init(RFP*, Calendar *, Widget); #endif diff --git a/cde/programs/dtcm/dtcm/select.h b/cde/programs/dtcm/dtcm/select.h index 5d528b6df..cd9ad434a 100644 --- a/cde/programs/dtcm/dtcm/select.h +++ b/cde/programs/dtcm/dtcm/select.h @@ -52,7 +52,6 @@ #ifndef _SELECT_H #define _SELECT_H -#include "ansi_c.h" #include "browser.h" #include "calendar.h" @@ -79,16 +78,16 @@ typedef struct { int y; } pr_pos; -extern void activate_selection P((Selection*)); -extern void browser_deselect P((Calendar *, Browser*)); -extern void browser_select P((Calendar *, Browser*, pr_pos*)); -extern void calendar_deselect P((Calendar*)); -extern void calendar_select P((Calendar*, Selection_unit, caddr_t)); -extern void deactivate_selection P((Selection *)); -extern void monthbox_deselect P((Calendar*)); -extern void monthbox_select P((Calendar*)); -extern void paint_selection P((Calendar*)); -extern int selection_active P((Selection*)); -extern void weekchart_select P((Calendar*)); +extern void activate_selection(Selection*); +extern void browser_deselect(Calendar *, Browser*); +extern void browser_select(Calendar *, Browser*, pr_pos*); +extern void calendar_deselect(Calendar*); +extern void calendar_select (Calendar*, Selection_unit, caddr_t); +extern void deactivate_selection(Selection *); +extern void monthbox_deselect(Calendar*); +extern void monthbox_select(Calendar*); +extern void paint_selection(Calendar*); +extern int selection_active(Selection*); +extern void weekchart_select(Calendar*); #endif diff --git a/cde/programs/dtcm/dtcm/session.h b/cde/programs/dtcm/dtcm/session.h index a4725d49b..cdeaadad5 100644 --- a/cde/programs/dtcm/dtcm/session.h +++ b/cde/programs/dtcm/dtcm/session.h @@ -52,10 +52,9 @@ #ifndef _SESSION_H #define _SESSION_H -#include "ansi_c.h" #include "calendar.h" -extern void CMSaveSessionCB P((Widget, XtPointer, XtPointer)); -extern void GetSessionInfo P(()); +extern void CMSaveSessionCB(Widget, XtPointer, XtPointer); +extern void GetSessionInfo(); #endif diff --git a/cde/programs/dtcm/dtcm/tempbr.h b/cde/programs/dtcm/dtcm/tempbr.h index 77907a3a3..b823f9473 100644 --- a/cde/programs/dtcm/dtcm/tempbr.h +++ b/cde/programs/dtcm/dtcm/tempbr.h @@ -52,7 +52,6 @@ #ifndef _TEMPBR_H #define _TEMPBR_H -#include "ansi_c.h" #include "calendar.h" #ifdef FNS #include "cmfns.h" @@ -76,6 +75,6 @@ typedef struct { #endif } Tempbr; -extern caddr_t make_tempbr P(()); +extern caddr_t make_tempbr(Calendar *c); #endif /* _TEMPBR_H */ diff --git a/cde/programs/dtcm/dtcm/timezone.h b/cde/programs/dtcm/dtcm/timezone.h index 8fe6d8442..62c42075f 100644 --- a/cde/programs/dtcm/dtcm/timezone.h +++ b/cde/programs/dtcm/dtcm/timezone.h @@ -73,7 +73,7 @@ typedef struct { char gmttimezone[BUFSIZ]; }Timezone; -extern caddr_t make_timezone P((Calendar*)); -extern void refresh_timezone P((Timezone*)); +extern caddr_t make_timezone(Calendar*); +extern void refresh_timezone(Timezone*); #endif diff --git a/cde/programs/dtcm/dtcm/todo.h b/cde/programs/dtcm/dtcm/todo.h index 5ce14bea0..934c072a4 100644 --- a/cde/programs/dtcm/dtcm/todo.h +++ b/cde/programs/dtcm/dtcm/todo.h @@ -53,7 +53,6 @@ #define _TODO_H #include -#include "ansi_c.h" #include "calendar.h" #include "misc.h" #include "dssw.h" @@ -130,24 +129,24 @@ typedef struct { ** ToDo external function declarations ** *******************************************************************************/ -extern void add_to_todo_list P((CSA_entry_handle, ToDo*)); -extern void add_all_todo P((ToDo*)); -extern void build_todo_list P((ToDo*, Tick, Glance, CSA_entry_handle**, - CSA_uint32*, todo_view_op)); -extern int build_todo_view P((ToDo*, Glance, Boolean)); -extern void get_todo_vals P((ToDo*)); -extern void todo_hide P((ToDo*)); -extern void set_todo_defaults P((ToDo*)); -extern void set_todo_title P((ToDo*, char*)); -extern void set_todo_vals P((ToDo*)); -extern void show_todo P((Calendar*)); -extern void t_make_todo P((Calendar*)); -extern void show_todo_view P((Calendar*, todo_view_op)); -extern void todo_clean_up P((ToDo*)); -extern Boolean todo_showing P((ToDo*)); -extern Boolean todo_view_showing P((ToDo*)); -extern CSA_entry_handle t_nth_appt P((ToDo*, int)); -extern Boolean todo_insert P((Dtcm_appointment*, CSA_entry_handle*, - Calendar*)); +extern void add_to_todo_list(CSA_entry_handle, ToDo*); +extern void add_all_todo(ToDo*); +extern void build_todo_list(ToDo*, Tick, Glance, CSA_entry_handle**, + CSA_uint32*, todo_view_op); +extern int build_todo_view(ToDo*, Glance, Boolean); +extern void get_todo_vals(ToDo*); +extern void todo_hide(ToDo*); +extern void set_todo_defaults(ToDo*); +extern void set_todo_title(ToDo*, char*); +extern void set_todo_vals(ToDo*); +extern void show_todo(Calendar*); +extern void t_make_todo(Calendar*); +extern void show_todo_view(Calendar*, todo_view_op); +extern void todo_clean_up(ToDo*); +extern Boolean todo_showing(ToDo*); +extern Boolean todo_view_showing(ToDo*); +extern CSA_entry_handle t_nth_appt(ToDo*, int); +extern Boolean todo_insert(Dtcm_appointment*, CSA_entry_handle*, + Calendar*); #endif diff --git a/cde/programs/dtcm/dtcm/weekglance.h b/cde/programs/dtcm/dtcm/weekglance.h index 5f742a882..dd196338a 100644 --- a/cde/programs/dtcm/dtcm/weekglance.h +++ b/cde/programs/dtcm/dtcm/weekglance.h @@ -53,7 +53,6 @@ #define _WEEKGLANCE_H #include -#include "ansi_c.h" typedef struct week { int start_date; @@ -86,12 +85,12 @@ typedef struct week { typedef enum {okay, lower, upper} Boundary; -extern void paint_weekview P((Calendar*, XRectangle*)); -extern void print_week_range P((Calendar*, Tick, Tick)); -extern int count_multi_appts P((CSA_entry_handle*, int, Calendar*)); -extern void week_button P((Widget, XtPointer, XtPointer)); -extern void week_event P((XEvent*)); -extern void cleanup_after_weekview P((Calendar*)); -extern void resize_weekview P((Calendar *, Boundary *)); +extern void paint_weekview(Calendar*, XRectangle*); +extern void print_week_range(Calendar*, Tick, Tick); +extern int count_multi_appts(CSA_entry_handle*, int, Calendar*); +extern void week_button(Widget, XtPointer, XtPointer); +extern void week_event(XEvent*); +extern void cleanup_after_weekview(Calendar*); +extern void resize_weekview(Calendar *, Boundary *); #endif diff --git a/cde/programs/dtcm/dtcm/x_graphics.h b/cde/programs/dtcm/dtcm/x_graphics.h index 44b3a508b..a77f89f73 100644 --- a/cde/programs/dtcm/dtcm/x_graphics.h +++ b/cde/programs/dtcm/dtcm/x_graphics.h @@ -43,43 +43,43 @@ #define PAGE_HEIGHT 11000 /* 11.0" paper height */ #define XINCH 1000 /* 1 inch */ -extern void x_day_header P((void *)); -extern void x_day_timeslots P((void *, int, Boolean)); -extern void x_finish_printer P((void *)); -extern void x_finish_std_month P(()); -extern int x_get_day_lines_per_page P((void *)); -extern int x_get_month_lines_per_page P((void *)); -extern int x_get_week_lines_per_page P((void *)); -extern void x_init_day P((void *, int)); -extern void x_init_list P((void *)); -extern void x_init_month P((void *, int)); -extern void x_init_printer P((void *, short)); -extern void x_init_std_year P((void *)); -extern void x_init_week P((void *)); -extern void x_month_daynames P((void *, int)); -extern void x_month_timeslots P((void *, Tick, Boolean)); -extern void * x_open_file P((Calendar *)); -extern void x_print_file P((void *, Calendar *)); -extern void x_print_header P((void *, char*, int, int)); -extern void x_print_list_range P((Calendar*, CSA_sint32, int, - Tick, Tick)); -extern void x_print_little_months P((void *, Tick)); -extern void x_print_month P((void *, int, int, int, - int, int, int, int)); -extern Boolean x_print_month_appts P((void *, CSA_entry_handle*, int, - int, time_t, int)); -extern Boolean x_print_multi_appts P((void *, CSA_entry_handle*, int, - int, Glance)); -extern void x_print_todo P((void *, CSA_entry_handle*, int, +extern void x_day_header(void *); +extern void x_day_timeslots(void *, int, Boolean); +extern void x_finish_printer(void *); +extern void x_finish_std_month(); +extern int x_get_day_lines_per_page(void *); +extern int x_get_month_lines_per_page(void *); +extern int x_get_week_lines_per_page(void *); +extern void x_init_day(void *, int); +extern void x_init_list(void *); +extern void x_init_month(void *, int); +extern void x_init_printer(void *, short); +extern void x_init_std_year(void *); +extern void x_init_week(void *); +extern void x_month_daynames(void *, int); +extern void x_month_timeslots(void *, Tick, Boolean); +extern void * x_open_file (Calendar *); +extern void x_print_file(void *, Calendar *); +extern void x_print_header(void *, char*, int, int); +extern void x_print_list_range(Calendar*, CSA_sint32, int, + Tick, Tick); +extern void x_print_little_months(void *, Tick); +extern void x_print_month(void *, int, int, int, + int, int, int, int); +extern Boolean x_print_month_appts(void *, CSA_entry_handle*, int, + int, time_t, int); +extern Boolean x_print_multi_appts(void *, CSA_entry_handle*, int, + int, Glance); +extern void x_print_todo(void *, CSA_entry_handle*, int, CSA_sint32, Boolean, int, time_t, - char *)); -extern void x_print_year P((void *, int)); -extern void x_std_month_name P((void *, char*)); -extern void x_std_year_name P((void *, int)); -extern void x_week_appt_boxes P((void *)); -extern void x_week_daynames P((void *, char*, int, Boolean)); -extern void x_week_sched_boxes P((void *)); -extern void x_week_sched_draw P((void *, int)); -extern void x_week_sched_init P((void *)); + char *); +extern void x_print_year(void *, int); +extern void x_std_month_name(void *, char*); +extern void x_std_year_name(void *, int); +extern void x_week_appt_boxes(void *); +extern void x_week_daynames(void *, char*, int, Boolean); +extern void x_week_sched_boxes(void *); +extern void x_week_sched_draw(void *, int); +extern void x_week_sched_init(void *); #endif diff --git a/cde/programs/dtcm/dtcm/yearglance.h b/cde/programs/dtcm/dtcm/yearglance.h index 7a22328fc..9a6470fc4 100644 --- a/cde/programs/dtcm/dtcm/yearglance.h +++ b/cde/programs/dtcm/dtcm/yearglance.h @@ -65,9 +65,9 @@ typedef struct year { int year_shown; } Year; -extern void cleanup_after_yearview P((Calendar *)); -extern void year_button P((Widget, XtPointer, XtPointer)); -extern CSA_return_code paint_year P((Calendar*)); -extern void print_std_year_range P((int, int)); +extern void cleanup_after_yearview(Calendar *); +extern void year_button(Widget, XtPointer, XtPointer); +extern CSA_return_code paint_year(Calendar*); +extern void print_std_year_range(int, int); #endif diff --git a/cde/programs/dtcm/libDtCmP/cm_tty.h b/cde/programs/dtcm/libDtCmP/cm_tty.h index b98427f34..7b9f20059 100644 --- a/cde/programs/dtcm/libDtCmP/cm_tty.h +++ b/cde/programs/dtcm/libDtCmP/cm_tty.h @@ -54,7 +54,6 @@ #include #include -#include "ansi_c.h" #include "timeops.h" #include "util.h" #include "props.h" @@ -175,60 +174,60 @@ static const int ALL_DAY = -2; /* * External function definitions */ -extern char *boolean_str P((boolean_t)); -extern int cm_tty_delete P((nl_catd, CSA_session_handle, int, int, CSA_entry_handle*)); -extern void cm_tty_format_header P((Props*, Tick, char*)); -extern int cm_tty_insert P((nl_catd, CSA_session_handle, int, char*, char*, +extern char *boolean_str(boolean_t); +extern int cm_tty_delete(nl_catd, CSA_session_handle, int, int, CSA_entry_handle*); +extern void cm_tty_format_header(Props*, Tick, char*); +extern int cm_tty_insert(nl_catd, CSA_session_handle, int, char*, char*, char*, char*, char*, char*, - char*, Props*)); -extern void cm_tty_load_props P((Props**)); -extern int cm_tty_lookup P((nl_catd, CSA_session_handle, int, char*, char*, - CSA_entry_handle**, Props*)); -extern boolean_t convert_boolean_str P((char*)); -extern CSA_sint32 convert_privacy_str P((char*)); -extern int convert_privacy_str_to_op P((char*)); -extern SeparatorType convert_separator_str P((char*)); -extern Time_scope_menu_op convert_time_scope_str P((char*)); -extern char *day_str P((Days_op)); -extern char *default_repeat_cnt_str P((Repeat_menu_op)); -extern char *default_repeat_scope_str P((nl_catd, Repeat_menu_op)); -extern char *for_str P((For_menu_op)); -extern char *get_datemsg P((OrderingType, - SeparatorType)); -extern Parse_key_op identify_parse_key P((char*)); -extern void load_appt_defaults P((Dtcm_appointment*, Props*)); -extern void load_reminder_props P((Dtcm_appointment*, Props*)); -extern char *month_str P((Months_op)); -extern Validate_op parse_appt_from_file P((nl_catd, char*, CmDataList*, + char*, Props*); +extern void cm_tty_load_props(Props**); +extern int cm_tty_lookup(nl_catd, CSA_session_handle, int, char*, char*, + CSA_entry_handle**, Props*); +extern boolean_t convert_boolean_str(char*); +extern CSA_sint32 convert_privacy_str(char*); +extern int convert_privacy_str_to_op (char*); +extern SeparatorType convert_separator_str(char*); +extern Time_scope_menu_op convert_time_scope_str(char*); +extern char *day_str(Days_op); +extern char *default_repeat_cnt_str(Repeat_menu_op); +extern char *default_repeat_scope_str(nl_catd, Repeat_menu_op); +extern char *for_str(For_menu_op); +extern char *get_datemsg(OrderingType, + SeparatorType); +extern Parse_key_op identify_parse_key(char*); +extern void load_appt_defaults(Dtcm_appointment*, Props*); +extern void load_reminder_props(Dtcm_appointment*, Props*); +extern char *month_str(Months_op); +extern Validate_op parse_appt_from_file(nl_catd, char*, CmDataList*, Props*, boolean_t(*)(void*), - void*, int)); -extern char *parse_attrs_to_string P((Dtcm_appointment*, Props*, - char*)); -extern char *attrs_to_string P((CSA_attribute *, int)); -extern char *create_rfc_message P((char *, char *, char**, int)); -extern char *parse_appt_to_string P((CSA_session_handle, CSA_entry_handle, Props*, int)); -extern char *periodstr_from_period P((CSA_sint32, int)); -extern char *privacy_str P((int)); -extern char *privacy_str_old P((int)); -extern char *repeat_str P((nl_catd, Repeat_menu_op)); -extern char *repeat_scope_str P((nl_catd, Repeat_scope_menu_op)); -extern char *privacy_str_411 P((int)); -extern char *separator_str P((SeparatorType)); -extern void str_to_period P((char*, CSA_sint32*, int*)); -extern int timescopestring_to_tick P((char*)); -extern char *time_scope_str P((Time_scope_menu_op)); -extern char *time_scope_str_i18n P((nl_catd, Time_scope_menu_op)); -extern boolean_t valid_time P((Props*, char*)); -extern Validate_op validate_appt P((nl_catd, Dtcm_appointment*, + void*, int); +extern char *parse_attrs_to_string(Dtcm_appointment*, Props*, + char*); +extern char *attrs_to_string(CSA_attribute *, int); +extern char *create_rfc_message(char *, char *, char**, int); +extern char *parse_appt_to_string(CSA_session_handle, CSA_entry_handle, Props*, int); +extern char *periodstr_from_period(CSA_sint32, int); +extern char *privacy_str(int); +extern char *privacy_str_old(int); +extern char *repeat_str (nl_catd, Repeat_menu_op); +extern char *repeat_scope_str(nl_catd, Repeat_scope_menu_op); +extern char *privacy_str_411(int); +extern char *separator_str(SeparatorType); +extern void str_to_period(char*, CSA_sint32*, int*); +extern int timescopestring_to_tick(char*); +extern char *time_scope_str(Time_scope_menu_op); +extern char *time_scope_str_i18n(nl_catd, Time_scope_menu_op); +extern boolean_t valid_time(Props*, char*); +extern Validate_op validate_appt(nl_catd, Dtcm_appointment*, char*, char*, char*, int, char*, char*, char*, boolean_t(*)(void*), void*, - int)); -extern Validate_op validate_dssw P((Dtcm_appointment*, char*, + int); +extern Validate_op validate_dssw(Dtcm_appointment*, char*, char*, char*, int, char*, - boolean_t(*)(void*), void*)); -extern Validate_op validate_rfp P((nl_catd, Dtcm_appointment*, - char*, char*, int)); -extern Validate_op validate_reminders P((Dtcm_appointment*)); + boolean_t(*)(void*), void*); +extern Validate_op validate_rfp(nl_catd, Dtcm_appointment*, + char*, char*, int); +extern Validate_op validate_reminders(Dtcm_appointment*); #endif diff --git a/cde/programs/dtcm/libDtCmP/getdate.h b/cde/programs/dtcm/libDtCmP/getdate.h index 6d3289d85..f0dd5b752 100644 --- a/cde/programs/dtcm/libDtCmP/getdate.h +++ b/cde/programs/dtcm/libDtCmP/getdate.h @@ -64,7 +64,6 @@ struct timeb #include #endif #include -#include "ansi_c.h" #define BOT_YEAR 1970 #define EOT_YEAR 2037 @@ -77,12 +76,12 @@ struct timeb #define DATE_BHOUR -7 /* date had a bad hour number */ #define DATE_CONV -8 /* date converted poorly for am/pm/24hr */ -extern time_t dateconv P((int, int, int, int, int, int, int, int, int)); -extern time_t dayconv P((int, int, time_t)); -extern time_t timeconv P((int, int, int, int)); -extern time_t monthadd P((time_t, time_t)); -extern time_t daylcorr P((time_t, time_t)); -extern time_t cm_getdate P((char*, struct timeb *)); +extern time_t dateconv (int, int, int, int, int, int, int, int, int); +extern time_t dayconv (int, int, time_t); +extern time_t timeconv (int, int, int, int); +extern time_t monthadd (time_t, time_t); +extern time_t daylcorr (time_t, time_t); +extern time_t cm_getdate (char*, struct timeb *); int yylex(); extern void yyerror(char *s); diff --git a/cde/programs/dtcm/libDtCmP/props.h b/cde/programs/dtcm/libDtCmP/props.h index b8f0385e1..b5f763845 100644 --- a/cde/programs/dtcm/libDtCmP/props.h +++ b/cde/programs/dtcm/libDtCmP/props.h @@ -53,7 +53,6 @@ #define _PROPS_H #include -#include "ansi_c.h" #include "resource.h" /******************************************************************************* @@ -150,14 +149,14 @@ typedef struct { ** External function declarations ** *******************************************************************************/ -extern boolean_t cal_convert_cmrc P((Props*)); -extern char *get_char_prop P((Props*, Props_op)); -extern char *get_char_prop_default P((Props_op)); -extern int get_int_prop P((Props*, Props_op)); -extern void props_clean_up P((Props*)); -extern boolean_t read_props P((Props*)); -extern boolean_t save_props P((Props*)); -extern boolean_t set_char_prop P((Props*, Props_op, char*)); -extern boolean_t set_int_prop P((Props*, Props_op, int)); +extern boolean_t cal_convert_cmrc(Props*); +extern char *get_char_prop(Props*, Props_op); +extern char *get_char_prop_default(Props_op); +extern int get_int_prop(Props*, Props_op); +extern void props_clean_up(Props*); +extern boolean_t read_props(Props*); +extern boolean_t save_props(Props*); +extern boolean_t set_char_prop(Props*, Props_op, char*); +extern boolean_t set_int_prop(Props*, Props_op, int); #endif diff --git a/cde/programs/dtcm/libDtCmP/resource.h b/cde/programs/dtcm/libDtCmP/resource.h index c9ab06d3a..830ca7447 100644 --- a/cde/programs/dtcm/libDtCmP/resource.h +++ b/cde/programs/dtcm/libDtCmP/resource.h @@ -51,8 +51,7 @@ #ifndef _RESOURCE_H #define _RESOURCE_H - -#include "ansi_c.h" + #include /* @@ -68,14 +67,14 @@ typedef struct Resource Resource; /* ** Function declarations */ -extern void free_resources P((Resource*)); -extern char *get_resource P((Resource*, char *, char*, - char*, char*)); -extern char *get_resource_by_val P((Resource*, char*, char*)); -extern boolean_t load_resources P((Resource**, char*)); -extern boolean_t save_resources P((Resource*, char*)); -extern boolean_t set_resource P((Resource**, char*, char*, - char*, char*)); -extern boolean_t set_resource_by_val P((Resource**, char*, char*)); +extern void free_resourcee(Resource*); +extern char *get_resource(Resource*, char *, char*, + char*, char*); +extern char *get_resource_by_val(Resource*, char*, char*); +extern boolean_t load_resources(Resource**, char*); +extern boolean_t save_resources(Resource*, char*); +extern boolean_t set_resource(Resource**, char*, char*, + char*, char*); +extern boolean_t set_resource_by_val(Resource**, char*, char*); #endif diff --git a/cde/programs/dtcm/libDtCmP/timeops.h b/cde/programs/dtcm/libDtCmP/timeops.h index c9a6f682c..70664b3ef 100644 --- a/cde/programs/dtcm/libDtCmP/timeops.h +++ b/cde/programs/dtcm/libDtCmP/timeops.h @@ -53,7 +53,6 @@ #define _TIMEOPS_H #include -#include "ansi_c.h" typedef enum { minsec = 60, @@ -81,71 +80,71 @@ extern char *months2[]; extern int monthsecs[]; extern char *numbers[]; -extern int days_to_seconds P((int)); -extern int dom P((Tick)); -extern int dow P((Tick)); -extern int fdom P((Tick)); -extern Tick first_dom P((Tick)); -extern Tick first_dow P((Tick)); -extern Tick get_eot P(()); -extern Tick get_bot P(()); -extern long gmt_off P(()); -extern int hour P((Tick)); -extern int hours_to_seconds P((int)); -extern void init_time P(()); -extern Tick jan1 P((Tick)); -extern Tick last_dom P((Tick)); -extern Tick last_dow P((Tick)); -extern Tick last_ndays P((Tick t, int)); -extern int lastapptofweek P((u_int)); -extern Tick lastjan1 P((Tick)); -extern int ldom P((Tick)); -extern Tick lower_bound P((int, Tick)); -extern Tick lowerbound P((Tick)); -extern boolean_t magic_time P((Tick t)); -extern Tick midnight P(()); -extern int minutes_to_seconds P((int)); -extern int minute P((Tick)); -extern int month P((Tick)); -extern Tick monthdayyear P((int, int, int)); -extern int monthlength P((Tick)); -extern Tick next_ndays P((Tick, int)); -extern Tick next_nhours P((Tick, int)); -extern Tick next2weeks P((Tick)); -extern Tick nextday P((Tick)); -extern Tick nextjan1 P((Tick)); -extern Tick nextmonth P((Tick t)); -extern Tick next_nmonth P((Tick t, int n)); -extern Tick nextmonth_exactday P((Tick t)); -extern Tick nextweek P((Tick t)); -extern Tick nextyear P((Tick)); -extern Tick nextnyear P((Tick t, int n)); -extern Tick now P(()); -extern int ntimes_this_week P((u_int, int)); -extern int numwks P((Tick)); -extern Tick prev_nmonth P((Tick t, int n)); -extern Tick prevmonth_exactday P((Tick)); -extern Tick previousmonth P((Tick t)); -extern Tick prevweek P((Tick t)); -extern Tick prev2weeks P((Tick t)); -extern Tick prevnyear P((Tick t, int n)); -extern int seconds P((int n, Unit unit)); -extern double seconds_dble P((double n, Unit unit)); -extern int seconds_to_days P((int)); -extern int seconds_to_hours P((int)); -extern int seconds_to_minutes P((int)); -extern int seconds_to_weeks P((int)); -extern void set_timezone P((char*)); -extern int timeok P((Tick t)); -extern Tick upperbound P((Tick)); -extern int weeks_to_seconds P((int)); -extern int wom P((Tick)); -extern boolean_t weekofmonth P((Tick, int*)); -extern Tick xytoclock P((int, int, Tick)); -extern int year P((Tick)); -extern int adjust_dst P((Tick, Tick)); -extern boolean_t adjust_hour P((int*)); -extern int leapyr P((int)); -extern Tick prevday P((Tick)); +extern int days_to_seconds (int); +extern int dom (Tick); +extern int dow (Tick); +extern int fdom (Tick); +extern Tick first_dom (Tick); +extern Tick first_dow (Tick); +extern Tick get_eot (void); +extern Tick get_bot (void); +extern long gmt_off (void); +extern int hour (Tick); +extern int hours_to_seconds(int); +extern void init_time (void); +extern Tick jan1 (Tick); +extern Tick last_dom (Tick); +extern Tick last_dow (Tick); +extern Tick last_ndays (Tick t, int); +extern int lastapptofweek (u_int); +extern Tick lastjan1 (Tick); +extern int ldom (Tick); +extern Tick lower_bound (int, Tick); +extern Tick lowerbound (Tick); +extern boolean_t magic_time (Tick t); +extern Tick midnight (); +extern int minutes_to_seconds(int); +extern int minute (Tick); +extern int month (Tick); +extern Tick monthdayyear (int, int, int); +extern int monthlength (Tick); +extern Tick next_ndays (Tick, int); +extern Tick next_nhours (Tick, int); +extern Tick next2weeks (Tick); +extern Tick nextday (Tick); +extern Tick nextjan1 (Tick); +extern Tick nextmonth (Tick t); +extern Tick next_nmonth (Tick t, int n); +extern Tick nextmonth_exactday(Tick t); +extern Tick nextweek (Tick t); +extern Tick nextyear (Tick); +extern Tick nextnyear (Tick t, int n); +extern Tick now (void); +extern int ntimes_this_week(u_int, int); +extern int numwks (Tick); +extern Tick prev_nmonth (Tick t, int n); +extern Tick prevmonth_exactday(Tick); +extern Tick previousmonth (Tick t); +extern Tick prevweek (Tick t); +extern Tick prev2weeks (Tick t); +extern Tick prevnyear (Tick t, int n); +extern int seconds (int n, Unit unit); +extern double seconds_dble (double n, Unit unit); +extern int seconds_to_days (int); +extern int seconds_to_hours(int); +extern int seconds_to_minutes(int); +extern int seconds_to_weeks(int); +extern void set_timezone (char*); +extern int timeok (Tick t); +extern Tick upperbound (Tick); +extern int weeks_to_seconds(int); +extern int wom (Tick); +extern boolean_t weekofmonth (Tick, int*); +extern Tick xytoclock (int, int, Tick); +extern int year (Tick); +extern int adjust_dst (Tick, Tick); +extern boolean_t adjust_hour (int*); +extern int leapyr (int); +extern Tick prevday (Tick); #endif diff --git a/cde/programs/dtcm/libDtCmP/util.h b/cde/programs/dtcm/libDtCmP/util.h index 0ab470992..143d17e44 100644 --- a/cde/programs/dtcm/libDtCmP/util.h +++ b/cde/programs/dtcm/libDtCmP/util.h @@ -55,7 +55,6 @@ #include #include #include -#include "ansi_c.h" #include "timeops.h" #include "props.h" @@ -212,79 +211,79 @@ typedef struct { * forth to the backend. These functions and structures make hard coding * indexes into the arrays unnecessary. */ -extern Dtcm_appointment *allocate_appt_struct P((Allocation_reason , int, ...)); -extern CSA_return_code query_appt_struct P((CSA_session_handle, +extern Dtcm_appointment *allocate_appt_struct(Allocation_reason , int, ...); +extern CSA_return_code query_appt_struct (CSA_session_handle, CSA_entry_handle, - Dtcm_appointment *)); -extern Dtcm_calendar *allocate_cal_struct P((Allocation_reason, int, ...)); -extern CSA_return_code query_cal_struct P((CSA_session_handle, - Dtcm_calendar *)); -extern void free_appt_struct P((Dtcm_appointment**)); -extern void free_cal_struct P((Dtcm_calendar**)); + Dtcm_appointment *); +extern Dtcm_calendar *allocate_cal_struct(Allocation_reason, int, ...); +extern CSA_return_code query_cal_struct (CSA_session_handle, + Dtcm_calendar *); +extern void free_appt_struct(Dtcm_appointment**); +extern void free_cal_struct (Dtcm_calendar**); -extern boolean_t cal_ident_index_ro P((int, int)); -extern boolean_t entry_ident_index_ro P((int, int)); -extern CSA_enum cal_ident_index_tag P((int)); -extern CSA_enum entry_ident_index_tag P((int)); -extern boolean_t ident_name_ro P((char*, int)); -extern void initialize_cal_attr P((int, CSA_attribute*, - Allocation_reason, int)); -extern void initialize_entry_attr P((int, CSA_attribute*, - Allocation_reason, int)); -extern void set_appt_links P((Dtcm_appointment*)); -extern void set_cal_links P((Dtcm_calendar*)); -extern void scrub_cal_attr_list P((Dtcm_calendar*)); -extern void setup_range P((CSA_attribute**, +extern boolean_t cal_ident_index_ro(int, int); +extern boolean_t entry_ident_index_ro(int, int); +extern CSA_enum cal_ident_index_tag(int); +extern CSA_enum entry_ident_index_tag(int); +extern boolean_t ident_name_ro(char*, int); +extern void initialize_cal_attr(int, CSA_attribute*, + Allocation_reason, int); +extern void initialize_entry_attr(int, CSA_attribute*, + Allocation_reason, int); +extern void set_appt_links (Dtcm_appointment*); +extern void set_cal_links (Dtcm_calendar*); +extern void scrub_cal_attr_list(Dtcm_calendar*); +extern void setup_range (CSA_attribute**, CSA_enum**, int*, time_t, time_t, CSA_sint32, CSA_sint32, - boolean_t, int)); -extern void free_range P((CSA_attribute**, - CSA_enum**, int)); + boolean_t, int); +extern void free_range (CSA_attribute**, + CSA_enum**, int); /* * Other utilty functions */ -extern int blank_buf P((char*)); -extern int embedded_blank P((char*)); -extern char *ckalloc P(()); -extern char *cm_def_printer P(()); -extern char *cm_get_credentials P(()); -extern char *cm_get_local_domain P(()); -extern char *cm_get_local_host P(()); -extern char *cm_get_uname P(()); -extern char *cm_pqtarget P((char*)); -extern char *cm_strcat P((char*, char*)); -extern char *cm_strcpy P((char*, char*)); -extern char *cm_strdup P((char*)); -extern int cm_strlen P((char*)); -extern char *cm_target2domain P((char*)); -extern char *cm_target2host P((char*)); -extern char *cm_target2location P((char*)); -extern char *cm_target2name P((char*)); -extern char *cr_to_str P((char*)); -extern void destroy_lines P((Lines*)); -extern void expand_esc_chars P((char*)); -extern char *get_head P((char*, char)); -extern char *get_tail P((char*, char)); -extern void print_tick P((time_t)); -extern boolean_t same_path P((char*, char*)); -extern boolean_t same_user P((char*, char*)); -extern char *str_to_cr P((char*)); -extern char *strncat P(()); -extern char *substr P((char*, int, int n)); -extern void syserr P((char*, int, int, int)); -extern Lines *text_to_lines P((char*, int)); -extern int get_data_version P((CSA_session_handle)); -extern int get_server_version P((CSA_session_handle)); -extern CSA_sint32 privacy_set P((Dtcm_appointment *)); -extern CSA_sint32 showtime_set P((Dtcm_appointment *)); -extern int max P((int, int)); -extern int min P((int, int)); -extern int parse_date P((OrderingType, SeparatorType, char*, char*, char*, char*)); +extern int blank_buf (char*); +extern int embedded_blank(char*); +extern char * ckalloc(unsigned int size); +extern char * cm_def_printer(void); +extern char * cm_get_credentials(void); +extern char * cm_get_local_domain(void); +extern char * cm_get_local_host(void); +extern char * cm_get_uname(void); +extern char * cm_pqtarget(char*); +extern char * cm_strcat(char*, char*); +extern char * cm_strcpy(char*, char*); +extern char * cm_strdup(char*); +extern int cm_strlen(char*); +extern char * cm_target2domain(char*); +extern char * cm_target2host (char*); +extern char * cm_target2location(char*); +extern char * cm_target2name (char*); +extern char * cr_to_str(char*); +extern void destroy_lines(Lines*); +extern void expand_esc_chars(char*); +extern char * get_head(char*, char); +extern char * get_tail(char*, char); +extern void print_tick(time_t); +extern boolean_t same_path(char*, char*); +extern boolean_t same_user(char*, char*); +extern char * str_to_cr(char*); +extern char * strncat(char *, const char *, size_t n); +extern char * substr(char*, int, int n); +extern void syserr(char*, int, int, int); +extern Lines * text_to_lines (char*, int); +extern int get_data_version(CSA_session_handle); +extern int get_server_version(CSA_session_handle); +extern CSA_sint32 privacy_set(Dtcm_appointment *); +extern CSA_sint32 showtime_set(Dtcm_appointment *); +extern int max(int, int); +extern int min(int, int); +extern int parse_date(OrderingType, SeparatorType, char*, char*, char*, char*); -extern int datestr2mdy P((char*, OrderingType, SeparatorType, char*)); -extern void format_tick P((time_t, OrderingType, SeparatorType, char*)); -extern void format_time P((Tick, DisplayType, char*)); +extern int datestr2mdy(char*, OrderingType, SeparatorType, char*); +extern void format_tick(time_t, OrderingType, SeparatorType, char*); +extern void format_time(Tick, DisplayType, char*); /* * In Motif you can't associate user data with items in a list. To get around @@ -303,12 +302,12 @@ typedef struct _CmDataList { int count; } CmDataList; -extern CmDataList *CmDataListCreate P((void)); -extern void CmDataListDestroy P((CmDataList *, int)); -extern int CmDataListAdd P((CmDataList *, void *, int)); -extern void *CmDataListGetData P((CmDataList *, int)); -extern void *CmDataListDeletePos P((CmDataList *, int, int)); -extern void CmDataListDeleteAll P((CmDataList *, int)); +extern CmDataList * CmDataListCreate(void); +extern void CmDataListDestroy(CmDataList *, int); +extern int CmDataListAdd(CmDataList *, void *, int); +extern void * CmDataListGetData(CmDataList *, int); +extern void * CmDataListDeletePos(CmDataList *, int, int); +extern void CmDataListDeleteAll(CmDataList *, int); #endif diff --git a/cde/programs/dtcm/server/access.h b/cde/programs/dtcm/server/access.h index f2359a581..c6160994d 100644 --- a/cde/programs/dtcm/server/access.h +++ b/cde/programs/dtcm/server/access.h @@ -31,7 +31,6 @@ #ifndef _ACCESS_H #define _ACCESS_H -#include "ansi_c.h" #include "cm.h" #include "rtable4.h" #include "cmscalendar.h" @@ -70,46 +69,46 @@ #define _DTCMS_HAS_V4_WRITE_ACCESS(a) \ ((a) & (access_write_4 | CSA_OWNER_RIGHTS)) -extern CSA_return_code _DtCmsV4LoadAndCheckAccess P(( +extern CSA_return_code _DtCmsV4LoadAndCheckAccess( struct svc_req *svcrq, char *target, char **sender, uint *access, - _DtCmsCalendar **cal)); + _DtCmsCalendar **cal); -extern CSA_return_code _DtCmsV5LoadAndCheckAccess P(( +extern CSA_return_code _DtCmsV5LoadAndCheckAccess( struct svc_req *svcrq, char *target, char **sender, uint *access, - _DtCmsCalendar **cal)); + _DtCmsCalendar **cal); -extern CSA_return_code _DtCmsGetClientInfo P(( +extern CSA_return_code _DtCmsGetClientInfo( struct svc_req *svcrq, - char **source)); + char **source); -extern boolean_t _DtCmsIsFileOwner P((char *owner, char *user, char *target)); +extern boolean_t _DtCmsIsFileOwner(char *owner, char *user, char *target); -extern void _DtCmsShowAccessList P((Access_Entry_4 *l)); +extern void _DtCmsShowAccessList(Access_Entry_4 *l); -extern Access_Entry_4 *_DtCmsCalendarAccessList P((_DtCmsCalendar *cal)); +extern Access_Entry_4 *_DtCmsCalendarAccessList(_DtCmsCalendar *cal); -extern Privacy_Level_4 _DtCmCheckPrivacyLevel P((char **p_src, Appt_4 *p_appt)); +extern Privacy_Level_4 _DtCmCheckPrivacyLevel(char **p_src, Appt_4 *p_appt); -extern CSA_return_code _DtCmsCheckViewAccess P(( +extern CSA_return_code _DtCmsCheckViewAccess( char *user, uint access, - cms_entry *eptr)); + cms_entry *eptr); -extern CSA_return_code _DtCmsCheckChangeAccess P(( +extern CSA_return_code _DtCmsCheckChangeAccess( char *user, uint access, - cms_entry *eptr)); + cms_entry *eptr); -extern uint _DtCmsClassToInsertAccess P((cms_entry *entry)); +extern uint _DtCmsClassToInsertAccess(cms_entry *entry); -extern uint _DtCmsClassToViewAccess P((cms_entry *entry)); +extern uint _DtCmsClassToViewAccess(cms_entry *entry); -extern uint _DtCmsClassToChangeAccess P((cms_entry *entry)); +extern uint _DtCmsClassToChangeAccess(cms_entry *entry); #endif diff --git a/cde/programs/dtcm/server/callback.h b/cde/programs/dtcm/server/callback.h index 9fa3cb6d9..d1ebf3d43 100644 --- a/cde/programs/dtcm/server/callback.h +++ b/cde/programs/dtcm/server/callback.h @@ -31,7 +31,6 @@ #ifndef _CALLBACK_H #define _CALLBACK_H -#include "ansi_c.h" #include "rtable4.h" typedef struct __DtCmsRegistrationInfo { @@ -44,81 +43,81 @@ typedef struct __DtCmsRegistrationInfo { struct __DtCmsRegistrationInfo *next; } _DtCmsRegistrationInfo; -extern _DtCmsRegistrationInfo *_DtCmsMakeRegistrationInfo P(( +extern _DtCmsRegistrationInfo *_DtCmsMakeRegistrationInfo( char *client, int types, u_long prognum, u_long versnum, u_long procnum, - int pid)); + int pid); -extern void _DtCmsFreeRegistrationInfo P((_DtCmsRegistrationInfo *w)); +extern void _DtCmsFreeRegistrationInfo(_DtCmsRegistrationInfo *w); -extern _DtCmsRegistrationInfo *_DtCmsGetRegistration P(( +extern _DtCmsRegistrationInfo *_DtCmsGetRegistration( _DtCmsRegistrationInfo **rlist, char *client, u_long prognum, u_long versnum, u_long procnum, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsRemoveRegistration P(( +extern _DtCmsRegistrationInfo *_DtCmsRemoveRegistration( _DtCmsRegistrationInfo *rlist, - _DtCmsRegistrationInfo *rinfo)); + _DtCmsRegistrationInfo *rinfo); -extern _DtCmsRegistrationInfo *_DtCmsCheckRegistrationList P(( - _DtCmsRegistrationInfo *rlist)); +extern _DtCmsRegistrationInfo *_DtCmsCheckRegistrationList( + _DtCmsRegistrationInfo *rlist); -extern _DtCmsRegistrationInfo * _DtCmsDoV1CbForV4Data P(( +extern _DtCmsRegistrationInfo * _DtCmsDoV1CbForV4Data( _DtCmsRegistrationInfo *rlist, char *source, int pid, cms_key *key1, - cms_key *key2)); + cms_key *key2); -extern _DtCmsRegistrationInfo *_DtCmsDoV1Callback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoV1Callback( _DtCmsRegistrationInfo *rlist, char *source, int pid, - Appt_4 *a)); + Appt_4 *a); -extern _DtCmsRegistrationInfo *_DtCmsDoOpenCalCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoOpenCalCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *user, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsDoRemoveCalCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoRemoveCalCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *user, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsDoUpdateCalAttrsCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoUpdateCalAttrsCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *user, uint num_attrs, cms_attribute *attrs, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsDoInsertEntryCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoInsertEntryCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *source, long id, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsDoDeleteEntryCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoDeleteEntryCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *source, long id, int scope, time_t time, - int pid)); + int pid); -extern _DtCmsRegistrationInfo *_DtCmsDoUpdateEntryCallback P(( +extern _DtCmsRegistrationInfo *_DtCmsDoUpdateEntryCallback( _DtCmsRegistrationInfo *rlist, char *cal, char *source, @@ -126,10 +125,10 @@ extern _DtCmsRegistrationInfo *_DtCmsDoUpdateEntryCallback P(( long oldid, int scope, long time, - int pid)); + int pid); -extern void _DtCmsListRegistration P((_DtCmsRegistrationInfo *rlist, - char *cal)); +extern void _DtCmsListRegistration(_DtCmsRegistrationInfo *rlist, + char *cal); #endif diff --git a/cde/programs/dtcm/server/cmsattr.h b/cde/programs/dtcm/server/cmsattr.h index 1bf1239a5..cb07372d6 100644 --- a/cde/programs/dtcm/server/cmsattr.h +++ b/cde/programs/dtcm/server/cmsattr.h @@ -44,36 +44,35 @@ #ifndef _CMSATTR_H #define _CMSATTR_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" -extern CSA_return_code _DtCmsUpdateSint32AttrVal P(( +extern CSA_return_code _DtCmsUpdateSint32AttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateUint32AttrVal P(( +extern CSA_return_code _DtCmsUpdateUint32AttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateStringAttrVal P(( +extern CSA_return_code _DtCmsUpdateStringAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateAccessListAttrVal P(( +extern CSA_return_code _DtCmsUpdateAccessListAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateReminderAttrVal P(( +extern CSA_return_code _DtCmsUpdateReminderAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateDateTimeListAttrVal P(( +extern CSA_return_code _DtCmsUpdateDateTimeListAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); -extern CSA_return_code _DtCmsUpdateOpaqueDataAttrVal P(( +extern CSA_return_code _DtCmsUpdateOpaqueDataAttrVal( cms_attribute_value *newval, - cms_attribute_value **attrval)); + cms_attribute_value **attrval); #endif diff --git a/cde/programs/dtcm/server/cmscalendar.h b/cde/programs/dtcm/server/cmscalendar.h index 27df5198b..3e1e8acc4 100644 --- a/cde/programs/dtcm/server/cmscalendar.h +++ b/cde/programs/dtcm/server/cmscalendar.h @@ -31,7 +31,6 @@ #ifndef _CMSCALENDAR_H #define _CMSCALENDAR_H -#include "ansi_c.h" #include "csa.h" #include "cm.h" #include "nametbl.h" @@ -89,84 +88,84 @@ typedef struct __DtCmsCalendar { } _DtCmsCalendar; -extern _DtCmsCalendar * _DtCmsMakeCalendar P(( +extern _DtCmsCalendar * _DtCmsMakeCalendar( char *owner, - char *name)); + char *name); -extern void _DtCmsPutInCalList P((_DtCmsCalendar *cal)); +extern void _DtCmsPutInCalList(_DtCmsCalendar *cal); -extern void _DtCmsFreeCalendar P((_DtCmsCalendar *cal)); +extern void _DtCmsFreeCalendar(_DtCmsCalendar *cal); -extern CSA_return_code _DtCmsSetFileVersion P(( +extern CSA_return_code _DtCmsSetFileVersion( _DtCmsCalendar *cal, - int version)); + int version); -extern CSA_return_code _DtCmsLoadCalendar P(( +extern CSA_return_code _DtCmsLoadCalendar( char *target, - _DtCmsCalendar **cal)); + _DtCmsCalendar **cal); -extern char * _DtCmsGetCalendarOwner P((char *target)); +extern char * _DtCmsGetCalendarOwner(char *target); -extern CSA_return_code _DtCmsGetCalendarByName P(( +extern CSA_return_code _DtCmsGetCalendarByName( char *target, boolean_t load, - _DtCmsCalendar **cal)); + _DtCmsCalendar **cal); -extern CSA_return_code _DtCmsInsertEntry4Parser P(( +extern CSA_return_code _DtCmsInsertEntry4Parser( _DtCmsCalendar *cal, - cms_entry *entry)); + cms_entry *entry); -extern void _DtCmsSetAccess4Parser P(( +extern void _DtCmsSetAccess4Parser( _DtCmsCalendar *cal, Access_Entry_4 *list, - int type)); + int type); -extern void _DtCmsSetCalendarAttrs4Parser P(( +extern void _DtCmsSetCalendarAttrs4Parser( _DtCmsCalendar *cal, int len, - cms_attribute *attrs)); + cms_attribute *attrs); -extern void _DtCmsGenerateKey P((_DtCmsCalendar *cal, long *key)); +extern void _DtCmsGenerateKey(_DtCmsCalendar *cal, long *key); -extern CSA_return_code _DtCmsEnumerateUp P(( +extern CSA_return_code _DtCmsEnumerateUp( _DtCmsCalendar *cal, - _DtCmsEnumerateProc doit)); + _DtCmsEnumerateProc doit); -extern void _DtCmsEnumerateDown P(( +extern void _DtCmsEnumerateDown( _DtCmsCalendar *cal, - _DtCmsEnumerateProc doit)); + _DtCmsEnumerateProc doit); -extern CSA_return_code _DtCmsRbToCsaStat P((Rb_Status rb_stat)); +extern CSA_return_code _DtCmsRbToCsaStat(Rb_Status rb_stat); -extern CSA_return_code _DtCmsGetCalAttrsByName P(( +extern CSA_return_code _DtCmsGetCalAttrsByName( _DtCmsCalendar *cal, uint num_names, cms_attr_name *names, uint *num_attrs_r, - cms_attribute **attrs_r)); + cms_attribute **attrs_r); -extern CSA_return_code _DtCmsGetAllCalAttrs P(( +extern CSA_return_code _DtCmsGetAllCalAttrs( _DtCmsCalendar *cal, u_int *num_attrs_r, cms_attribute **attrs_r, - boolean_t returnall)); + boolean_t returnall); -extern CSA_return_code _DtCmsGetCalAttrNames P(( +extern CSA_return_code _DtCmsGetCalAttrNames( _DtCmsCalendar *cal, uint *num_names_r, - cms_attr_name **names_r)); + cms_attr_name **names_r); -extern void _DtCmsFreeCmsAttrNames P((uint num, cms_attr_name *names)); +extern void _DtCmsFreeCmsAttrNames(uint num, cms_attr_name *names); -extern CSA_return_code _DtCmsUpdateCalAttributesAndLog P(( +extern CSA_return_code _DtCmsUpdateCalAttributesAndLog( _DtCmsCalendar *cal, uint numsrc, cms_attribute *srcattrs, - uint access)); + uint access); -extern CSA_return_code _DtCmsV5TransactLog P(( +extern CSA_return_code _DtCmsV5TransactLog( _DtCmsCalendar *cal, cms_entry *e, - _DtCmsLogOps op)); + _DtCmsLogOps op); #endif diff --git a/cde/programs/dtcm/server/cmsconvert.h b/cde/programs/dtcm/server/cmsconvert.h index f2ff80e71..c0a30d641 100644 --- a/cde/programs/dtcm/server/cmsconvert.h +++ b/cde/programs/dtcm/server/cmsconvert.h @@ -32,59 +32,58 @@ #define _CMSCONVERT_H #include -#include "ansi_c.h" #include "cm.h" #include "rtable4.h" #include "v4ops.h" -extern CSA_return_code _DtCmsCmsentriesToAppt4ForClient P(( +extern CSA_return_code _DtCmsCmsentriesToAppt4ForClient( cms_entry *entries, - Appt_4 **appt)); + Appt_4 **appt); -extern CSA_return_code _DtCmsCmsentriesToAbbrAppt4ForClient P(( +extern CSA_return_code _DtCmsCmsentriesToAbbrAppt4ForClient( cms_entry *entries, - Abb_Appt_4 **abbr)); + Abb_Appt_4 **abbr); -extern CSA_return_code _DtCmsCmsentryToAbbrAppt4 P(( +extern CSA_return_code _DtCmsCmsentryToAbbrAppt4( cms_entry *entry, - Abb_Appt_4 **abbr)); + Abb_Appt_4 **abbr); -extern Access_Entry_4 *_DtCmsConvertV5AccessList P(( +extern Access_Entry_4 *_DtCmsConvertV5AccessList( cms_access_entry *cmslist, - boolean_t strictmode)); + boolean_t strictmode); -extern cms_access_entry *_DtCmsConvertV4AccessList P(( - Access_Entry_4 *alist)); +extern cms_access_entry *_DtCmsConvertV4AccessList( + Access_Entry_4 *alist); -extern CSA_return_code _DtCmsReminderRefToReminder P(( +extern CSA_return_code _DtCmsReminderRefToReminder( cms_reminder_ref *rems, - Reminder_4 **r4)); + Reminder_4 **r4); -extern CSA_return_code _DtCmsV4ReminderToReminderRef P(( +extern CSA_return_code _DtCmsV4ReminderToReminderRef( char *calname, Reminder_4 *r4, _DtCmsEntryId *ids, - cms_reminder_ref **rems)); + cms_reminder_ref **rems); -extern CSA_return_code _DtCmsCmsAccessToV4Access P(( +extern CSA_return_code _DtCmsCmsAccessToV4Access( cms_access_entry *alist, - Access_Entry_4 **a4)); + Access_Entry_4 **a4); -extern CSA_return_code _DtCmsAppt4ToCmsentriesForClient P(( +extern CSA_return_code _DtCmsAppt4ToCmsentriesForClient( char *calname, Appt_4 *appt, - cms_entry **e_r)); + cms_entry **e_r); -extern CSA_return_code _DtCmsAppt4ToCmsentry P(( +extern CSA_return_code _DtCmsAppt4ToCmsentry( char *calname, Appt_4 *a4, cms_entry **entry_r, - boolean_t rerule)); + boolean_t rerule); -extern CSA_return_code _DtCmsAttrsToAppt4 P(( +extern CSA_return_code _DtCmsAttrsToAppt4( uint size, cms_attribute *attrs, Appt_4 *appt, - boolean_t check)); + boolean_t check); #endif diff --git a/cde/programs/dtcm/server/cmsentry.h b/cde/programs/dtcm/server/cmsentry.h index 63936eb32..41924b2e7 100644 --- a/cde/programs/dtcm/server/cmsentry.h +++ b/cde/programs/dtcm/server/cmsentry.h @@ -32,23 +32,22 @@ #define _CMSENTRY_H #include -#include "ansi_c.h" #include "nametbl.h" #include "cm.h" #include "csa.h" #include "cmscalendar.h" -extern CSA_return_code _DtCmsMakeHashedEntry P(( +extern CSA_return_code _DtCmsMakeHashedEntry( _DtCmsCalendar *cal, uint num, cms_attribute *attrs, - cms_entry **entry)); + cms_entry **entry); -extern void _DtCmsFreeEntryAttrResItem P((cms_get_entry_attr_res_item *elist)); +extern void _DtCmsFreeEntryAttrResItem(cms_get_entry_attr_res_item *elist); -extern CSA_return_code _DtCmsGetCmsEntryForClient P(( +extern CSA_return_code _DtCmsGetCmsEntryForClient( cms_entry *e, cms_entry **e_r, - boolean_t time_only)); + boolean_t time_only); #endif diff --git a/cde/programs/dtcm/server/cmsmatch.h b/cde/programs/dtcm/server/cmsmatch.h index b24c8eb83..926cd66b5 100644 --- a/cde/programs/dtcm/server/cmsmatch.h +++ b/cde/programs/dtcm/server/cmsmatch.h @@ -32,14 +32,13 @@ #define _CMSMATCH_H #include -#include "ansi_c.h" #include "cm.h" #include "nametbl.h" -extern boolean_t _DtCmsMatchAttributes P(( +extern boolean_t _DtCmsMatchAttributes( cms_entry *entry, uint num_attrs, cms_attribute *attrs, - CSA_enum *ops)); + CSA_enum *ops); #endif diff --git a/cde/programs/dtcm/server/data.h b/cde/programs/dtcm/server/data.h index 23d021c2a..0435fdac5 100644 --- a/cde/programs/dtcm/server/data.h +++ b/cde/programs/dtcm/server/data.h @@ -35,8 +35,6 @@ * Common definition for internal data storage */ -#include "ansi_c.h" - typedef enum { rb_ok = 0, rb_duplicate = 1, diff --git a/cde/programs/dtcm/server/delete.h b/cde/programs/dtcm/server/delete.h index 1bc11d619..a1a38e8c1 100644 --- a/cde/programs/dtcm/server/delete.h +++ b/cde/programs/dtcm/server/delete.h @@ -31,31 +31,30 @@ #ifndef _DELETE_H #define _DELETE_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" -extern CSA_return_code _DtCmsDeleteEntry P(( +extern CSA_return_code _DtCmsDeleteEntry( _DtCmsCalendar *cal, char *sender, uint access, cms_key *key, - cms_entry **entry_r)); + cms_entry **entry_r); -extern CSA_return_code _DtCmsDeleteEntryAndLog P(( +extern CSA_return_code _DtCmsDeleteEntryAndLog( _DtCmsCalendar *cal, char *sender, uint access, cms_key *key, - cms_entry **entry_r)); + cms_entry **entry_r); -extern CSA_return_code _DtCmsDeleteInstancesAndLog P(( +extern CSA_return_code _DtCmsDeleteInstancesAndLog( _DtCmsCalendar *cal, char *sender, uint access, cms_key *key, int scope, cms_entry **newe, - cms_entry **olde)); + cms_entry **olde); #endif diff --git a/cde/programs/dtcm/server/garbage.h b/cde/programs/dtcm/server/garbage.h index dd635b82b..8548e1098 100644 --- a/cde/programs/dtcm/server/garbage.h +++ b/cde/programs/dtcm/server/garbage.h @@ -31,8 +31,6 @@ #ifndef _GARBAGE_H #define _GARBAGE_H -#include "ansi_c.h" - /* ** Housekeeping mechanism to clean up the calendar log file. It copies the ** log file to a backup file, dumps the red/black tree to a temp file, copies @@ -41,8 +39,8 @@ ** The garbage collector runs at midnight every. */ -extern void _DtCmsCollectOne P((_DtCmsCalendar *cal)); -extern CSA_return_code _DtCmsDumpDataV1 P((char *file, _DtCmsCalendar *cal)); -extern CSA_return_code _DtCmsDumpDataV2 P((char *file, _DtCmsCalendar *cal)); +extern void _DtCmsCollectOne(_DtCmsCalendar *cal); +extern CSA_return_code _DtCmsDumpDataV1(char *file, _DtCmsCalendar *cal); +extern CSA_return_code _DtCmsDumpDataV2(char *file, _DtCmsCalendar *cal); #endif diff --git a/cde/programs/dtcm/server/insert.h b/cde/programs/dtcm/server/insert.h index bf1d639aa..b0d28fbcb 100644 --- a/cde/programs/dtcm/server/insert.h +++ b/cde/programs/dtcm/server/insert.h @@ -31,16 +31,15 @@ #ifndef _INSERT_H #define _INSERT_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" -extern CSA_return_code _DtCmsInsertEntry P(( +extern CSA_return_code _DtCmsInsertEntry( _DtCmsCalendar *cal, - cms_entry *entry)); + cms_entry *entry); -extern CSA_return_code _DtCmsInsertEntryAndLog P(( +extern CSA_return_code _DtCmsInsertEntryAndLog( _DtCmsCalendar *cal, - cms_entry *entry)); + cms_entry *entry); #endif diff --git a/cde/programs/dtcm/server/lexer.h b/cde/programs/dtcm/server/lexer.h index 932cbf67b..e9866cb21 100644 --- a/cde/programs/dtcm/server/lexer.h +++ b/cde/programs/dtcm/server/lexer.h @@ -31,7 +31,6 @@ #ifndef _LEXER_H #define _LEXER_H -#include "ansi_c.h" #include "rtable4.h" extern int yyylineno; @@ -42,7 +41,7 @@ extern Tag_4 externTag; extern Appt_Status_4 externApptStatus; extern Privacy_Level_4 externPrivacy; -extern void setinput P((FILE*)); -extern int yyylex P(()); +extern void setinput(FILE*); +extern int yyylex(void); #endif diff --git a/cde/programs/dtcm/server/lexit.c b/cde/programs/dtcm/server/lexit.c index afd6c6e43..ebe2653c6 100644 --- a/cde/programs/dtcm/server/lexit.c +++ b/cde/programs/dtcm/server/lexit.c @@ -46,7 +46,6 @@ #include "rtable4.h" #include "parser.h" -#include "ansi_c.h" extern char *pgname; int yyylineno; @@ -58,8 +57,8 @@ Appt_Status_4 externApptStatus; Tag_4 externTag; Privacy_Level_4 externPrivacy; -static int hash_string P((char *)); -static char *strescapes P((char *)); +static int hash_string(char *); +static char *strescapes(char *); static int len; static caddr_t start_of_mmapped_area; diff --git a/cde/programs/dtcm/server/list.h b/cde/programs/dtcm/server/list.h index 899a0032f..66e9d817c 100644 --- a/cde/programs/dtcm/server/list.h +++ b/cde/programs/dtcm/server/list.h @@ -31,7 +31,6 @@ #ifndef _LIST_H #define _LIST_H -#include "ansi_c.h" #include "data.h" #include "rerule.h" @@ -49,28 +48,28 @@ typedef struct { caddr_t private; /* for internal tool state */ } Hc_list; -typedef int(*Destroy_proc)P((caddr_t)); +typedef int(*Destroy_proc)(caddr_t); #define hc_lookup_next(p_node) (p_node)->rlink #define hc_lookup_previous(p_node) (p_node)->llink -extern Rb_Status hc_check_list P((Hc_list*)); -extern Hc_list* hc_create P((_DtCmsGetKeyProc, _DtCmsCompareProc)); -extern List_node *hc_delete P((Hc_list*, caddr_t key)); -extern List_node *hc_delete_node P((Hc_list*, List_node*)); -extern void hc_destroy P((Hc_list*, Destroy_proc)); -extern void hc_enumerate_down P((Hc_list*, _DtCmsEnumerateProc)); -extern Rb_Status hc_enumerate_up P((Hc_list*, _DtCmsEnumerateProc)); -extern Rb_Status hc_insert P((Hc_list*, caddr_t data, caddr_t key, - RepeatEvent *re, List_node **node_r)); -extern caddr_t hc_lookup P((Hc_list*, caddr_t key)); -extern caddr_t hc_lookup_largest P((Hc_list*)); -extern caddr_t hc_lookup_next_larger P((Hc_list*, caddr_t key)); -extern caddr_t hc_lookup_next_smaller P((Hc_list*, caddr_t key)); -extern caddr_t hc_lookup_smallest P((Hc_list*)); -extern int hc_size P((Hc_list*)); -extern List_node *hc_lookup_node P((Hc_list*, caddr_t key)); -extern Hc_list* hc_create P((_DtCmsGetKeyProc, _DtCmsCompareProc)); -extern Rb_Status hc_insert_node P((Hc_list *, List_node *, caddr_t key)); +extern Rb_Status hc_check_list(Hc_list*); +extern Hc_list* hc_create(_DtCmsGetKeyProc, _DtCmsCompareProc); +extern List_node *hc_delete(Hc_list*, caddr_t key); +extern List_node *hc_delete_node(Hc_list*, List_node*); +extern void hc_destroy(Hc_list*, Destroy_proc); +extern void hc_enumerate_down(Hc_list*, _DtCmsEnumerateProc); +extern Rb_Status hc_enumerate_up(Hc_list*, _DtCmsEnumerateProc); +extern Rb_Status hc_insert(Hc_list*, caddr_t data, caddr_t key, + RepeatEvent *re, List_node **node_r); +extern caddr_t hc_lookup(Hc_list*, caddr_t key); +extern caddr_t hc_lookup_largest(Hc_list*); +extern caddr_t hc_lookup_next_larger(Hc_list*, caddr_t key); +extern caddr_t hc_lookup_next_smaller(Hc_list*, caddr_t key); +extern caddr_t hc_lookup_smallest(Hc_list*); +extern int hc_size(Hc_list*); +extern List_node *hc_lookup_node(Hc_list*, caddr_t key); +extern Hc_list* hc_create(_DtCmsGetKeyProc, _DtCmsCompareProc); +extern Rb_Status hc_insert_node(Hc_list *, List_node *, caddr_t key); #endif diff --git a/cde/programs/dtcm/server/log.h b/cde/programs/dtcm/server/log.h index db7a84a29..3eef53839 100644 --- a/cde/programs/dtcm/server/log.h +++ b/cde/programs/dtcm/server/log.h @@ -31,7 +31,6 @@ #ifndef _LOG_H #define _LOG_H -#include "ansi_c.h" #include "cm.h" #include "rtable4.h" @@ -48,63 +47,63 @@ typedef enum { _DtCmsLogAdd, _DtCmsLogRemove } _DtCmsLogOps; -extern CSA_return_code _DtCmsAppendAppt4ByFN P((char*, Appt_4*, _DtCmsLogOps)); -extern CSA_return_code _DtCmsAppendAppt4ByFD P((int, Appt_4*, _DtCmsLogOps)); +extern CSA_return_code _DtCmsAppendAppt4ByFN(char*, Appt_4*, _DtCmsLogOps); +extern CSA_return_code _DtCmsAppendAppt4ByFD(int, Appt_4*, _DtCmsLogOps); -extern CSA_return_code _DtCmsAppendCalAttrsByFN P((char *file, +extern CSA_return_code _DtCmsAppendCalAttrsByFN(char *file, int size, - cms_attribute * attrs)); -extern CSA_return_code _DtCmsAppendCalAttrsByFD P((int f, + cms_attribute * attrs); +extern CSA_return_code _DtCmsAppendCalAttrsByFD(int f, int size, - cms_attribute * attrs)); + cms_attribute * attrs); -extern CSA_return_code _DtCmsAppendEntryByFN P((char *, +extern CSA_return_code _DtCmsAppendEntryByFN(char *, cms_entry *, - _DtCmsLogOps)); -extern CSA_return_code _DtCmsAppendEntryByFD P((int, + _DtCmsLogOps); +extern CSA_return_code _DtCmsAppendEntryByFD(int, cms_entry *, - _DtCmsLogOps)); + _DtCmsLogOps); -extern CSA_return_code _DtCmsAppendHTableByFN P((char *file, +extern CSA_return_code _DtCmsAppendHTableByFN(char *file, uint size, char **names, - int *types)); + int *types); -extern CSA_return_code _DtCmsAppendHTableByFD P((int fd, +extern CSA_return_code _DtCmsAppendHTableByFD(int fd, uint size, char **names, - int *types)); + int *types); -extern CSA_return_code _DtCmsAppendAccessByFN P((char*, +extern CSA_return_code _DtCmsAppendAccessByFN(char*, int, - Access_Entry_4 *)); -extern CSA_return_code _DtCmsAppendAccessByFD P((int, int, Access_Entry_4 *)); + Access_Entry_4 *); +extern CSA_return_code _DtCmsAppendAccessByFD(int, int, Access_Entry_4 *); -extern CSA_return_code _DtCmsCreateLogV1 P((char*, char *)); +extern CSA_return_code _DtCmsCreateLogV1(char*, char *); -extern CSA_return_code _DtCmsCreateLogV2 P((char *owner, char *file)); +extern CSA_return_code _DtCmsCreateLogV2(char *owner, char *file); -extern CSA_return_code _DtCmsWriteVersionString P((char *file, int version)); +extern CSA_return_code _DtCmsWriteVersionString(char *file, int version); -extern int _DtCmsSetFileMode P((char *file, +extern int _DtCmsSetFileMode(char *file, uid_t uid, gid_t gid, mode_t mode, boolean_t changeeuid, - boolean_t printerr)); + boolean_t printerr); -extern CSA_return_code _DtCmsRemoveLog P((char *calendar, char *user)); +extern CSA_return_code _DtCmsRemoveLog(char *calendar, char *user); -extern char *_DtCmsGetBakFN P((char*)); -extern char *_DtCmsGetLogFN P((char*)); -extern char *_DtCmsGetTmpFN P((char*)); -extern char *_DtCmsGetDelFN P((char*)); +extern char *_DtCmsGetBakFN(char*); +extern char *_DtCmsGetLogFN(char*); +extern char *_DtCmsGetTmpFN(char*); +extern char *_DtCmsGetDelFN(char*); -extern boolean_t _DtCmsPrintAppt4 P((caddr_t data)); -extern void _DtCmsPrintExceptions P((int len, int *exceptions)); +extern boolean_t _DtCmsPrintAppt4(caddr_t data); +extern void _DtCmsPrintExceptions(int len, int *exceptions); -extern CSA_return_code _DtCmsGetFileSize P((char *calendar, int *size)); +extern CSA_return_code _DtCmsGetFileSize(char *calendar, int *size); -extern void _DtCmsTruncateFile P((char *calendar, int size)); +extern void _DtCmsTruncateFile(char *calendar, int size); #endif diff --git a/cde/programs/dtcm/server/lookup.h b/cde/programs/dtcm/server/lookup.h index b4a1c1e6f..287d6acc4 100644 --- a/cde/programs/dtcm/server/lookup.h +++ b/cde/programs/dtcm/server/lookup.h @@ -31,21 +31,20 @@ #ifndef _LOOKUP_H #define _LOOKUP_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" -extern _DtCmsComparisonResult _DtCmsCompareEntry P(( +extern _DtCmsComparisonResult _DtCmsCompareEntry( cms_key *key, - caddr_t data)); + caddr_t data); -extern _DtCmsComparisonResult _DtCmsCompareRptEntry P(( +extern _DtCmsComparisonResult _DtCmsCompareRptEntry( cms_key *key, - caddr_t data)); + caddr_t data); -extern caddr_t _DtCmsGetEntryKey P((caddr_t data)); +extern caddr_t _DtCmsGetEntryKey(caddr_t data); -extern CSA_return_code _DtCmsLookupEntries P(( +extern CSA_return_code _DtCmsLookupEntries( _DtCmsCalendar *cal, char *sender, uint access, @@ -57,9 +56,9 @@ extern CSA_return_code _DtCmsLookupEntries P(( CSA_uint32 num_attrs, cms_attribute *attrs, CSA_enum *ops, - cms_entry **entries)); + cms_entry **entries); -extern CSA_return_code _DtCmsLookupEntriesById P(( +extern CSA_return_code _DtCmsLookupEntriesById( _DtCmsCalendar *cal, char *sender, uint access, @@ -73,9 +72,9 @@ extern CSA_return_code _DtCmsLookupEntriesById P(( CSA_uint32 num_attrs, cms_attribute *attrs, CSA_enum *ops, - cms_entry **entries)); + cms_entry **entries); -extern CSA_return_code _DtCmsEnumerateSequenceById P(( +extern CSA_return_code _DtCmsEnumerateSequenceById( _DtCmsCalendar *cal, char *sender, uint access, @@ -89,9 +88,9 @@ extern CSA_return_code _DtCmsEnumerateSequenceById P(( CSA_uint32 num_attrs, cms_attribute *attrs, CSA_enum *ops, - cms_entry **entries)); + cms_entry **entries); -extern CSA_return_code _DtCmsLookupEntriesByKey P(( +extern CSA_return_code _DtCmsLookupEntriesByKey( _DtCmsCalendar *cal, char *sender, uint access, @@ -99,10 +98,10 @@ extern CSA_return_code _DtCmsLookupEntriesByKey P(( cms_key *keys, uint num_names, cms_attr_name *names, - cms_get_entry_attr_res_item **res)); + cms_get_entry_attr_res_item **res); -extern CSA_return_code _DtCmsGetEntryAttrByKey P(( +extern CSA_return_code _DtCmsGetEntryAttrByKey( _DtCmsCalendar *cal, char *sender, uint access, @@ -110,6 +109,6 @@ extern CSA_return_code _DtCmsGetEntryAttrByKey P(( uint num_names, cms_attr_name *names, cms_entry **entry_r, - cms_get_entry_attr_res_item **res_r)); + cms_get_entry_attr_res_item **res_r); #endif diff --git a/cde/programs/dtcm/server/reminder.h b/cde/programs/dtcm/server/reminder.h index a6861a489..630fd4286 100644 --- a/cde/programs/dtcm/server/reminder.h +++ b/cde/programs/dtcm/server/reminder.h @@ -31,7 +31,6 @@ #ifndef _REMINDER_H #define _REMINDER_H -#include "ansi_c.h" #include "EUSCompat.h" #include "cm.h" #include "rtable4.h" @@ -71,50 +70,50 @@ typedef struct reminder_q { struct reminder_q *next; } Rm_que; -extern void _DtCmsAddReminderV4 P((Rm_que **qhead, Rm_que *p_reminder)); +extern void _DtCmsAddReminderV4(Rm_que **qhead, Rm_que *p_reminder); -extern Rm_que *_DtCmsRemoveReminderV4 P(( +extern Rm_que *_DtCmsRemoveReminderV4( Rm_que **qhead, Rm_que *p_prev, - Rm_que *p_curr)); + Rm_que *p_curr); -extern Rm_que *build_reminder P(( +extern Rm_que *build_reminder( time_t current_time, Appt_4 *p_appt, Attr_4 p_attr, time_t start_tick, - u_int start_ord)); + u_int start_ord); -extern Reminder_4 *_DtCmsGetReminderInfoV4 P((Rm_que *original)); +extern Reminder_4 *_DtCmsGetReminderInfoV4(Rm_que *original); -extern void _DtCmsPrintReminderListV4 P((Rm_que *qhead)); +extern void _DtCmsPrintReminderListV4(Rm_que *qhead); -extern void _DtCmsObsoleteReminderV4 P(( +extern void _DtCmsObsoleteReminderV4( Rm_que **qhead, Appt_4 *p_appt, int ord, - boolean_t delforward)); + boolean_t delforward); -extern void _DtCmsAddReminders4Entry P(( +extern void _DtCmsAddReminders4Entry( _DtCmsRemQueue **qhead, cms_entry *entry, - List_node *lnode)); + List_node *lnode); -extern void _DtCmsObsoleteReminder4Entry P(( +extern void _DtCmsObsoleteReminder4Entry( _DtCmsRemQueue *qhead, cms_entry *entry, List_node *lnode, time_t starttime, - boolean_t delfwd)); + boolean_t delfwd); -extern CSA_return_code _DtCmsLookupReminder P(( +extern CSA_return_code _DtCmsLookupReminder( _DtCmsRemQueue *remq, time_t tick, uint num_names, cms_attr_name *names, - cms_reminder_ref **rems)); + cms_reminder_ref **rems); -extern void _DtCmsFreeReminderRef P((cms_reminder_ref *rems)); +extern void _DtCmsFreeReminderRef(cms_reminder_ref *rems); extern void _DtCmsUpdateReminders(_DtCmsRemQueue *remq); diff --git a/cde/programs/dtcm/server/repeat.c b/cde/programs/dtcm/server/repeat.c index d86eeb936..ac3b15cae 100644 --- a/cde/programs/dtcm/server/repeat.c +++ b/cde/programs/dtcm/server/repeat.c @@ -814,7 +814,7 @@ next_ndays(time_t t, int n) tm.tm_min = 0; tm.tm_hour = 0; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) next = mktime(&tm); #else next = timelocal(&tm); @@ -1004,7 +1004,7 @@ prev_nmonth(time_t t, int n) tm.tm_mon += 12; tm.tm_year--; } -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; return(mktime(&tm)); #else @@ -1088,7 +1088,7 @@ nextnyear(time_t t, int n) tm = *_XLocaltime(&t, localtime_buf); tm.tm_year += n; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) return(mktime(&tm)); #else return(timelocal(&tm)); @@ -1110,7 +1110,7 @@ prevnyear(time_t t, int n) tm = *_XLocaltime(&t, localtime_buf); tm.tm_year -= n; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) return(mktime(&tm)); #else return(timelocal(&tm)); @@ -1139,7 +1139,7 @@ prevmonth_exactday(time_t t) prev = previousmonth(previousmonth(t)); /* hop over the month */ tm = *_XLocaltime(&prev, localtime_buf); tm.tm_mday = day; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; prev =(mktime(&tm)) + sdelta; #else @@ -1172,7 +1172,7 @@ nextmonth_exactday(time_t t) next = next_nmonth(t, 2); /* hop over the month */ tm = *_XLocaltime(&next, localtime_buf); tm.tm_mday = day; -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; next = mktime(&tm) + sdelta; #else @@ -1201,7 +1201,7 @@ previousmonth(time_t t) tm.tm_mday=1; tm.tm_mon--; } -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm.tm_isdst = -1; return(mktime(&tm)); #else @@ -1513,7 +1513,7 @@ nextnmth_exactday(time_t t, int n) t = next; } -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm2.tm_isdst = -1; next = mktime(&tm2); #else @@ -1549,7 +1549,7 @@ prevnmth_exactday(time_t t, int n) t = prev; } -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) tm2.tm_isdst = -1; prev = mktime(&tm2); #else diff --git a/cde/programs/dtcm/server/repeat.h b/cde/programs/dtcm/server/repeat.h index 6dbcdd8ef..ce50a197f 100644 --- a/cde/programs/dtcm/server/repeat.h +++ b/cde/programs/dtcm/server/repeat.h @@ -32,7 +32,6 @@ #define _REPEAT_H #include -#include "ansi_c.h" #include "cm.h" #include "rtable4.h" #include "rerule.h" @@ -41,45 +40,45 @@ typedef time_t Tick; extern int monthdays[]; -extern void init_time P(()); +extern void init_time(void); -extern time_t _DtCms_closest_tick_v4 P((time_t target, +extern time_t _DtCms_closest_tick_v4(time_t target, time_t ftick, Period_4 period, - int *ordinal)); + int *ordinal); -extern time_t _DtCms_last_tick_v4 P((time_t ftick, +extern time_t _DtCms_last_tick_v4(time_t ftick, Period_4 period, - int ntimes)); + int ntimes); -extern time_t _DtCms_next_tick_v4 P((time_t tick, Period_4 period)); +extern time_t _DtCms_next_tick_v4(time_t tick, Period_4 period); -extern time_t _DtCms_prev_tick_v4 P((time_t tick, Period_4 period)); +extern time_t _DtCms_prev_tick_v4(time_t tick, Period_4 period); -extern time_t _DtCms_first_tick_v4 P((time_t t, Period_4 period, int ordinal)); +extern time_t _DtCms_first_tick_v4(time_t t, Period_4 period, int ordinal); -extern void _DtCms_adjust_appt_startdate P((Appt_4 *appt)); +extern void _DtCms_adjust_appt_startdate(Appt_4 *appt); -extern time_t next_nmins P((time_t t, int m)); +extern time_t next_nmins(time_t t, int m); -extern time_t next_ndays P((time_t t, int n)); +extern time_t next_ndays(time_t t, int n); -extern int _DtCms_marked_4_cancellation P((Appt_4 *a, int i)); +extern int _DtCms_marked_4_cancellation(Appt_4 *a, int i); -extern int _DtCms_get_new_ntimes_v4 P((Period_4 period, +extern int _DtCms_get_new_ntimes_v4(Period_4 period, time_t tick, - int ninstance)); + int ninstance); -extern int _DtCms_get_ninstance_v4 P((Appt_4 *appt)); +extern int _DtCms_get_ninstance_v4(Appt_4 *appt); -extern int _DtCms_in_repeater P((Id_4 *key, +extern int _DtCms_in_repeater(Id_4 *key, Appt_4 *p_appt, - boolean_t dont_care_cancel)); + boolean_t dont_care_cancel); -extern int monthlength P((Tick)); -extern int leapyr P((int)); -extern int fdom P((Tick)); -extern int ldom P((Tick)); +extern int monthlength(Tick); +extern int leapyr(int); +extern int fdom(Tick); +extern int ldom(Tick); /* * returns the tick of the beginning of the day @@ -94,6 +93,6 @@ extern time_t _DtCmsTimeOfDay(time_t t); /* * routines to deal with recurrence rule and exception dates */ -extern boolean_t _DtCmsInExceptionList P((cms_entry *eptr, time_t tick)); +extern boolean_t _DtCmsInExceptionList(cms_entry *eptr, time_t tick); #endif diff --git a/cde/programs/dtcm/server/rpcextras.h b/cde/programs/dtcm/server/rpcextras.h index d0a2c773f..8cc426cc2 100644 --- a/cde/programs/dtcm/server/rpcextras.h +++ b/cde/programs/dtcm/server/rpcextras.h @@ -31,8 +31,6 @@ #ifndef _RPCEXTRAS_H #define _RPCEXTRAS_H -#include "ansi_c.h" - #define RPCGEN_ACTION(routine) routine struct rpcgen_table { @@ -58,7 +56,7 @@ typedef struct prog_object { typedef program_object *program_handle; -extern program_handle newph P(()); -extern program_handle getph P(()); +extern program_handle newph(void); +extern program_handle getph(void); #endif diff --git a/cde/programs/dtcm/server/tree.h b/cde/programs/dtcm/server/tree.h index 7fa1ec0b0..3c439d243 100644 --- a/cde/programs/dtcm/server/tree.h +++ b/cde/programs/dtcm/server/tree.h @@ -31,7 +31,6 @@ #ifndef _TREE_H #define _TREE_H -#include "ansi_c.h" #include "data.h" /* @@ -52,32 +51,32 @@ typedef struct { caddr_t private; /* for internal tool state */ } Rb_tree; -extern Rb_tree* rb_create P((_DtCmsGetKeyProc, _DtCmsCompareProc)); +extern Rb_tree* rb_create(_DtCmsGetKeyProc, _DtCmsCompareProc); -extern void rb_destroy P((Rb_tree*, _DtCmsEnumerateProc)); +extern void rb_destroy(Rb_tree*, _DtCmsEnumerateProc); -extern int rb_size P((Rb_tree*t)); +extern int rb_size(Rb_tree*t); -extern Rb_Status rb_insert P((Rb_tree*, caddr_t data, caddr_t key)); +extern Rb_Status rb_insert(Rb_tree*, caddr_t data, caddr_t key); -extern Rb_Status rb_insert_node P((Rb_tree*, Tree_node*, caddr_t key)); +extern Rb_Status rb_insert_node(Rb_tree*, Tree_node*, caddr_t key); -extern Tree_node * rb_delete P((Rb_tree*, caddr_t key)); +extern Tree_node * rb_delete(Rb_tree*, caddr_t key); -extern caddr_t rb_lookup P((Rb_tree*, caddr_t key)); +extern caddr_t rb_lookup(Rb_tree*, caddr_t key); -extern caddr_t rb_lookup_next_larger P((Rb_tree*, caddr_t key)); +extern caddr_t rb_lookup_next_larger(Rb_tree*, caddr_t key); -extern caddr_t rb_lookup_next_smaller P((Rb_tree*, caddr_t key)); +extern caddr_t rb_lookup_next_smaller(Rb_tree*, caddr_t key); -extern caddr_t rb_lookup_smallest P((Rb_tree*)); +extern caddr_t rb_lookup_smallest(Rb_tree*); -extern caddr_t rb_lookup_largest P((Rb_tree*)); +extern caddr_t rb_lookup_largest(Rb_tree*); -extern Rb_Status rb_enumerate_up P((Rb_tree*, _DtCmsEnumerateProc)); +extern Rb_Status rb_enumerate_up(Rb_tree*, _DtCmsEnumerateProc); -extern void rb_enumerate_down P((Rb_tree*, _DtCmsEnumerateProc)); +extern void rb_enumerate_down(Rb_tree*, _DtCmsEnumerateProc); -extern Rb_Status rb_check_tree P((Rb_tree *)); +extern Rb_Status rb_check_tree(Rb_tree *); #endif diff --git a/cde/programs/dtcm/server/update.h b/cde/programs/dtcm/server/update.h index b68967f1c..587b99d7b 100644 --- a/cde/programs/dtcm/server/update.h +++ b/cde/programs/dtcm/server/update.h @@ -31,16 +31,15 @@ #ifndef _UPDATE_H #define _UPDATE_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" -extern CSA_return_code _DtCmsUpdateCalAttrs P(( +extern CSA_return_code _DtCmsUpdateCalAttrs( _DtCmsCalendar *cal, uint num_attrs, - cms_attribute *attrs)); + cms_attribute *attrs); -extern CSA_return_code _DtCmsUpdateEntry P(( +extern CSA_return_code _DtCmsUpdateEntry( _DtCmsCalendar *cal, char *sender, uint access, @@ -48,9 +47,9 @@ extern CSA_return_code _DtCmsUpdateEntry P(( uint num_attrs, cms_attribute *attrs, cms_entry **oldentry, - cms_entry **newentry)); + cms_entry **newentry); -extern CSA_return_code _DtCmsUpdateInstances P(( +extern CSA_return_code _DtCmsUpdateInstances( _DtCmsCalendar *cal, char *sender, uint access, @@ -59,6 +58,6 @@ extern CSA_return_code _DtCmsUpdateInstances P(( uint num_attrs, cms_attribute *attrs, cms_entry **oldentry, - cms_entry **newentry)); + cms_entry **newentry); #endif diff --git a/cde/programs/dtcm/server/utility.h b/cde/programs/dtcm/server/utility.h index 2daa3a55a..7a6ec47f5 100644 --- a/cde/programs/dtcm/server/utility.h +++ b/cde/programs/dtcm/server/utility.h @@ -31,14 +31,12 @@ #ifndef _UTILITY_H #define _UTILITY_H -#include "ansi_c.h" +extern char *_DtCmsTarget2Name(char *target); -extern char *_DtCmsTarget2Name P((char *target)); +extern char *_DtCmsTarget2Location(char *target); -extern char *_DtCmsTarget2Location P((char *target)); +extern char *_DtCmsTarget2Host(char *target); -extern char *_DtCmsTarget2Host P((char *target)); - -extern char *_DtCmsTarget2Domain P((char *target)); +extern char *_DtCmsTarget2Domain(char *target); #endif diff --git a/cde/programs/dtcm/server/v4ops.h b/cde/programs/dtcm/server/v4ops.h index 91dca8c1c..322982b52 100644 --- a/cde/programs/dtcm/server/v4ops.h +++ b/cde/programs/dtcm/server/v4ops.h @@ -31,7 +31,6 @@ #ifndef _V4OPS_H #define _V4OPS_H -#include "ansi_c.h" #include "rtable4.h" #include "cm.h" #include "log.h" @@ -45,64 +44,64 @@ typedef struct __DtCmsEntryId { struct __DtCmsEntryId *next; } _DtCmsEntryId; -extern CSA_return_code _DtCmsInsertAppt P((_DtCmsCalendar *cal, Appt_4 *appt4)); +extern CSA_return_code _DtCmsInsertAppt(_DtCmsCalendar *cal, Appt_4 *appt4); -extern CSA_return_code _DtCmsDeleteAppt P(( +extern CSA_return_code _DtCmsDeleteAppt( _DtCmsCalendar *cal, char *user, uint access, Id_4 *p_key, - Appt_4 **appt_r)); + Appt_4 **appt_r); -extern CSA_return_code _DtCmsDeleteApptAndLog P(( +extern CSA_return_code _DtCmsDeleteApptAndLog( _DtCmsCalendar *cal, char *user, uint access, Id_4 *key, - Appt_4 **oldappt)); + Appt_4 **oldappt); -extern CSA_return_code _DtCmsDeleteApptInstancesAndLog P(( +extern CSA_return_code _DtCmsDeleteApptInstancesAndLog( _DtCmsCalendar *cal, char *source, uint access, Id_4 *key, Options_4 option, int *remain, - Appt_4 **oldappt)); + Appt_4 **oldappt); -extern CSA_return_code _DtCmsChangeAll P(( +extern CSA_return_code _DtCmsChangeAll( _DtCmsCalendar *cal, char *source, uint access, Id_4 *p_key, Appt_4 *newa, - Appt_4 **oldappt)); + Appt_4 **oldappt); -extern CSA_return_code _DtCmsChangeSome P(( +extern CSA_return_code _DtCmsChangeSome( _DtCmsCalendar *cal, char *source, uint access, Id_4 *p_key, Appt_4 *p_appt, Options_4 option, - Appt_4 **oldappt)); + Appt_4 **oldappt); -extern CSA_return_code _DtCmsInsertApptAndLog P(( +extern CSA_return_code _DtCmsInsertApptAndLog( _DtCmsCalendar *cal, - Appt_4 *appt)); + Appt_4 *appt); -extern _DtCmsComparisonResult _DtCmsCompareAppt P((Id_4 *key, caddr_t data)); +extern _DtCmsComparisonResult _DtCmsCompareAppt(Id_4 *key, caddr_t data); -extern _DtCmsComparisonResult _DtCmsCompareRptAppt P((Id_4 *key, caddr_t data)); +extern _DtCmsComparisonResult _DtCmsCompareRptAppt(Id_4 *key, caddr_t data); -extern caddr_t _DtCmsGetApptKey P((caddr_t data)); +extern caddr_t _DtCmsGetApptKey(caddr_t data); -extern CSA_return_code v4_transact_log P(( +extern CSA_return_code v4_transact_log( char *calendar, Appt_4 *a, - _DtCmsLogOps op)); + _DtCmsLogOps op); -extern CSA_return_code _DtCmsLookupRangeV4 P(( +extern CSA_return_code _DtCmsLookupRangeV4( _DtCmsCalendar *cal, char *user, uint access, @@ -115,9 +114,9 @@ extern CSA_return_code _DtCmsLookupRangeV4 P(( cms_attribute *attrs, CSA_enum *ops, Appt_4 **appt_r, - Abb_Appt_4 **abbr_r)); + Abb_Appt_4 **abbr_r); -extern CSA_return_code _DtCmsLookupKeyrangeV4 P(( +extern CSA_return_code _DtCmsLookupKeyrangeV4( _DtCmsCalendar *cal, char *user, uint access, @@ -133,48 +132,48 @@ extern CSA_return_code _DtCmsLookupKeyrangeV4 P(( cms_attribute *attrs, CSA_enum *ops, Appt_4 **appt_r, - Abb_Appt_4 **abbr_r)); + Abb_Appt_4 **abbr_r); -extern CSA_return_code _AddToLinkedAppts P(( +extern CSA_return_code _AddToLinkedAppts( Appt_4 *p_appt, char *user, uint access, - caddr_t *ilp)); + caddr_t *ilp); -extern CSA_return_code _AddToLinkedAbbrAppts P(( +extern CSA_return_code _AddToLinkedAbbrAppts( Appt_4 *p_appt, char *user, uint access, - caddr_t *ilp)); + caddr_t *ilp); -extern Privacy_Level_4 _GetAccessLevel P(( +extern Privacy_Level_4 _GetAccessLevel( char *user, uint access, - Appt_4 *p_appt)); + Appt_4 *p_appt); -extern Appt_4 * _AddApptInOrder P((Appt_4 * head, Appt_4 * aptr)); +extern Appt_4 * _AddApptInOrder(Appt_4 * head, Appt_4 * aptr); -extern Abb_Appt_4 * _AddAbbApptInOrder P((Abb_Appt_4 *head, Abb_Appt_4 *aptr)); +extern Abb_Appt_4 * _AddAbbApptInOrder(Abb_Appt_4 *head, Abb_Appt_4 *aptr); -extern CSA_return_code _DtCmsSetV4AccessListAndLog P(( +extern CSA_return_code _DtCmsSetV4AccessListAndLog( _DtCmsCalendar *cal, - Access_Entry_4 *alist)); + Access_Entry_4 *alist); -extern CSA_return_code _DtCmsGetV4Reminders P(( +extern CSA_return_code _DtCmsGetV4Reminders( _DtCmsCalendar *cal, long tick, Reminder_4 **rem_r, - _DtCmsEntryId **ids_r)); + _DtCmsEntryId **ids_r); -extern void _DtCmsFreeEntryIds P((_DtCmsEntryId *ids)); +extern void _DtCmsFreeEntryIds(_DtCmsEntryId *ids); -extern CSA_return_code _DtCmsTruncateElist P(( +extern CSA_return_code _DtCmsTruncateElist( Appt_4 *parent_p, int remain, - Except_4 **excpt)); + Except_4 **excpt); -extern CSA_return_code _DtCmsSetV4AccessListInCal P(( +extern CSA_return_code _DtCmsSetV4AccessListInCal( _DtCmsCalendar *cal, - Access_Entry_4 *e)); + Access_Entry_4 *e); #endif diff --git a/cde/programs/dtcm/server/v5ops.h b/cde/programs/dtcm/server/v5ops.h index 11307e1eb..2a2332eb5 100644 --- a/cde/programs/dtcm/server/v5ops.h +++ b/cde/programs/dtcm/server/v5ops.h @@ -31,42 +31,41 @@ #ifndef _V5OPS_H #define _V5OPS_H -#include "ansi_c.h" #include "cm.h" #include "cmscalendar.h" #include "rerule.h" #include "repeat.h" -extern _DtCmsComparisonResult _DtCmsCompareEntry P(( +extern _DtCmsComparisonResult _DtCmsCompareEntry( cms_key *key, - caddr_t data)); + caddr_t data); -extern _DtCmsComparisonResult _DtCmsCompareRptEntry P(( +extern _DtCmsComparisonResult _DtCmsCompareRptEntry( cms_key *key, - caddr_t data)); + caddr_t data); -extern caddr_t _DtCmsGetEntryKey P((caddr_t data)); +extern caddr_t _DtCmsGetEntryKey(caddr_t data); -extern CSA_return_code _DtCmsSetLastUpdate P((cms_entry *entry)); +extern CSA_return_code _DtCmsSetLastUpdate(cms_entry *entry); -extern void _DtCmsConvertToOnetime P((cms_entry *entry, RepeatEvent *re)); +extern void _DtCmsConvertToOnetime(cms_entry *entry, RepeatEvent *re); -extern int _DtCmsGetDuration P((cms_entry *eptr)); +extern int _DtCmsGetDuration(cms_entry *eptr); -extern CSA_return_code _DtCmsCheckInitialAttributes P((cms_entry *entry)); +extern CSA_return_code _DtCmsCheckInitialAttributes(cms_entry *entry); -extern CSA_return_code _DtCmsCheckStartEndTime P((cms_entry *entry)); +extern CSA_return_code _DtCmsCheckStartEndTime(cms_entry *entry); -extern void _DtCmsCleanupExceptionDates P((cms_entry *newe, long ftick)); +extern void _DtCmsCleanupExceptionDates(cms_entry *newe, long ftick); -extern int _DtCmsNumberExceptionDates P((cms_entry *entry)); +extern int _DtCmsNumberExceptionDates(cms_entry *entry); -extern CSA_return_code _DtCmsUpdateDurationInRule P(( +extern CSA_return_code _DtCmsUpdateDurationInRule( cms_entry *entry, - uint remain)); + uint remain); -extern CSA_return_code _DtCmsAddEndDateToRule P(( +extern CSA_return_code _DtCmsAddEndDateToRule( cms_attribute *attr, RepeatEvent *re, - long time)); + long time); #endif diff --git a/cde/programs/dtcreate/dtcreate.h b/cde/programs/dtcreate/dtcreate.h index b5316f5bb..f4f65f0d3 100644 --- a/cde/programs/dtcreate/dtcreate.h +++ b/cde/programs/dtcreate/dtcreate.h @@ -36,14 +36,6 @@ #include #include -#ifndef STORAGECLASS -#ifdef NOEXTERN -#define STORAGECLASS -#else -#define STORAGECLASS extern -#endif -#endif - /***************************************************************************/ /* */ /* Constant Declarations */ @@ -206,180 +198,145 @@ typedef struct { /* */ /***************************************************************************/ - /*******************************************************************/ - /* Global variables that are not being initialized. */ - /*******************************************************************/ +/*******************************************************************/ +/* Global variables that are not being initialized. */ +/******************************************************************/ -STORAGECLASS ActionData AD; -STORAGECLASS ActionData *pMyCopyAD; -STORAGECLASS char *pszFileToEdit; -STORAGECLASS Cursor watch_cursor; -STORAGECLASS Widget widEditSource; -STORAGECLASS Boolean bIconEditorDisplayed; -STORAGECLASS nl_catd nlmsg_fd; -STORAGECLASS char *pszExecName; -STORAGECLASS Widget widSelectedIcon; -STORAGECLASS Boolean bLowRes; -STORAGECLASS IconData *IconDataList[ICON_NUMBER]; +extern ActionData AD; +extern ActionData *pMyCopyAD; +extern char *pszFileToEdit; +extern Cursor watch_cursor; +extern Widget widEditSource; +extern Boolean bIconEditorDisplayed; +extern nl_catd nlmsg_fd; +extern char *pszExecName; +extern Widget widSelectedIcon; +extern Boolean bLowRes; +extern IconData *IconDataList[ICON_NUMBER]; - /**********************************************************/ - /* CreateActionAppShell globals. */ - /**********************************************************/ +/**********************************************************/ +/* CreateActionAppShell globals. */ +/**********************************************************/ -STORAGECLASS Widget CreateActionAppShell; -STORAGECLASS Widget ExpertOption; -STORAGECLASS Widget ColorMonoOption; -STORAGECLASS Widget CA_ActionNameTextField; -STORAGECLASS Widget CA_MED_IconGadget; -STORAGECLASS Widget CA_SML_IconGadget; -STORAGECLASS Widget CA_TINY_IconGadget; -STORAGECLASS Widget CA_LRG_IconGadget; -STORAGECLASS Widget CA_DblClkText; -STORAGECLASS Widget XprtOptionForm; -STORAGECLASS Widget CA_XprtActionOpenText; -STORAGECLASS Widget CA_FiletypesList; -STORAGECLASS Widget CA_WindowTypeArea; -STORAGECLASS Widget CA_WindowType; -STORAGECLASS Widget CA_Expand; +extern Widget CreateActionAppShell; +extern Widget ExpertOption; +extern Widget ColorMonoOption; +extern Widget CA_ActionNameTextField; +extern Widget CA_MED_IconGadget; +extern Widget CA_SML_IconGadget; +extern Widget CA_TINY_IconGadget; +extern Widget CA_LRG_IconGadget; +extern Widget CA_DblClkText; +extern Widget XprtOptionForm; +extern Widget CA_XprtActionOpenText; +extern Widget CA_FiletypesList; +extern Widget CA_WindowTypeArea; +extern Widget CA_WindowType; +extern Widget CA_Expand; #if 0 -STORAGECLASS Widget CA_WindowType_OptionMenuShell; -STORAGECLASS Widget CA_WindowType_Pane; +extern Widget CA_WindowType_OptionMenuShell; +extern Widget CA_WindowType_Pane; #endif -STORAGECLASS Widget CA_WinTypeX; -STORAGECLASS Widget CA_WinTypeAutoClose; -STORAGECLASS Widget CA_WinTypeManualClose; -STORAGECLASS Widget CA_WinTypeNoOutput; -STORAGECLASS Widget CA_HelpTextWindow; -STORAGECLASS Widget CA_HelpText; -STORAGECLASS Widget CA_AllFiletypesToggle; -STORAGECLASS Widget CA_FiletypesInListToggle; +extern Widget CA_WinTypeX; +extern Widget CA_WinTypeAutoClose; +extern Widget CA_WinTypeManualClose; +extern Widget CA_WinTypeNoOutput; +extern Widget CA_HelpTextWindow; +extern Widget CA_HelpText; +extern Widget CA_AllFiletypesToggle; +extern Widget CA_FiletypesInListToggle; - /**********************************************************/ - /* AddFiletype globals. */ - /**********************************************************/ +/**********************************************************/ +/* AddFiletype globals. */ +/**********************************************************/ -STORAGECLASS Widget AddFiletype; -STORAGECLASS Widget AF_FileTypeNameTextField; -STORAGECLASS Widget AF_IdCharacteristicsText; -STORAGECLASS Widget AF_IdCharacteristicsEdit; -STORAGECLASS Widget AF_FiletypePrintCmdTextField; -STORAGECLASS Widget AF_OpenCmdText; -STORAGECLASS Widget AF_FiletypeHelpText; -STORAGECLASS Widget AF_MED_IconGadget; -STORAGECLASS Widget AF_TINY_IconGadget; +extern Widget AddFiletype; +extern Widget AF_FileTypeNameTextField; +extern Widget AF_IdCharacteristicsText; +extern Widget AF_IdCharacteristicsEdit; +extern Widget AF_FiletypePrintCmdTextField; +extern Widget AF_OpenCmdText; +extern Widget AF_FiletypeHelpText; +extern Widget AF_MED_IconGadget; +extern Widget AF_TINY_IconGadget; - /**********************************************************/ - /* FileCharacteristics globals */ - /**********************************************************/ +/**********************************************************/ +/* FileCharacteristics globals */ +/**********************************************************/ -STORAGECLASS Widget FileCharacteristics; -STORAGECLASS Widget FC_DirectoryToggle; -STORAGECLASS Widget FC_FileToggle; -STORAGECLASS Widget FC_AndLabel2; -STORAGECLASS Widget FC_ContentsPatternText; -STORAGECLASS Widget FC_StringToggle; -STORAGECLASS Widget FC_ByteToggle; -STORAGECLASS Widget FC_ShortToggle; -STORAGECLASS Widget FC_LongToggle; -STORAGECLASS Widget FC_StartByteTextField; +extern Widget FileCharacteristics; +extern Widget FC_DirectoryToggle; +extern Widget FC_FileToggle; +extern Widget FC_AndLabel2; +extern Widget FC_ContentsPatternText; +extern Widget FC_StringToggle; +extern Widget FC_ByteToggle; +extern Widget FC_ShortToggle; +extern Widget FC_LongToggle; +extern Widget FC_StartByteTextField; /* -STORAGECLASS Widget FC_EndByteTextField; +extern Widget FC_EndByteTextField; */ -STORAGECLASS Widget FC_NameOrPathText; -STORAGECLASS Widget FC_AndLabel1; -extern Widget FC_PermissionForm; -STORAGECLASS Widget FC_ReadToggle; -STORAGECLASS Widget FC_WriteToggle; -STORAGECLASS Widget FC_ExecuteToggle; +extern Widget FC_NameOrPathText; +extern Widget FC_AndLabel1; +extern Widget FC_PermissionForm; +extern Widget FC_ReadToggle; +extern Widget FC_WriteToggle; +extern Widget FC_ExecuteToggle; -STORAGECLASS Widget FC_NamePatternLabel; -STORAGECLASS Widget FC_PermissionLabel; -STORAGECLASS Widget FC_PermissionToggle; -STORAGECLASS Widget FC_ContentsLabel; -STORAGECLASS Widget FC_ContentsBox; -STORAGECLASS Widget FC_TypeRowColumn; -STORAGECLASS Widget FC_StartByteLabel; -STORAGECLASS Widget FC_TypeLabel; -STORAGECLASS Widget FC_ContentsPatternLabel; +extern Widget FC_NamePatternLabel; +extern Widget FC_PermissionLabel; +extern Widget FC_PermissionToggle; +extern Widget FC_ContentsLabel; +extern Widget FC_ContentsBox; +extern Widget FC_TypeRowColumn; +extern Widget FC_StartByteLabel; +extern Widget FC_TypeLabel; +extern Widget FC_ContentsPatternLabel; /* -STORAGECLASS Widget FC_EndByteLabel; +extern Widget FC_EndByteLabel; */ -STORAGECLASS Widget FC_ContentsToggle; -STORAGECLASS Widget FC_NameOrPathToggle; +extern Widget FC_ContentsToggle; +extern Widget FC_NameOrPathToggle; - /**********************************************************/ - /* icon_selection_dialog globals */ - /**********************************************************/ -STORAGECLASS Widget ISD_SelectedIconTextField; +/**********************************************************/ +/* icon_selection_dialog globals */ +/**********************************************************/ +extern Widget ISD_SelectedIconTextField; - /**********************************************************/ - /* Other dialog globals */ - /**********************************************************/ -STORAGECLASS SessionData sessiondata; +/**********************************************************/ +/* Other dialog globals */ +/**********************************************************/ +extern SessionData sessiondata; - /*******************************************************************/ - /* Global variables that are being initialized. */ - /*******************************************************************/ +/*******************************************************************/ +/* Global variables that are being initialized. */ +/*******************************************************************/ -#ifdef NOEXTERN +extern enum icon_size_range filetype_icon_size; +extern int pidIconEditor; +extern Boolean bShowPixmaps; +extern Widget IconSelector; +extern Boolean DbInitDone; +extern Widget OpenFile; +extern Widget Confirmed; +extern Widget QuestionDialog; +extern Widget ErrorDialog; +extern Widget last_action_pushed; +extern Widget last_filetype_pushed; -STORAGECLASS enum icon_size_range action_icon_size = None_Selected; -STORAGECLASS extern enum icon_size_range filetype_icon_size; -STORAGECLASS int pidIconEditor = 0; -STORAGECLASS Boolean bShowPixmaps = TRUE; -STORAGECLASS Widget IconSelector = (Widget)NULL; -STORAGECLASS Boolean DbInitDone = FALSE; -STORAGECLASS Widget OpenFile = (Widget)NULL; -STORAGECLASS Widget Confirmed = (Widget)NULL; -STORAGECLASS Widget QuestionDialog = (Widget)NULL; -STORAGECLASS Widget ErrorDialog = (Widget)NULL; -STORAGECLASS Widget last_action_pushed = (Widget)NULL; -STORAGECLASS Widget last_filetype_pushed = (Widget)NULL; +extern const char *ca_icon_default; +extern const char *ca_full_icon_default; +extern const char *ca_lrg_icon_default; +extern const char *ca_med_icon_default; +extern const char *ca_sml_icon_default; +extern const char *ca_tiny_icon_default; - -STORAGECLASS const char *ca_icon_default = "Dtactn"; -STORAGECLASS const char *ca_full_icon_default = "/usr/dt/appconfig/icons/C/Dtactn"; -STORAGECLASS const char *ca_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.l"; -STORAGECLASS const char *ca_med_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.m"; -STORAGECLASS const char *ca_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.s"; -STORAGECLASS const char *ca_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.t"; - -STORAGECLASS const char *af_icon_default = "Dtdata"; -STORAGECLASS const char *af_full_icon_default = "/usr/dt/appconfig/icons/C/Dtdata"; -STORAGECLASS const char *af_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.l"; -STORAGECLASS const char *af_med_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.m"; -STORAGECLASS const char *af_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.s"; -STORAGECLASS const char *af_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.t"; - -#else /* NOEXTERN */ - -STORAGECLASS enum icon_size_range filetype_icon_size; -STORAGECLASS int pidIconEditor; -STORAGECLASS Boolean bShowPixmaps; -STORAGECLASS Widget IconSelector; -STORAGECLASS Boolean DbInitDone; -STORAGECLASS Widget OpenFile; -STORAGECLASS Widget Confirmed; -STORAGECLASS Widget QuestionDialog; -STORAGECLASS Widget ErrorDialog; -STORAGECLASS Widget last_action_pushed; -STORAGECLASS Widget last_filetype_pushed; - - -STORAGECLASS const char *ca_icon_default; -STORAGECLASS const char *ca_full_icon_default; -STORAGECLASS const char *ca_lrg_icon_default; -STORAGECLASS const char *ca_med_icon_default; -STORAGECLASS const char *ca_sml_icon_default; -STORAGECLASS const char *ca_tiny_icon_default; - -STORAGECLASS const char *af_icon_default; -STORAGECLASS const char *af_full_icon_default; -STORAGECLASS const char *af_lrg_icon_default; -STORAGECLASS const char *af_med_icon_default; -STORAGECLASS const char *af_sml_icon_default; -STORAGECLASS const char *af_tiny_icon_default; - -#endif /* NOEXTERN */ +extern const char *af_icon_default; +extern const char *af_full_icon_default; +extern const char *af_lrg_icon_default; +extern const char *af_med_icon_default; +extern const char *af_sml_icon_default; +extern const char *af_tiny_icon_default; #endif /* _DTCREATE_H_INCLUDED */ diff --git a/cde/programs/dtcreate/main.c b/cde/programs/dtcreate/main.c index fbd49e6ac..0b223cf62 100644 --- a/cde/programs/dtcreate/main.c +++ b/cde/programs/dtcreate/main.c @@ -61,7 +61,6 @@ extern XmWidgetExtData _XmGetWidgetExtData( unsigned char extType) ; #endif /* NeedWidePrototypes */ -#define NOEXTERN #include "dtcreate.h" #include "ca_aux.h" #include "cmnrtns.h" @@ -78,6 +77,146 @@ Tt_message ProcessToolTalkMessage( ); #define NL_CAT_LOCALE 0 #endif +/* Global variables declared in dtcreate.h */ +ActionData AD; +ActionData *pMyCopyAD; +char *pszFileToEdit; +Cursor watch_cursor; +Widget widEditSource; +Boolean bIconEditorDisplayed; +nl_catd nlmsg_fd; +char *pszExecName; +Widget widSelectedIcon; +Boolean bLowRes; +IconData *IconDataList[ICON_NUMBER]; + +/**********************************************************/ +/* CreateActionAppShell globals. */ +/**********************************************************/ + +Widget CreateActionAppShell; +Widget ExpertOption; +Widget ColorMonoOption; +Widget CA_ActionNameTextField; +Widget CA_MED_IconGadget; +Widget CA_SML_IconGadget; +Widget CA_TINY_IconGadget; +Widget CA_LRG_IconGadget; +Widget CA_DblClkText; +Widget XprtOptionForm; +Widget CA_XprtActionOpenText; +Widget CA_FiletypesList; +Widget CA_WindowTypeArea; +Widget CA_WindowType; +Widget CA_Expand; +#if 0 +Widget CA_WindowType_OptionMenuShell; +Widget CA_WindowType_Pane; +#endif +Widget CA_WinTypeX; +Widget CA_WinTypeAutoClose; +Widget CA_WinTypeManualClose; +Widget CA_WinTypeNoOutput; +Widget CA_HelpTextWindow; +Widget CA_HelpText; +Widget CA_AllFiletypesToggle; +Widget CA_FiletypesInListToggle; + +/**********************************************************/ +/* AddFiletype globals. */ +/**********************************************************/ + +Widget AddFiletype; +Widget AF_FileTypeNameTextField; +Widget AF_IdCharacteristicsText; +Widget AF_IdCharacteristicsEdit; +Widget AF_FiletypePrintCmdTextField; +Widget AF_OpenCmdText; +Widget AF_FiletypeHelpText; +Widget AF_MED_IconGadget; +Widget AF_TINY_IconGadget; + +/**********************************************************/ +/* FileCharacteristics globals */ +/**********************************************************/ + +Widget FileCharacteristics; +Widget FC_DirectoryToggle; +Widget FC_FileToggle; +Widget FC_AndLabel2; +Widget FC_ContentsPatternText; +Widget FC_StringToggle; +Widget FC_ByteToggle; +Widget FC_ShortToggle; +Widget FC_LongToggle; +Widget FC_StartByteTextField; +/* +Widget FC_EndByteTextField; +*/ +Widget FC_NameOrPathText; +Widget FC_AndLabel1; +Widget FC_ReadToggle; +Widget FC_WriteToggle; +Widget FC_ExecuteToggle; + +Widget FC_NamePatternLabel; +Widget FC_PermissionLabel; +Widget FC_PermissionToggle; +Widget FC_ContentsLabel; +Widget FC_ContentsBox; +Widget FC_TypeRowColumn; +Widget FC_StartByteLabel; +Widget FC_TypeLabel; +Widget FC_ContentsPatternLabel; +/* +Widget FC_EndByteLabel; +*/ +Widget FC_ContentsToggle; +Widget FC_NameOrPathToggle; + +/**********************************************************/ +/* icon_selection_dialog globals */ +/**********************************************************/ +Widget ISD_SelectedIconTextField; + +/**********************************************************/ +/* Other dialog globals */ +/**********************************************************/ +SessionData sessiondata; + +/*******************************************************************/ +/* Global variables that are being initialized. */ +/*******************************************************************/ + + +enum icon_size_range action_icon_size = None_Selected; +extern enum icon_size_range filetype_icon_size; +int pidIconEditor = 0; +Boolean bShowPixmaps = TRUE; +Widget IconSelector = (Widget)NULL; +Boolean DbInitDone = FALSE; +Widget OpenFile = (Widget)NULL; +Widget Confirmed = (Widget)NULL; +Widget QuestionDialog = (Widget)NULL; +Widget ErrorDialog = (Widget)NULL; +Widget last_action_pushed = (Widget)NULL; +Widget last_filetype_pushed = (Widget)NULL; + +const char *ca_icon_default = "Dtactn"; +const char *ca_full_icon_default = "/usr/dt/appconfig/icons/C/Dtactn"; +const char *ca_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.l"; +const char *ca_med_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.m"; +const char *ca_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.s"; +const char *ca_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtactn.t"; + +const char *af_icon_default = "Dtdata"; +const char *af_full_icon_default = "/usr/dt/appconfig/icons/C/Dtdata"; +const char *af_lrg_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.l"; +const char *af_med_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.m"; +const char *af_sml_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.s"; +const char *af_tiny_icon_default = "/usr/dt/appconfig/icons/C/Dtdata.t"; + + /*---------------------------------------------------- * UxXt.h needs to be included only when compiling a diff --git a/cde/programs/dtdocbook/instant/main.c b/cde/programs/dtdocbook/instant/main.c index a3762bded..8a3f316a0 100644 --- a/cde/programs/dtdocbook/instant/main.c +++ b/cde/programs/dtdocbook/instant/main.c @@ -70,6 +70,7 @@ static char *CopyRt = #include #include #include +#include #include #include #include @@ -89,8 +90,12 @@ static char *CopyRt = /* for backwards compatibility */ #ifndef _MAXNAMLEN +#ifndef MAXNAMLEN +#define _MAXNAMLEN NAME_MAX +#else #define _MAXNAMLEN MAXNAMLEN #endif +#endif static int do_context, do_tree, do_summ, do_stats, do_validate, do_idlist; static char *this_prog; @@ -882,11 +887,13 @@ ReadLocaleStrings(const char *file_name, int *ret_code) { i18nBuf = EscapeI18NChars(pBuf); if (i18nBuf != pBuf) { - free(pBuf); + pBuf = Tcl_Realloc(pBuf, 1 + strlen(i18nBuf)); + strcpy(pBuf, i18nBuf); + free(i18nBuf); } *ret_code = 0; - return i18nBuf; + return pBuf; } static int TclReadLocaleStrings(ClientData clientData, @@ -1093,7 +1100,7 @@ ReadESIS( char *buf, *i18nBuf; int i, c, ncont; Element_t *e; - Content_t cont[5000]; + Content_t cont[5000] = {0}; Malloc( LINESIZE+1, buf, char ); diff --git a/cde/programs/dtinfo/DtMmdb/btree/mmdb_btree.h b/cde/programs/dtinfo/DtMmdb/btree/mmdb_btree.h index 6cc5703ab..49cfef606 100644 --- a/cde/programs/dtinfo/DtMmdb/btree/mmdb_btree.h +++ b/cde/programs/dtinfo/DtMmdb/btree/mmdb_btree.h @@ -54,7 +54,7 @@ #include "storage/unixf_storage.h" #include "dynhash/data_t.h" -#ifdef SVR4 +#if defined(SVR4) || defined(__linux__) #include #include diff --git a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh index 1ee22a51d..5964983ec 100644 --- a/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh +++ b/cde/programs/dtinfo/dtinfo/src/UAS/Base/UAS_SearchZones.hh @@ -24,7 +24,8 @@ #ifndef _UAS_SearchZones_hh_ #define _UAS_SearchZones_hh_ -#include "unistd.h" +#include +#include "config.h" // for u_int #include "UAS_String.hh" diff --git a/cde/programs/dtksh/Imakefile b/cde/programs/dtksh/Imakefile index 8d6c3adcc..b2d6275ba 100644 --- a/cde/programs/dtksh/Imakefile +++ b/cde/programs/dtksh/Imakefile @@ -1,10 +1,42 @@ XCOMM $TOG: Imakefile /main/15 1998/04/07 08:55:29 mgreess $ DESKTOP_VERSION_STRING = DesktopVersionString +#define IHaveSubdirs +#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' + +SUBDIRS = examples + +MakeSubdirs($(SUBDIRS)) + KSH93SRC = ./ksh93 + +SYS_LIBRARIES = -lm $(DYNLIBSYSLIB) $(REGEXSYSLIB) $(ICONVSYSLIB) + +#ifdef LinuxArchitecture +SYS_LIBRARIES = -lm -ldl +#endif + +#ifdef HPArchitecture +EXTRA_DEFINES = -Wl,-E -Wp,-H12000 +SYS_LIBRARIES = -lm -ldld +#endif + +#ifdef RsArchitecture +EXTRA_DEFINES = -D_IBMRPC_ +LOCAL_LDFLAGS = -bE:dtksh.exp +#endif + +#ifdef SunArchitecture +.NO_PARALLEL: + +SYS_LIBRARIES = -lm -lsecdb -lsocket -lnsl +#endif + DEPEND_DEFINES = $(DEPENDDEFINES) -INCLUDES = -I. -I$(KSH93SRC)/include/ast -I$(KSH93SRC)/src/cmd/ksh93/include \ - -I$(KSH93SRC)/src/cmd/ksh93 $(TIRPCINC) +INCLUDES = -I. -I$(KSH93SRC)/include/ast \ + -I$(KSH93SRC)/src/cmd/ksh93 \ + -I$(KSH93SRC)/src/cmd/ksh93/include -I$(KSH93SRC)/src/cmd/ksh93 \ + -I$(KSH93SRC)/src/lib/libast/include $(TIRPCINC) /* DEPLIBS contains the list of library depencies for a client. * LOCAL_LIBRARIES contains the list of libraries on the link line. @@ -20,50 +52,24 @@ DEPLIBS = $(DEPDTHELPLIB) $(DEPDTSVCLIB) $(DEPDTWIDGETLIB) $(DEPDTPRINTLIB) \ $(KSH93SRC)/lib/libast.a LOCAL_LIBRARIES = $(DTHELPLIB) $(DTWIDGETLIB) $(DTSVCLIB) $(DTPRINTLIB) \ $(TTLIB) $(XMLIB) $(XTOOLLIB) $(XLIB) \ - $(KSH93SRC)/lib/libcmd.a $(KSH93SRC)/lib/libast.a + $(KSH93SRC)/lib/libcmd.a $(KSH93SRC)/lib/libast.a \ + $(KSH93SRC)/lib/libdll.a libshell.a -SYS_LIBRARIES = -lm $(DYNLIBSYSLIB) $(REGEXSYSLIB) $(ICONVSYSLIB) - -#ifdef HPArchitecture -EXTRA_DEFINES = -Wl,-E -DHPUX_DYNLIB -Wp,-H12000 -SYS_LIBRARIES = -lm -ldld -#endif - -#ifdef RsArchitecture -EXTRA_DEFINES = -DDYNLIB -D_IBMRPC_ -LOCAL_LDFLAGS = -bE:dtksh.exp -#endif - -#if defined (SunArchitecture) -EXTRA_DEFINES = -DDYNLIB -#endif +EXTRA_DEFINES = -DKSHELL -DSHOPT_RAWONLY '-DAST_VERSION=20111111' EXTRA_INCLUDES = -I$(DTHELPSRC) -I$(DTPRINTSRC) -#ifdef SunArchitecture -.NO_PARALLEL: -#endif +SUIDEXECDEFINES = \ + -DPROFILEPATH=\"$(CDE_CONFIGURATION_TOP)/config/profile\" \ + -DSUIDPROFILEPATH=\"$(CDE_CONFIGURATION_TOP)/config/suid_profile\" \ + -DSUIDEXECPATH=\"$(CDE_INSTALLATION_TOP)/bin/suid_exec\" \ + -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" -DBUILD_DTKSH -#ifdef LinuxArchitecture -SYS_LIBRARIES = -lm -ldl -#endif - -#define IHaveSubdirs -#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)' - -SUBDIRS = examples ksh93 -KSH93OBJ = $(KSH93SRC)/ksh93.o - -MakeSubdirs($(SUBDIRS)) - -KSH93LIBSHELL = $(KSH93SRC)/src/cmd/ksh93/libshell.a +KSH93LIBSHELL = $(KSH93SRC)/lib/libshell.a PROGRAMS = dtksh -SRCS = \ - userinit.c \ - builtins.c \ - widget.c \ +SRCS = widget.c \ dtkcvt.c \ dtkcmds.c \ XtCvtrs.c \ @@ -71,12 +77,12 @@ SRCS = \ xmcmds.c \ xmwidgets.c \ extra.c \ - xmdtksym.c \ findsym.c \ msgs.c OBJS = \ - $(KSH93OBJ) \ + pmain.o \ + init.o \ libshell.a \ widget.o \ dtkcvt.o \ @@ -86,31 +92,28 @@ OBJS = \ xmcmds.o \ xmwidgets.o \ extra.o \ - xmdtksym.o \ findsym.o \ msgs.o \ $(LOCAL_LIBRARIES2) all:: dtksh -$(KSH93SRC)/ksh93.o: - cd $(KSH93SRC); $(MAKE) - -XCOMM -XCOMM Must replace standard ksh tables of builtins and aliases -XCOMM with our augmented versions. -XCOMM - -libshell.a: $(KSH93SLIBSHELL) userinit.o builtins.o +libshell.a: $(KSH93LIBSHELL) init.o $(CP) $(KSH93LIBSHELL) libshell.a; \ - ar d libshell.a userinit.o builtins.o ; \ - $(AR) libshell.a userinit.o builtins.o + ar d libshell.a init.o; \ + $(AR) libshell.a init.o -SpecialObjectRule(userinit.o,$(NULL),-DSHOPT_VSH -DKSHELL -D_TRACE_ ) -SpecialObjectRule(builtins.o,$(NULL),-DSHOPT_VSH -DKSHELL -D_TRACE_ ) +pmain.o: + cd ksh93; ./bin/package flat make CCFLAGS='$(SUIDEXECDEFINES) -g -D_std_malloc' + cp ./ksh93/src/cmd/ksh93/sh/init.c init.c + patch --posix init.c -i init.patch + ./setup.sh + +SpecialObjectRule(init.o, $(NULL), -DSHOPT_STATS -DSHOPT_NAMESPACE -DSHOPT_2DMATCH -DSHOPT_PFSH -DSHOPT_MULTIBYTE -DSHOPT_BGX -DSHOPT_AUDIT '-D_API_ast=20100309' -D_PACKAGE_ast -DSHOPT_DYNAMIC -D_BLD_shell -DSHOPT_KIA -DKSHELL -DSHOPT_HISTEXPAND -DSHOPT_EDPREDICT -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_FIXEDARRAY '-DERROR_CONTEXT_T=Error_context_t' -DSHOPT_SUID_EXEC -DSHOPT_BRACEPAT -DBUILD_DTKSH -l$(KSH93SRC)/lib/libcmd.a -l$(KSH93SRC)/lib/libast.a -l$(KSH93SRC)/lib/libdll.a) ComplexProgramTarget($(PROGRAMS)) clean:: - @echo " Cleaning ksh directories" - $(SHELL) MakeClean + cd ksh93; ./bin/package flat clean + rm -f init.c + rm -rf FEATURE diff --git a/cde/programs/dtksh/MakeClean b/cde/programs/dtksh/MakeClean deleted file mode 100755 index 229299704..000000000 --- a/cde/programs/dtksh/MakeClean +++ /dev/null @@ -1,131 +0,0 @@ -#! /bin/ksh - -echo -find . -name MAM.time -print -exec rm -f {} \; -echo -echo "******************" -echo -find . -name in.log -print -exec rm -f {} \; -echo -echo "******************" -echo -find . -name \*.a -print -exec rm -f {} \; -echo -echo "******************" -echo -find . -name \*.o -print -exec rm -f {} \; -echo -echo "******************" -echo -find . -name BUILT -print -exec rm -f {} \; -echo -echo "******************" -echo -find . -name ERROR -print -exec rm -f {} \; -echo -echo "******************" -echo -echo "rm ksh93/bin/*" -rm -f ksh93/bin/feature -rm -f ksh93/bin/iffe -rm -f ksh93/bin/ignore -rm -f ksh93/bin/pax -rm -f ksh93/bin/bax -rm -f ksh93/bin/pax.save -rm -f ksh93/bin/proto -rm -f ksh93/bin/silent -rm -f ksh93/bin/suid_exec -rm -f ksh93/bin/shcomp -rm -f ksh93/bin/nocom -rm -f ksh93/bin/*.old -echo -echo "rm ksh93/src/cmd/ksh93/suid_exec" -rm -f ksh93/src/cmd/ksh93/suid_exec -echo "rm ksh93/src/cmd/ksh93/shcomp" -rm -f ksh93/src/cmd/ksh93/shcomp -echo "rm ksh93/src/cmd/ksh93/ksh.msg" -rm -f ksh93/src/cmd/ksh93/ksh.msg -echo "rm ksh93/src/cmd/pax/pax" -rm -f ksh93/src/cmd/pax/pax -echo "rm ksh93/src/cmd/pax/bax" -rm -f ksh93/src/cmd/pax/bax -echo "rm ksh93/src/cmd/pax/nocom" -rm -f ksh93/src/cmd/pax/nocom -echo "rm ksh93/src/cmd/pax/cpio" -rm -f ksh93/src/cmd/pax/cpio -echo "rm ksh93/src/cmd/pax/tar" -rm -f ksh93/src/cmd/pax/tar -#echo "rm ksh93/src/lib/libcmd/cmd.h" -#rm -f ksh93/src/lib/libcmd/cmd.h -echo "rm ksh93/src/lib/libcmd/cmd.req" -rm -f ksh93/src/lib/libcmd/cmd.req -echo "rm ksh93/src/cmd/ksh" -rm -f ksh93/src/cmd/ksh -echo "rm ksh93/bin/ksh" -rm -f ksh93/bin/ksh -echo "rm ksh93/ship/shipslog/!t_gryphon_dgk" -rm -f ksh93/ship/shipslog/!t_gryphon_dgk -echo "rm ksh93/ship/shipslog/!t_gryphon_gsf" -rm -f ksh93/ship/shipslog/!t_gryphon_gsf - -echo "rm ksh93/src/cmd/ksh93/FEATURE/*" -rm -f ksh93/src/cmd/ksh93/FEATURE/* -echo "mkdir ksh93/src/cmd/ksh93/FEATURE" -mkdir -p ksh93/src/cmd/ksh93/FEATURE -echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/options" -cp /dev/null ksh93/src/cmd/ksh93/FEATURE/options -echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/setjmp" -cp /dev/null ksh93/src/cmd/ksh93/FEATURE/setjmp -echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/sigfeatures" -cp /dev/null ksh93/src/cmd/ksh93/FEATURE/sigfeatures -echo "cp /dev/null ksh93/src/cmd/ksh93/FEATURE/dynamic" -cp /dev/null ksh93/src/cmd/ksh93/FEATURE/dynamic - -echo "mkdir ksh93/include/ast" -mkdir -p ksh93/include/ast -echo "cp /dev/null ksh93/include/ast/ast.h" -cp /dev/null ksh93/include/ast/ast.h -echo "cp /dev/null ksh93/include/ast/cmd.h" -cp /dev/null ksh93/include/ast/cmd.h -echo "cp /dev/null ksh93/include/ast/error.h" -cp /dev/null ksh93/include/ast/error.h -echo "cp /dev/null ksh93/include/ast/hash.h" -cp /dev/null ksh93/include/ast/hash.h -echo "cp /dev/null ksh93/include/ast/option.h" -cp /dev/null ksh93/include/ast/option.h -echo "cp /dev/null ksh93/include/ast/sfio.h" -cp /dev/null ksh93/include/ast/sfio.h -echo "cp /dev/null ksh93/include/ast/sig.h" -cp /dev/null ksh93/include/ast/sig.h -echo "cp /dev/null ksh93/include/ast/stak.h" -cp /dev/null ksh93/include/ast/stak.h - -echo "rm ksh93/src/cmd/pax/FEATURE/*" -rm -f ksh93/src/cmd/pax/FEATURE/* - -echo "rm ksh93/src/lib/libast/FEATURE/*" -rm -f ksh93/src/lib/libast/FEATURE/* - -echo "rm ksh93/src/lib/libcmd/FEATURE/*" -rm -f ksh93/src/lib/libcmd/FEATURE/* - -echo "rm ksh93/src/lib/libast/*.h" -rm -f ksh93/src/lib/libast/*.h - -echo "rm ksh93/src/lib/libast/conf" -rm -f ksh93/src/lib/libast/conf - -echo "rm ksh93/src/lib/lib0ast/hostinfo" -rm -f ksh93/src/lib/lib0ast/hostinfo - -echo "rm ksh93/src/cmd/ksh93/ksh" -rm -f ksh93/src/cmd/ksh93/ksh - -echo "rm ksh93/ship/SHIP*" -rm -f ksh93/ship/SHIP* - -echo "rm ksh93/ship/shipfeature" -rm -f ksh93/ship/shipfeature - -echo "rm ksh93/ship/shipproto" -rm -f ksh93/ship/shipproto diff --git a/cde/programs/dtksh/README-DEVELOPER b/cde/programs/dtksh/README-DEVELOPER index 10ce00e64..7fd3707f4 100644 --- a/cde/programs/dtksh/README-DEVELOPER +++ b/cde/programs/dtksh/README-DEVELOPER @@ -1,5 +1,12 @@ /* $XConsortium: README-DEVELOPER /main/3 1996/07/15 14:12:13 drk $ */ +(NOTE: As of CDE 2.3.1 and later, this entire document is obsolete and only kept + for historical purposes, the updating process has been streamlined to a simple + two step process: + 1. cd ksh93; git pull + 2. Merge upstream init.c with ours, keeping all of our changes. + and thats all there is to it.) + IMPORTANT!!! PLEASE READ ON!! ------------------------------ diff --git a/cde/programs/dtksh/XtCvtrs.c b/cde/programs/dtksh/XtCvtrs.c index 570b9586e..7b4292fca 100644 --- a/cde/programs/dtksh/XtCvtrs.c +++ b/cde/programs/dtksh/XtCvtrs.c @@ -49,11 +49,11 @@ SOFTWARE. /* Conversion.c - implementations of resource type conversion procs */ +#include #include #include #include #include -#include "stdio.h" #include #include #include "msgs.h" @@ -149,7 +149,7 @@ DtkshCvtStringToPixel( { char * errbuf; - errmsg = GETMESSAGE(1, 1, + errmsg = GETMESSAGE( "DtkshCvtStringToPixel: The color '%s' is not defined"); errbuf = XtMalloc(strlen(errmsg) + strlen(str) + 10); sprintf(errbuf, errmsg, str); diff --git a/cde/programs/dtksh/builtins.c b/cde/programs/dtksh/builtins.c deleted file mode 100644 index b2683d90a..000000000 --- a/cde/programs/dtksh/builtins.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: builtins.c /main/3 1995/11/01 15:50:47 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1994 AT&T Bell Laboratories * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* dgk@research.att.com * -* David Korn 908-582-7975 * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#line 1 - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif - -#line 3 -#define mount _AST_mount -#include -#include -#include "shtable.h" -#include "name.h" -#ifdef KSHELL -# include "builtins.h" -# include "jobs.h" -# include "FEATURE/cmds" -#if defined(__STDC__) || defined(__STDPP__) -# define bltin(x) (b_##x) -#else -# define bltin(x) (b_/**/x) -#endif - -#line 13 -#else -# define bltin(x) 0 -#endif - -#include -#include -#include -#define NO_AST -#include "dtksh.h" -#undef NO_AST -#include "dtextra.h" -#include "xmextra.h" -#include "msgs.h" - - -/* - * The order up through "[" is significant - */ -const struct shtable3 shtab_builtins[] = -{ - "login", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(login), - "exec", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(exec), - "set", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(set), - ":", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(true), - "true", NV_BLTIN|BLT_ENV, bltin(true), - "command", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(command), - "cd", NV_BLTIN|BLT_ENV, bltin(cd), - "break", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(brk_cont), - "continue", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(brk_cont), - "typeset", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(typeset), - "test", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(test), - "[", NV_BLTIN|BLT_ENV, bltin(test), -#ifdef _bin_newgrp - "newgrp", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(login), -#endif /* _bin_newgrp */ - ".", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(dot_cmd), - "alias", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(alias), - "hash", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(alias), - "exit", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(ret_exit), - "export", NV_BLTIN|BLT_SPC|BLT_DCL, bltin(read_export), - "eval", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_EXIT,bltin(eval), - "fc", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(hist), - "hist", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(hist), - "readonly", NV_BLTIN|BLT_ENV|BLT_SPC|BLT_DCL,bltin(read_export), - "return", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(ret_exit), - "shift", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(shift), - "trap", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(trap), - "unalias", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(unalias), - "unset", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(unset), - "builtin", NV_BLTIN, bltin(builtin), -#ifdef SHOPT_ECHOPRINT - "echo", NV_BLTIN|BLT_ENV, bltin(print), -#else - "echo", NV_BLTIN|BLT_ENV, bltin(echo), -#endif /* SHOPT_ECHOPRINT */ -#ifdef JOBS -# ifdef SIGTSTP - "bg", NV_BLTIN|BLT_ENV, bltin(bg_fg), - "fg", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(bg_fg), - "disown", NV_BLTIN|BLT_ENV, bltin(bg_fg), - "kill", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(kill), -# else - "/bin/kill", NV_BLTIN|BLT_ENV|NV_NOFREE, bltin(kill), -# endif /* SIGTSTP */ - "jobs", NV_BLTIN|BLT_ENV, bltin(jobs), -#endif /* JOBS */ - "false", NV_BLTIN|BLT_ENV, bltin(false), - "getconf", NV_BLTIN|BLT_ENV, bltin(getconf), - "getopts", NV_BLTIN|BLT_ENV, bltin(getopts), - "let", NV_BLTIN|BLT_ENV, bltin(let), - "print", NV_BLTIN|BLT_ENV, bltin(print), - "printf", NV_BLTIN|NV_NOFREE, bltin(printf), - "pwd", NV_BLTIN|NV_NOFREE, bltin(pwd), - "read", NV_BLTIN|BLT_ENV, bltin(read), - "sleep", NV_BLTIN|NV_NOFREE, bltin(sleep), - "alarm", NV_BLTIN, bltin(alarm), - "ulimit", NV_BLTIN|BLT_ENV, bltin(ulimit), - "umask", NV_BLTIN|BLT_ENV, bltin(umask), -#ifdef _cmd_universe - "universe", NV_BLTIN|BLT_ENV, bltin(universe), -#endif /* _cmd_universe */ -#ifdef SHOPT_FS_3D - "vpath", NV_BLTIN|BLT_ENV, bltin(vpath_map), - "vmap", NV_BLTIN|BLT_ENV, bltin(vpath_map), -#endif /* SHOPT_FS_3D */ - "wait", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(wait), - "type", NV_BLTIN|BLT_ENV, bltin(whence), - "whence", NV_BLTIN|BLT_ENV, bltin(whence), - "/bin/basename",NV_BLTIN|NV_NOFREE, bltin(basename), - "/bin/chmod", NV_BLTIN|NV_NOFREE, bltin(chmod), - "/bin/dirname", NV_BLTIN|NV_NOFREE, bltin(dirname), - "/bin/head", NV_BLTIN|NV_NOFREE, bltin(head), - "/bin/mkdir", NV_BLTIN|NV_NOFREE, bltin(mkdir), -#if defined(_usr_bin_logname) && !defined(_bin_logname) - "/usr/bin/logname", NV_BLTIN|NV_NOFREE, bltin(logname), -#else - "/bin/logname", NV_BLTIN|NV_NOFREE, bltin(logname), -#endif - "/bin/cat", NV_BLTIN|NV_NOFREE, bltin(cat), - "/bin/cmp", NV_BLTIN|NV_NOFREE, bltin(cmp), -#if defined(_usr_bin_cut) && !defined(_bin_cut) - "/usr/bin/cut", NV_BLTIN|NV_NOFREE, bltin(cut), -#else - "/bin/cut", NV_BLTIN|NV_NOFREE, bltin(cut), -#endif - "/bin/uname", NV_BLTIN|NV_NOFREE, bltin(uname), -#if defined(_usr_bin_wc) && !defined(_bin_wc) - "/usr/bin/wc", NV_BLTIN|NV_NOFREE, bltin(wc), -#else -# if defined(_usr_ucb_wc) && !defined(_bin_wc) - "/usr/ucb/wc", NV_BLTIN|NV_NOFREE, bltin(wc), -# else - "/bin/wc", NV_BLTIN|NV_NOFREE, bltin(wc), -# endif -#endif -DTK_EXTRA_TABLE -DTK_EXTRA_TABLE2 -DTK_TK_EXTRA_TABLE -DTK_TK_LIST_TABLE -DTK_TK_TEXT_TABLE - "", 0, 0 -}; - -const char sh_optalarm[] = "r [varname seconds]"; -const char sh_optalias[] = "ptx [name=[value]...]"; -const char sh_optbuiltin[] = "dsf:[library] [name...]"; -const char sh_optcd[] = "LP [dir] [change]"; -const char sh_optcflow[] = " [n]"; -const char sh_optcommand[] = "pvV name [arg]..."; -const char sh_optdot[] = " name [arg...]"; -#ifndef ECHOPRINT - const char sh_optecho[] = " [-n] [arg...]"; -#endif /* !ECHOPRINT */ -const char sh_opteval[] = " [arg...]"; -const char sh_optexec[] = "a:[name]c [command [args...] ]"; -const char sh_optexport[] = "p [name[=value]...]"; -const char sh_optgetopts[] = ":a:[name] optstring name [args...]"; -const char sh_optgetconf[] = " [name [pathname] ]"; -const char sh_optjoblist[] = " [job...]"; -const char sh_opthist[] = "e:[editor]lnrsN# [first] [last]"; -const char sh_optjobs[] = "nlp [job...]"; -const char sh_optkill[] = "ln#[signum]s:[signame] sig..."; -const char sh_optlet[] = " expr..."; -const char sh_optprint[] = "f:[format]enprsu:[filenum] [arg...]"; -const char sh_optprintf[] = " format [arg...]"; -const char sh_optpwd[] = "LP"; -const char sh_optread[] = "Ad:[delim]prst#[timeout]u#[filenum] [name...]"; -#ifdef SHOPT_KIA - const char sh_optksh[] = "+DircabefhkmnpstuvxCR:[file]o:?[option] [arg...]"; - const char sh_optset[] = "+abefhkmnpstuvxCR:[file]o:?[option]A:[name] [arg...]"; -#else - const char sh_optksh[] = "+DircabefhkmnpstuvxCo:?[option] [arg...]"; - const char sh_optset[] = "+abefhkmnpstuvxCo:?[option]A:[name] [arg...]"; -#endif /* SHOPT_KIA */ -const char sh_optsleep[] = " seconds"; -const char sh_opttrap[] = "p [action condition...]"; -#ifdef SHOPT_OO - const char sh_opttypeset[] = "+AC:E#?F#?H:[name]L#?R#?Z#?fi#?[base]lnprtux [name=[value]...]"; -#else - const char sh_opttypeset[] = "+AE#?F#?HL#?R#?Z#?fi#?[base]lnprtux [name=[value]...]"; -#endif /* SHOPT_OO */ -const char sh_optulimit[] = "HSacdfmnstv [limit]"; -const char sh_optumask[] = "S [mask]"; -const char sh_optuniverse[] = " [name]"; -const char sh_optunset[] = "fnv name..."; -const char sh_optunalias[] = "a name..."; -#ifdef SHOPT_FS_3D - const char sh_optvpath[] = " [top] [base]"; - const char sh_optvmap[] = " [dir] [list]"; -#endif /* SHOPT_FS_3D */ -const char sh_optwhence[] = "afpv name..."; - - - -const char e_alrm1[] = "alarm -r %s +%.3g\n"; -const char e_alrm2[] = "alarm %s %.3f\n"; -const char e_badfun[] = "%s: illegal function name"; -const char e_baddisc[] = "%s: invalid discipline function"; -const char e_nospace[] = "out of memory"; -const char e_nofork[] = "cannot fork"; -const char e_nosignal[] = "%s: unknown signal name"; -const char e_numeric[] = "*([0-9])?(.)*([0-9])"; -const char e_condition[] = "condition(s) required"; -const char e_cneedsarg[] = "-c requires argument"; diff --git a/cde/programs/dtksh/dtextra.h b/cde/programs/dtksh/dtextra.h deleted file mode 100644 index dc187c8b3..000000000 --- a/cde/programs/dtksh/dtextra.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: dtextra.h /main/3 1995/11/01 15:51:46 rswiston $ */ -/* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */ -/* All Rights Reserved */ - -/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */ -/* UNIX System Laboratories, Inc. */ -/* The copyright notice above does not evidence any */ -/* actual or intended publication of such source code. */ - -#ifndef _Dtksh_dtextra_h -#define _Dtksh_dtextra_h - -#include "widget.h" -#include "dtkcmds.h" -#include "xmcmds.h" - -/* - * CDExc17788 - * - * The following corrects for a type-mismatch throughout the following - * functions with the element in the table into which they are to be - * inserted. - */ - -#if defined(bltin) && ( defined(__STDC__) || defined(__STDPP__) ) -#define lcl_cast(x) ((int (*)__PROTO__((int, char*[], __V_*)))x) -#else -#define lcl_cast(x) x -#endif - -#define DTK_EXTRA_TABLE \ - { "DtLoadWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_DtLoadWidget) }, \ - { "DtWidgetInfo", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWidgetInfo) }, \ - { "XBell", NV_BLTIN|BLT_ENV, lcl_cast(do_XBell) }, \ - { "XRootWindowOfScreen", NV_BLTIN|BLT_ENV, lcl_cast(do_XRootWindowOfScreen) }, \ - { "XWidthOfScreen", NV_BLTIN|BLT_ENV, lcl_cast(do_XWidthOfScreen) }, \ - { "XHeightOfScreen", NV_BLTIN|BLT_ENV, lcl_cast(do_XHeightOfScreen) }, \ - { "XDefineCursor", NV_BLTIN|BLT_ENV, lcl_cast(do_XDefineCursor) }, \ - { "XUndefineCursor", NV_BLTIN|BLT_ENV, lcl_cast(do_XUndefineCursor) }, \ - { "XFlush", NV_BLTIN|BLT_ENV, lcl_cast(do_XFlush) }, \ - { "XSync", NV_BLTIN|BLT_ENV, lcl_cast(do_XSync) }, \ - { "XRaiseWindow", NV_BLTIN|BLT_ENV, lcl_cast(do_XRaiseWindow) }, \ - { "XtInitialize", NV_BLTIN|BLT_ENV, lcl_cast(do_XtInitialize) }, \ - { "XtIsSensitive", NV_BLTIN|BLT_ENV, lcl_cast(do_XtIsSensitive) }, \ - { "XtIsShell", NV_BLTIN|BLT_ENV, lcl_cast(do_XtIsShell) }, \ - { "XtIsRealized", NV_BLTIN|BLT_ENV, lcl_cast(do_XtIsRealized) }, \ - { "XtIsManaged", NV_BLTIN|BLT_ENV, lcl_cast(do_XtIsManaged) }, \ - { "XtCreateManagedWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtCreateManagedWidget) }, \ - { "XtCreateApplicationShell", NV_BLTIN|BLT_ENV, lcl_cast(do_XtCreateApplicationShell) }, \ - { "XtCreateWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtCreateWidget) }, \ - { "XtDestroyWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtDestroyWidget) }, \ - { "XtSetValues", NV_BLTIN|BLT_ENV, lcl_cast(do_XtSetValues) }, \ - { "XtSetSensitive", NV_BLTIN|BLT_ENV, lcl_cast(do_XtSetSensitive) }, \ - { "XtAugmentTranslations", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAugmentTranslations) }, \ - { "XtOverrideTranslations", NV_BLTIN|BLT_ENV, lcl_cast(do_XtOverrideTranslations) }, \ - { "XtUninstallTranslations", NV_BLTIN|BLT_ENV, lcl_cast(do_XtUninstallTranslations) }, \ - { "XtAddCallback", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAddCallback) }, \ - { "XtRemoveCallback", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveCallback) }, \ - { "XtRemoveAllCallbacks", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveAllCallbacks) }, \ - { "XtCallCallbacks", NV_BLTIN|BLT_ENV, lcl_cast(do_XtCallCallbacks) }, \ - { "XtHasCallbacks", NV_BLTIN|BLT_ENV, lcl_cast(do_XtHasCallbacks) }, \ - { "XtAddEventHandler", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAddEventHandler) }, \ - { "XtRemoveEventHandler", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveEventHandler) }, \ - { "XtGetValues", NV_BLTIN|BLT_ENV, lcl_cast(do_XtGetValues) }, \ - { "XtCreatePopupShell", NV_BLTIN|BLT_ENV, lcl_cast(do_XtCreatePopupShell) }, \ - { "XtPopup", NV_BLTIN|BLT_ENV, lcl_cast(do_XtPopup) }, \ - { "XtPopdown", NV_BLTIN|BLT_ENV, lcl_cast(do_XtPopdown) }, \ - { "XtMapWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtMapWidget) }, \ - { "XtUnmapWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtUnmapWidget) }, \ - { "XtManageChild", NV_BLTIN|BLT_ENV, lcl_cast(do_XtManageChildren) }, \ - { "XtManageChildren", NV_BLTIN|BLT_ENV, lcl_cast(do_XtManageChildren) }, \ - { "XtIsSubclass", NV_BLTIN|BLT_ENV, lcl_cast(do_XtIsSubclass) }, \ - { "XtClass", NV_BLTIN|BLT_ENV, lcl_cast(do_XtClass) }, \ - { "XtUnmanageChild", NV_BLTIN|BLT_ENV, lcl_cast(do_XtUnmanageChildren) }, \ - { "XtUnmanageChildren", NV_BLTIN|BLT_ENV, lcl_cast(do_XtUnmanageChildren) }, \ - { "XtAddTimeOut", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAddTimeOut) }, \ - { "XtRemoveTimeOut", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveTimeOut) }, \ - { "XtAddInput", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAddInput) }, \ - { "XtRemoveInput", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveInput) }, \ - { "XtAddWorkProc", NV_BLTIN|BLT_ENV, lcl_cast(do_XtAddWorkProc) }, \ - { "XtRemoveWorkProc", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRemoveWorkProc) }, \ - { "XtRealizeWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtRealizeWidget) }, \ - { "XtUnrealizeWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtUnrealizeWidget) }, \ - { "DtSessionRestorePath", NV_BLTIN|BLT_ENV, lcl_cast(do_DtSessionRestorePath) }, \ - { "DtSessionSavePath", NV_BLTIN|BLT_ENV, lcl_cast(do_DtSessionSavePath) }, \ - { "DtShellIsIconified", NV_BLTIN|BLT_ENV, lcl_cast(do_DtShellIsIconified) }, \ - { "DtSetStartupCommand", NV_BLTIN|BLT_ENV, lcl_cast(do_DtSetStartupCommand) }, \ - { "DtSetIconifyHint", NV_BLTIN|BLT_ENV, lcl_cast(do_DtSetIconifyHint) }, \ - { "DtWsmAddWorkspaceFunctions", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmAddWorkspaceFunctions) }, \ - { "DtWsmRemoveWorkspaceFunctions", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmRemoveWorkspaceFunctions) }, \ - { "DtWsmGetCurrentWorkspace", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmGetCurrentWorkspace) }, \ - { "DtWsmSetCurrentWorkspace", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmSetCurrentWorkspace) }, \ - { "DtWsmGetWorkspaceList", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmGetWorkspaceList) }, \ - { "DtWsmGetWorkspacesOccupied", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmGetWorkspacesOccupied) }, \ - { "DtWsmSetWorkspacesOccupied", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmSetWorkspacesOccupied) }, \ - { "DtWsmGetCurrentBackdropWindow", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmGetCurrentBackdropWindow) }, \ - { "DtWsmOccupyAllWorkspaces", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmOccupyAllWorkspaces) }, \ - { "DtGetHourGlassCursor", NV_BLTIN|BLT_ENV, lcl_cast(do__DtGetHourGlassCursor) }, \ - { "DtTurnOnHourGlass", NV_BLTIN|BLT_ENV, lcl_cast(do__DtTurnOnHourGlass) }, \ - { "DtTurnOffHourGlass", NV_BLTIN|BLT_ENV, lcl_cast(do__DtTurnOffHourGlass) }, \ - { "_DtGetHourGlassCursor", NV_BLTIN|BLT_ENV, lcl_cast(do__DtGetHourGlassCursor) }, \ - { "_DtTurnOnHourGlass", NV_BLTIN|BLT_ENV, lcl_cast(do__DtTurnOnHourGlass) }, \ - { "_DtTurnOffHourGlass", NV_BLTIN|BLT_ENV, lcl_cast(do__DtTurnOffHourGlass) }, \ - { "DtWsmAddCurrentWorkspaceCallback", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmAddCurrentWorkspaceCallback) }, \ - { "DtWsmRemoveWorkspaceCallback", NV_BLTIN|BLT_ENV, lcl_cast(do_DtWsmRemoveWorkspaceCallback) }, \ - { "DtDbLoad", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDbLoad) }, \ - { "DtDbReloadNotify", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDbReloadNotify) }, \ - { "DtActionExists", NV_BLTIN|BLT_ENV, lcl_cast(do_DtActionExists) }, \ - { "DtActionLabel", NV_BLTIN|BLT_ENV, lcl_cast(do_DtActionLabel) }, \ - { "DtActionDescription", NV_BLTIN|BLT_ENV, lcl_cast(do_DtActionDescription) }, \ - { "DtActionInvoke", NV_BLTIN|BLT_ENV, lcl_cast(do_DtActionInvoke) }, \ - { "DtDtsLoadDataTypes", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsLoadDataTypes) }, \ - { "DtDtsFileToDataType", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsFileToDataType) }, \ - { "DtDtsFileToAttributeValue", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsFileToAttributeValue) }, \ - { "DtDtsFileToAttributeList", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsFileToAttributeList) }, \ - { "DtDtsDataTypeToAttributeValue", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsDataTypeToAttributeValue) }, \ - { "DtDtsDataTypeToAttributeList", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsDataTypeToAttributeList) }, \ - { "DtDtsFindAttribute", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsFindAttribute) }, \ - { "DtDtsDataTypeNames", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsDataTypeNames) }, \ - { "DtDtsSetDataType", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsSetDataType) }, \ - { "DtDtsDataTypeIsAction", NV_BLTIN|BLT_ENV, lcl_cast(do_DtDtsDataTypeIsAction) }, \ - { "ttdt_open", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_open) }, \ - { "ttdt_close", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_close) }, \ - { "tttk_Xt_input_handler", NV_BLTIN|BLT_ENV, lcl_cast(do_tttk_Xt_input_handler) }, \ - { "ttdt_session_join", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_session_join) }, \ - { "ttdt_session_quit", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_session_quit) }, \ - { "ttdt_file_event", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_file_event) }, \ - { "ttdt_file_join", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_file_join) }, \ - { "ttdt_file_quit", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_file_quit) }, \ - { "ttdt_Get_Modified", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_Get_Modified) }, \ - { "ttdt_Save", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_Save) }, \ - { "ttdt_Revert", NV_BLTIN|BLT_ENV, lcl_cast(do_ttdt_Revert) }, \ - { "tt_error_pointer", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_error_pointer) }, \ - { "tttk_message_destroy", NV_BLTIN|BLT_ENV, lcl_cast(do_tttk_message_destroy) }, \ - { "tttk_message_reject", NV_BLTIN|BLT_ENV, lcl_cast(do_tttk_message_reject) }, \ - { "tttk_message_fail", NV_BLTIN|BLT_ENV, lcl_cast(do_tttk_message_fail) }, \ - { "tt_file_netfile", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_file_netfile) }, \ - { "tt_netfile_file", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_netfile_file) }, \ - { "tt_host_file_netfile", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_host_file_netfile) }, \ - { "tt_host_netfile_file", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_host_netfile_file) }, \ - { "tt_message_reply", NV_BLTIN|BLT_ENV, lcl_cast(do_tt_message_reply) }, - -#define DTK_EXTRA_TABLE2 \ - { "XClearArea", NV_BLTIN|BLT_ENV, lcl_cast(do_XClearArea) }, \ - { "XClearWindow", NV_BLTIN|BLT_ENV, lcl_cast(do_XClearWindow) }, \ - { "XCopyArea", NV_BLTIN|BLT_ENV, lcl_cast(do_XCopyArea) }, \ - { "XDrawArc", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawArc) }, \ - { "XDrawImageString", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawImageString) }, \ - { "XDrawLine", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawLine) }, \ - { "XDrawLines", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawLines) }, \ - { "XDrawPoint", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawPoint) }, \ - { "XDrawPoints", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawPoints) }, \ - { "XDrawRectangle", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawRectangle) }, \ - { "XDrawSegments", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawSegments) }, \ - { "XDrawString", NV_BLTIN|BLT_ENV, lcl_cast(do_XDrawString) }, \ - { "XFillArc", NV_BLTIN|BLT_ENV, lcl_cast(do_XFillArc) }, \ - { "XFillPolygon", NV_BLTIN|BLT_ENV, lcl_cast(do_XFillPolygon) }, \ - { "XFillRectangle", NV_BLTIN|BLT_ENV, lcl_cast(do_XFillRectangle) }, \ - { "XTextWidth", NV_BLTIN|BLT_ENV, lcl_cast(do_XTextWidth) }, \ - { "XtMainLoop", NV_BLTIN, lcl_cast(do_XtMainLoop) }, \ - { "XtDisplay", NV_BLTIN|BLT_ENV, lcl_cast(do_XtDisplay) }, \ - { "XtDisplayOfObject", NV_BLTIN|BLT_ENV, lcl_cast(do_XtDisplayOfObject) }, \ - { "XtNameToWidget", NV_BLTIN|BLT_ENV, lcl_cast(do_XtNameToWidget) }, \ - { "XtScreen", NV_BLTIN|BLT_ENV, lcl_cast(do_XtScreen) }, \ - { "XtWindow", NV_BLTIN|BLT_ENV, lcl_cast(do_XtWindow) }, \ - { "XtParent", NV_BLTIN|BLT_ENV, lcl_cast(do_XtParent) }, \ - { "XtLastTimestampProcessed", NV_BLTIN|BLT_ENV, lcl_cast(do_XtLastTimestampProcessed) }, \ - { "catopen", NV_BLTIN|BLT_ENV, lcl_cast(do_catopen) }, \ - { "catgets", NV_BLTIN|BLT_ENV, lcl_cast(do_catgets) }, \ - { "catclose", NV_BLTIN|BLT_ENV, lcl_cast(do_catclose) }, - -#endif /* _Dtksh_dtextra_h */ -/* DON'T ADD ANYTHING AFTER THIS #endif */ diff --git a/cde/programs/dtksh/dtkcmds.c b/cde/programs/dtksh/dtkcmds.c index b47ee1606..8528e8a29 100644 --- a/cde/programs/dtksh/dtkcmds.c +++ b/cde/programs/dtksh/dtkcmds.c @@ -31,8 +31,8 @@ /* X includes */ -#include "name.h" -#include "shell.h" +#include "name.h" +#include "shell.h" #include #include #include @@ -57,9 +57,8 @@ #include #include "hash.h" #include "stdio.h" -#define NO_AST +#include "defs.h" #include "dtksh.h" -#undef NO_AST #include "xmksh.h" #include "dtkcmds.h" #include "xmcvt.h" @@ -67,6 +66,7 @@ #include "extra.h" #include "xmwidgets.h" #include "msgs.h" +#include "xmcmds.h" #include extern Namval_t *sh_assignok(Namval_t *np,int add); @@ -554,7 +554,7 @@ parse_args( *n = 0; for (i = 0; i < argc; i++) { if (i >= MAXARGS) { - errmsg = strdup(GETMESSAGE(5,1, + errmsg = strdup(GETMESSAGE( "Too many resource parameters have been specified; skipping '%s'")); printerrf(arg0, errmsg, argv[*n], NULL, NULL, NULL, NULL, NULL, @@ -564,7 +564,7 @@ parse_args( } if ((colon = strchr(argv[i], ':')) == NULL) { - errmsg = strdup(GETMESSAGE(5,2, + errmsg = strdup(GETMESSAGE( "Bad resource specification; should be of the form 'name:value' : %s")); printerrf(arg0, errmsg, argv[i], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -664,7 +664,7 @@ do_XtInitialize( if (Toplevel != NULL) { - errmsg = strdup(GETMESSAGE(5,4, + errmsg = strdup(GETMESSAGE( "The toolkit has already been initialized")); printerr(argv[0], errmsg, NULL); free(errmsg); @@ -672,7 +672,7 @@ do_XtInitialize( } if (argc < 4) { - errmsg =strdup(GETMESSAGE(5,5, + errmsg =strdup(GETMESSAGE( "Usage: XtInitialize variable applicationName applicationClass [args ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -707,7 +707,7 @@ _CreateWidget( char ** pargv; if (argc < 5) { - errmsg = strdup(GETMESSAGE(5,6, + errmsg = strdup(GETMESSAGE( "Usage: %s variable name class parent [arg:val ...]")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -784,7 +784,7 @@ do_XtCreateApplicationShell( char ** pargv; if (argc < 4) { - errmsg=strdup(GETMESSAGE(5,7, + errmsg=strdup(GETMESSAGE( "Usage: XtCreateApplicationShell variable name class [arg:val ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -869,8 +869,8 @@ do_XtPopup( if (argc != 3) { - errmsg=strdup(GETMESSAGE(5,8, - "Usage: XtPopup widget GrabNone|GrabNonexclusive|GrabExclusive")); + errmsg=strdup(GETMESSAGE( + "Usage: XtPopup widget GrabNone|GrabNonexclusive|GrabExclusive")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -889,7 +889,7 @@ do_XtPopup( grab = XtGrabExclusive; else { - errmsg=strdup(GETMESSAGE(5,9, + errmsg=strdup(GETMESSAGE( "The grab type '%s' is not recognized; using 'GrabNone'")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -990,7 +990,7 @@ do_XtIsShell( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,10, "Usage: XtIsShell widget")); + errmsg = strdup(GETMESSAGE("Usage: XtIsShell widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1048,7 +1048,7 @@ do_XtMapWidget( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,11, "Usage: XtMapWidget widget")); + errmsg = strdup(GETMESSAGE("Usage: XtMapWidget widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1072,7 +1072,7 @@ do_XtUnmapWidget( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,12, "Usage: XtUnmapWidget widget")); + errmsg = strdup(GETMESSAGE("Usage: XtUnmapWidget widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1143,7 +1143,7 @@ GetDisplayHandle( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,13, "Usage: %s variable widget")); + errmsg = strdup(GETMESSAGE("Usage: %s variable widget")); printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -1174,7 +1174,7 @@ do_XtNameToWidget( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,82, + errmsg = strdup(GETMESSAGE( "Usage: XtNameToWidget variable referenceWidget names")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1229,7 +1229,7 @@ do_XtScreen( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,14, "Usage: XtScreen variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtScreen variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1258,7 +1258,7 @@ do_XtWindow( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,15, "Usage: XtWindow variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtWindow variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1280,7 +1280,7 @@ XtCallCallbacks_usage( { char * errmsg; - errmsg = strdup(GETMESSAGE(5,16, + errmsg = strdup(GETMESSAGE( "Usage: XtCallCallbacks widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1323,7 +1323,7 @@ do_XtHasCallbacks( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,17, + errmsg = strdup(GETMESSAGE( "Usage: XtHasCallbacks variable widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1367,7 +1367,7 @@ do_XtAddCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,18, + errmsg = strdup(GETMESSAGE( "Usage: XtAddCallback widget callbackName ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1437,7 +1437,7 @@ do_XtRemoveCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,19, + errmsg = strdup(GETMESSAGE( "Usage: XtRemoveCallback widget callbackName ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1492,7 +1492,7 @@ RemoveOneCallback( handle = (DtWsmCBContext)strtoul(handleStr, &p, 0); if (p == handleStr) { - errmsg = strdup(GETMESSAGE(5,20, + errmsg = strdup(GETMESSAGE( "The following is an invalid callback handle: %s")); printerrf(cmd, errmsg, handleStr, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1531,7 +1531,7 @@ RemoveOneCallback( return(0); } - errmsg = strdup(GETMESSAGE(5,21, + errmsg = strdup(GETMESSAGE( "The specified callback is not registered")); printerr(cmd, errmsg, NULL); free(errmsg); @@ -1553,7 +1553,7 @@ do_XtAddEventHandler( if (argc != 5) { - errmsg=strdup(GETMESSAGE(5,22, + errmsg=strdup(GETMESSAGE( "Usage: XtAddEventHandler widget mask nonMaskable ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1609,7 +1609,7 @@ do_XtRemoveEventHandler( if (argc != 5) { - errmsg =strdup(GETMESSAGE(5,23, + errmsg =strdup(GETMESSAGE( "Usage: XtRemoveEventHandler widget mask nonMaskable ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1669,7 +1669,7 @@ do_XtRemoveEventHandler( return(0); } - errmsg = strdup(GETMESSAGE(5,24, + errmsg = strdup(GETMESSAGE( "The specified event handler is not registered")); printerr(arg0, errmsg, NULL); free(errmsg); @@ -1691,7 +1691,7 @@ do_XtGetValues( char * errmsg; if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,25, + errmsg = strdup(GETMESSAGE( "Usage: XtGetValues widget resource:variable ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1711,7 +1711,7 @@ do_XtGetValues( for (i = 0, n = 0; i < argc; i++) { if ((p = strchr(argv[i], ':')) == NULL) { - errmsg=strdup(GETMESSAGE(5,26, + errmsg=strdup(GETMESSAGE( "The following resource parameter is incorrectly formed: %s")); printerrf(arg0, errmsg, argv[i], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1763,7 +1763,7 @@ do_XtSetValues( char ** pargv; if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,27, + errmsg = strdup(GETMESSAGE( "Usage: XtSetValues widget arg:val ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1886,7 +1886,7 @@ do_XtAddWorkProc( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,28, + errmsg = strdup(GETMESSAGE( "Usage: XtAddWorkProc variable command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1913,7 +1913,7 @@ do_XtRemoveWorkProc( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,29, "Usage: XtRemoveWorkProc workProcId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveWorkProc workProcId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1922,7 +1922,7 @@ do_XtRemoveWorkProc( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg=strdup(GETMESSAGE(5,30, + errmsg=strdup(GETMESSAGE( "The workProcId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -1949,7 +1949,7 @@ do_XtAddTimeOut( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,31, + errmsg = strdup(GETMESSAGE( "Usage: XtAddTimeOut variable milliseconds command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -1959,7 +1959,7 @@ do_XtAddTimeOut( variable = argv[1]; if ((milliseconds = atol(argv[2])) <= 0) { - errmsg = strdup(GETMESSAGE(5,32, + errmsg = strdup(GETMESSAGE( "The milliseconds parameter must be greater than zero")); printerr(argv[0], errmsg, NULL); free(errmsg); @@ -1987,7 +1987,7 @@ do_XtRemoveTimeOut( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,33, "Usage: XtRemoveTimeOut intervalId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveTimeOut intervalId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -1995,7 +1995,7 @@ do_XtRemoveTimeOut( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg = strdup(GETMESSAGE(5,34, + errmsg = strdup(GETMESSAGE( "The intervalId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2036,7 +2036,7 @@ do_managelist_func( char * errmsg; if (argc < 2) { - errmsg = strdup(GETMESSAGE(5,35, "Usage: %s widget ...")); + errmsg = strdup(GETMESSAGE("Usage: %s widget ...")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2064,7 +2064,7 @@ do_XtIsSubclass( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,120, + errmsg = strdup(GETMESSAGE( "Usage: XtIsSubclass widget class")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2080,7 +2080,7 @@ do_XtIsSubclass( return(!XtIsSubclass(w->w, C[i].class)); } } - errmsg = strdup(GETMESSAGE(5,121, + errmsg = strdup(GETMESSAGE( "%s is not a valid widget class name")); printerrf(str_nill, errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2101,7 +2101,7 @@ do_XtClass( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,122, + errmsg = strdup(GETMESSAGE( "Usage: XtClass variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2156,7 +2156,7 @@ do_XBell( if (argc != 3) { - errmsg=strdup(GETMESSAGE(5,36, "Usage: XBell display volume")); + errmsg=strdup(GETMESSAGE("Usage: XBell display volume")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -2196,7 +2196,7 @@ do_RootWindowCmd( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,37, "Usage: %s variable screen")); + errmsg = strdup(GETMESSAGE("Usage: %s variable screen")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2206,7 +2206,7 @@ do_RootWindowCmd( screen = (Screen *)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,38, "The screen parameter is invalid: %s")); + errmsg = strdup(GETMESSAGE("The screen parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2255,7 +2255,7 @@ do_XDefineCursor( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,39, + errmsg = strdup(GETMESSAGE( "Usage: XDefineCursor display window cursorId")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2285,7 +2285,7 @@ do_XDefineCursor( cursor = (Cursor)strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg = strdup(GETMESSAGE(5,40, + errmsg = strdup(GETMESSAGE( "The cursorId parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2309,7 +2309,7 @@ do_XUndefineCursor( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,41, + errmsg = strdup(GETMESSAGE( "Usage: XUndefineCursor display window")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2350,7 +2350,7 @@ do_XtRemoveAllCallbacks( char * errmsg; if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,42, + errmsg = strdup(GETMESSAGE( "Usage: XtRemoveAllCallbacks widget callbackName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2441,7 +2441,7 @@ do_XTextWidth( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,43, + errmsg = strdup(GETMESSAGE( "Usage: XTextWidth variable fontName string")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -2496,7 +2496,7 @@ invokeXDrawFunction( if (argc < 3) { - errmsg = strdup(GETMESSAGE(5,44, + errmsg = strdup(GETMESSAGE( "Usage: %s display drawable [args ...]")); printerrf(str_nill, errmsg, functionName, NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2516,7 +2516,7 @@ invokeXDrawFunction( drawable = (Window)strtoul(argv[2], &sp, 0); if (sp == argv[2]) { - errmsg = strdup(GETMESSAGE(5,45, + errmsg = strdup(GETMESSAGE( "The drawable parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2532,7 +2532,7 @@ invokeXDrawFunction( destination = (Window)strtoul(argv[3], &sp, 0); if (sp == argv[3]) { - errmsg = strdup(GETMESSAGE(5,46, + errmsg = strdup(GETMESSAGE( "The destination parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2766,7 +2766,7 @@ invokeXDrawFunction( f = GXcopyInverted; else { - errmsg = strdup(GETMESSAGE(5,47, + errmsg = strdup(GETMESSAGE( "Unrecognized graphics function name: %s")); printerrf(functionName, errmsg, argv[4], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -2795,7 +2795,7 @@ invokeXDrawFunction( else if (strcmp(argv[4], "LineOnOffDash") == 0) f = LineOnOffDash; else { - errmsg = strdup(GETMESSAGE(5,48, "Unrecognized line style: %s")); + errmsg = strdup(GETMESSAGE("Unrecognized line style: %s")); printerrf(functionName, errmsg, argv[4], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2811,7 +2811,7 @@ invokeXDrawFunction( } else { - errmsg = strdup(GETMESSAGE(5,49, "Unrecognized drawing option: %s")); + errmsg = strdup(GETMESSAGE("Unrecognized drawing option: %s")); printerrf(functionName, errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -2943,7 +2943,7 @@ invokeXDrawFunction( if (argc != 0) { - errmsg = strdup(GETMESSAGE(5,50, + errmsg = strdup(GETMESSAGE( "There were left over points which were ignored")); printerr(functionName, errmsg, NULL); free(errmsg); @@ -3021,7 +3021,7 @@ do_XCopyArea( if (argc < 10) { - errmsg = strdup(GETMESSAGE(5,51, + errmsg = strdup(GETMESSAGE( "Usage: XCopyArea display source dest sourceX sourceY width height destX destY [args ...]")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -3146,7 +3146,7 @@ ConvertTypeToString( if ((to_val.addr) || (strcmp(res->resource_type, XmRXmString) == 0)) { *ret = to_val.addr; } else { - errmsg=strdup(GETMESSAGE(5,52, + errmsg=strdup(GETMESSAGE( "Unable to convert resource type '%s' to 'String'")); printerrf(arg0, errmsg, res->resource_type, NULL, NULL, NULL, NULL, NULL, @@ -3278,7 +3278,7 @@ ConvertStringToType( *freeit = TRUE; } } else { - errmsg=strdup(GETMESSAGE(5,53, + errmsg=strdup(GETMESSAGE( "Unable to convert resource type 'String' to type '%s'")); printerrf(arg0, errmsg, res->resource_type, NULL, NULL, NULL, NULL, NULL, @@ -3295,7 +3295,7 @@ XtAddInputUsage( { char * errmsg; - errmsg=strdup(GETMESSAGE(5,54, + errmsg=strdup(GETMESSAGE( "Usage: XtAddInput variable [-r] fileDescriptor kshCommand")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -3406,7 +3406,7 @@ do_XtRemoveInput( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,56, "Usage: XtRemoveInput inputId")); + errmsg = strdup(GETMESSAGE("Usage: XtRemoveInput inputId")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -3415,7 +3415,7 @@ do_XtRemoveInput( id = strtoul(argv[1], &p, 16); if (p == argv[1]) { - errmsg = strdup(GETMESSAGE(5,57, + errmsg = strdup(GETMESSAGE( "The inputId parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -3954,7 +3954,7 @@ do_XFlush( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,59, "Usage: XFlush display")); + errmsg = strdup(GETMESSAGE("Usage: XFlush display")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -3987,7 +3987,7 @@ do_XSync( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,60, "Usage: XSync display discard")); + errmsg = strdup(GETMESSAGE("Usage: XSync display discard")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4031,7 +4031,7 @@ do_XRaiseWindow( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,61, "Usage: XRaiseWindow display window")); + errmsg = strdup(GETMESSAGE("Usage: XRaiseWindow display window")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4066,7 +4066,7 @@ XtSetSensitive_usage( { char * errmsg; - errmsg = strdup(GETMESSAGE(5,62, "Usage: %s widget [True|False]")); + errmsg = strdup(GETMESSAGE("Usage: %s widget [True|False]")); printerrf(str_nill, errmsg, arg0, NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); return(1); @@ -4114,7 +4114,7 @@ RegisterTranslations( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,63, "Usage: %s widget translations")); + errmsg = strdup(GETMESSAGE("Usage: %s widget translations")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -4166,7 +4166,7 @@ do_XtUninstallTranslations( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,64, + errmsg = strdup(GETMESSAGE( "Usage: XtUninstallTranslations widget")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4194,7 +4194,7 @@ do_XtParent( char * errmsg; if (argc != 3 ) { - errmsg = strdup(GETMESSAGE(5,65, "Usage: XtParent variable widget")); + errmsg = strdup(GETMESSAGE("Usage: XtParent variable widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4239,7 +4239,7 @@ do_XtLastTimestampProcessed( char * errmsg; if (argc != 3 ) { - errmsg = strdup(GETMESSAGE(5,66, + errmsg = strdup(GETMESSAGE( "Usage: XtLastTimestampProcessed variable display")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4496,7 +4496,7 @@ do_DtSessionRestorePath( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,67, + errmsg = strdup(GETMESSAGE( "Usage: DtSessionRestorePath widget pathVariable saveFile")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4529,7 +4529,7 @@ do_DtSessionSavePath( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,68, + errmsg = strdup(GETMESSAGE( "Usage: DtSessionSavePath widget pathVariable fileVariable")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4572,7 +4572,7 @@ do_DtShellIsIconified( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,69, "Usage: DtShellIsIconified widget")); + errmsg = strdup(GETMESSAGE("Usage: DtShellIsIconified widget")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -4604,7 +4604,7 @@ do_DtSetStartupCommand( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,70, + errmsg = strdup(GETMESSAGE( "Usage: DtSetStartupCommand widget command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4640,7 +4640,7 @@ do_DtSetIconifyHint( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,71, + errmsg = strdup(GETMESSAGE( "Usage: DtSetIconifyHint widget boolean")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4778,7 +4778,7 @@ do_DtWsmGetCurrentWorkspace( rootWindow = (Window)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,73, + errmsg = strdup(GETMESSAGE( "The rootWindow parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -4807,7 +4807,7 @@ do_DtWsmSetCurrentWorkspace( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,74, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmSetCurrentWorkspace widget atom")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -4821,7 +4821,7 @@ do_DtWsmSetCurrentWorkspace( atom = (Atom)strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg = strdup(GETMESSAGE(5,75, "The workspace atom is invalid: %s")); + errmsg = strdup(GETMESSAGE("The workspace atom is invalid: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -4962,7 +4962,7 @@ do_DtWsmSetWorkspacesOccupied( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,78, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmSetWorkspacesOccupied display window workspaceList")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5098,7 +5098,7 @@ do__DtGetHourGlassCursor( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,79, + errmsg = strdup(GETMESSAGE( "Usage: _DtGetHourGlassCursor variable display")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5186,7 +5186,7 @@ do_DtWsmAddCurrentWorkspaceCallback( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,80, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmAddCurrentWorkspaceCallback variable widget ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5227,7 +5227,7 @@ do_DtWsmRemoveWorkspaceCallback( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,81, + errmsg = strdup(GETMESSAGE( "Usage: DtWsmRemoveWorkspaceCallback handle")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5252,7 +5252,7 @@ do_DtWsmRemoveWorkspaceCallback( if(cdata == (dtksh_client_data_t *)NULL) { - errmsg = strdup(GETMESSAGE(5,20, + errmsg = strdup(GETMESSAGE( "The following is an invalid callback handle: %s")); printerrf(argv[0], errmsg, argv[1], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -5278,7 +5278,7 @@ do_DtDbLoad( if (argc != 1) { - errmsg = strdup(GETMESSAGE(5,83, "Usage: DtDbLoad")); + errmsg = strdup(GETMESSAGE("Usage: DtDbLoad")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5321,7 +5321,7 @@ do_DtDbReloadNotify( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,84, "Usage: DtDbReloadNotify ksh-command")); + errmsg = strdup(GETMESSAGE("Usage: DtDbReloadNotify ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5352,7 +5352,7 @@ do_DtActionExists( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,85, "Usage: DtActionExists actionName")); + errmsg = strdup(GETMESSAGE("Usage: DtActionExists actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5379,7 +5379,7 @@ do_DtActionLabel( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,86, + errmsg = strdup(GETMESSAGE( "Usage: DtActionLabel variable actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5412,7 +5412,7 @@ do_DtActionDescription( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,87, + errmsg = strdup(GETMESSAGE( "Usage: DtActionDescription variable actionName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5435,7 +5435,7 @@ _DtActionInvokeUsage( void ) { char * errmsg; - errmsg = strdup(GETMESSAGE(5,88, + errmsg = strdup(GETMESSAGE( "Usage: DtActionInvoke widget actionName termParms execHost contextDir useIndicator ksh-command [\"FILE\" fileName] ...")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5548,7 +5548,7 @@ do_DtDtsLoadDataTypes( if (argc != 1) { - errmsg = strdup(GETMESSAGE(5,89, "Usage: DtDtsLoadDataTypes")); + errmsg = strdup(GETMESSAGE("Usage: DtDtsLoadDataTypes")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5569,7 +5569,7 @@ do_DtDtsFileToDataType( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,90, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToDataType variable fileName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5597,7 +5597,7 @@ do_DtDtsFileToAttributeValue( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,91, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToAttributeValue variable fileName attrName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5627,7 +5627,7 @@ do_DtDtsFileToAttributeList( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,92, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFileToAttributeList variable fileName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5669,7 +5669,7 @@ do_DtDtsDataTypeToAttributeValue( if ((argc != 4) && (argc != 5)) { - errmsg = strdup(GETMESSAGE(5,93, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeToAttributeValue variable dataType attrName optName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5705,7 +5705,7 @@ do_DtDtsDataTypeToAttributeList( if ((argc != 3) && (argc != 4)) { - errmsg = strdup(GETMESSAGE(5,94, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeToAttributeList variable dataType optName")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5753,7 +5753,7 @@ do_DtDtsFindAttribute( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,95, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsFindAttribute variable name value")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5796,7 +5796,7 @@ do_DtDtsDataTypeNames( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,96, "Usage: DtDtsDataTypeNames variable")); + errmsg = strdup(GETMESSAGE("Usage: DtDtsDataTypeNames variable")); printerr(str_nill, errmsg, NULL); free(errmsg); return(1); @@ -5837,7 +5837,7 @@ do_DtDtsSetDataType( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,97, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsSetDataType variable fileName dataType override")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5872,7 +5872,7 @@ do_DtDtsDataTypeIsAction( if (argc != 2) { - errmsg = strdup(GETMESSAGE(5,98, + errmsg = strdup(GETMESSAGE( "Usage: DtDtsDataTypeIsAction dataType")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5909,7 +5909,7 @@ do_ttdt_open( if (argc != 8) { - errmsg = strdup(GETMESSAGE(5,99, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_open variable status variable2 toolname vendor version sendStarted")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -5973,7 +5973,7 @@ do_ttdt_close( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,103, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_close status procId newProcId sendStopped")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6032,7 +6032,7 @@ do_tttk_Xt_input_handler( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,100, + errmsg = strdup(GETMESSAGE( "Usage: tttk_Xt_input_handler procId source id")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6042,7 +6042,7 @@ do_tttk_Xt_input_handler( source = strtoul(argv[2], &p, 0); if (p == argv[2]) { - errmsg=strdup(GETMESSAGE(5,101, + errmsg=strdup(GETMESSAGE( "The source parameter must be an integer: %s")); printerrf(argv[0], errmsg, argv[2], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6053,7 +6053,7 @@ do_tttk_Xt_input_handler( fid = strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg = strdup(GETMESSAGE(5,102, + errmsg = strdup(GETMESSAGE( "The id parameter must be a hex number: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6084,7 +6084,7 @@ do_ttdt_session_join( if (argc != 6) { - errmsg = strdup(GETMESSAGE(5,104, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_session_join variable status sessId shellWidgetHandle join" )); printerr(str_nill, errmsg, NULL); @@ -6157,7 +6157,7 @@ do_ttdt_session_quit( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,105, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_session_quit status sessId sessPatterns quit")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6185,7 +6185,7 @@ do_ttdt_session_quit( patterns = (Tt_pattern *)strtoul(argv[3], &p, 0); if (p == argv[3]) { - errmsg=strdup(GETMESSAGE(5,106, + errmsg=strdup(GETMESSAGE( "The sessPatterns parameter is invalid: %s")); printerrf(argv[0], errmsg, argv[3], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6225,7 +6225,7 @@ do_ttdt_file_event( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,107, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_event status op patterns send")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6373,7 +6373,7 @@ do_ttdt_file_join( if (argc != 7) { - errmsg = strdup(GETMESSAGE(5,115, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_join variable status pathName scope join ksh-command")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6466,7 +6466,7 @@ do_ttdt_file_quit( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,108, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_file_quit status patterns quit")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6536,7 +6536,7 @@ do_ttdt_Get_Modified( if (argc != 4) { - errmsg = strdup(GETMESSAGE(5,109, + errmsg = strdup(GETMESSAGE( "Usage: ttdt_Get_Modified pathName scope timeout")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6590,7 +6590,7 @@ ttdt_SaveOrRevert( if (argc != 5) { - errmsg = strdup(GETMESSAGE(5,110, + errmsg = strdup(GETMESSAGE( "Usage: %s status pathName scope timeout")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6664,7 +6664,7 @@ do_tt_error_pointer( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,112, + errmsg = strdup(GETMESSAGE( "Usage: tt_error_pointer variable ttStatus")); printerr(str_nill, errmsg, NULL); free(errmsg); @@ -6702,7 +6702,7 @@ message_DestroyOrReply( if (argc != 3) { - errmsg = strdup(GETMESSAGE(5,113, "Usage: %s status msg")); + errmsg = strdup(GETMESSAGE("Usage: %s status msg")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); free(errmsg); @@ -6769,7 +6769,7 @@ message_FailOrReject( if (argc != 6) { - errmsg = strdup(GETMESSAGE(5,114, + errmsg = strdup(GETMESSAGE( "Usage: %s status msg msgStatus msgStatusString destroy")); printerrf(str_nill, errmsg, argv[0], NULL, NULL, NULL, NULL, NULL, NULL, NULL); @@ -6899,7 +6899,7 @@ do_tt_file_netfile( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,116, + usageMsg = strdup(GETMESSAGE( "Usage: tt_file_netfile variable status filename")); results = tt_netfile_handler(4, tt_file_netfile, usageMsg, argc, argv); XtFree(usageMsg); @@ -6915,7 +6915,7 @@ do_tt_netfile_file( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,117, + usageMsg = strdup(GETMESSAGE( "Usage: tt_netfile_file variable status netfilename")); results = tt_netfile_handler(4, tt_netfile_file, usageMsg, argc, argv); XtFree(usageMsg); @@ -6931,7 +6931,7 @@ do_tt_host_file_netfile( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,118, + usageMsg = strdup(GETMESSAGE( "Usage: tt_host_file_netfile variable status host filename")); results = tt_netfile_handler(5, tt_host_file_netfile, usageMsg, argc, argv); XtFree(usageMsg); @@ -6947,7 +6947,7 @@ do_tt_host_netfile_file( char * usageMsg; int results; - usageMsg = strdup(GETMESSAGE(5,119, + usageMsg = strdup(GETMESSAGE( "Usage: tt_host_netfile_file variable status host netfilename")); results = tt_netfile_handler(5, tt_host_netfile_file, usageMsg, argc, argv); XtFree(usageMsg); @@ -7885,6 +7885,7 @@ Namval_t * nopCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { Namval_t * np2; @@ -7895,6 +7896,7 @@ nopCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -7910,6 +7912,7 @@ Namval_t * dftCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { Namval_t * np2; @@ -7936,6 +7939,7 @@ dftCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -7948,6 +7952,7 @@ Namval_t * ehCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { Namval_t * np2; @@ -7965,6 +7970,7 @@ ehCreateDisc( token = strtok(tmpBuf, "."); np2 = ProcessCallbackEvent(event, np, token, fp); XtFree(tmpBuf); + fp->last = Empty; return(np2); } @@ -7977,6 +7983,7 @@ Namval_t * transCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { Namval_t * np2; @@ -7994,6 +8001,7 @@ transCreateDisc( token = strtok(tmpBuf, "."); np2 = ProcessCallbackEvent(event, np, token, fp); XtFree(tmpBuf); + fp->last = Empty; return(np2); } @@ -8005,6 +8013,7 @@ Namval_t * scaleCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8032,6 +8041,7 @@ scaleCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8043,6 +8053,7 @@ Namval_t * arrowCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8078,6 +8089,7 @@ arrowCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8089,6 +8101,7 @@ Namval_t * comboCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8122,6 +8135,7 @@ comboCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8133,6 +8147,7 @@ Namval_t * cmdCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8169,6 +8184,7 @@ cmdCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8180,6 +8196,7 @@ Namval_t * dAreaCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8207,6 +8224,7 @@ dAreaCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8218,6 +8236,7 @@ Namval_t * dbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8255,6 +8274,7 @@ dbtnCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8266,6 +8286,7 @@ Namval_t * fselCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8332,6 +8353,7 @@ fselCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8343,6 +8365,7 @@ Namval_t * listCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8429,6 +8452,7 @@ listCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8440,6 +8464,7 @@ Namval_t * pbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8475,6 +8500,7 @@ pbtnCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8486,6 +8512,7 @@ Namval_t * rcCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8527,6 +8554,7 @@ rcCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8538,6 +8566,7 @@ Namval_t * sbarCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8572,6 +8601,7 @@ sbarCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8583,6 +8613,7 @@ Namval_t * swinCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8612,6 +8643,7 @@ swinCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8623,6 +8655,7 @@ Namval_t * sboxCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8659,6 +8692,7 @@ sboxCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8670,6 +8704,7 @@ Namval_t * tbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8697,6 +8732,7 @@ tbtnCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8712,6 +8748,7 @@ Namval_t * textCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8856,6 +8893,7 @@ textCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8867,6 +8905,7 @@ Namval_t * textCreateDisc2( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -8962,10 +9001,11 @@ textCreateDisc2( } } else - np2 = textCreateDisc(np, nameCopy, fp); + np2 = textCreateDisc(np, nameCopy, flags, fp); XtFree(nameCopy); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -8977,6 +9017,7 @@ Namval_t * helpCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -9043,6 +9084,7 @@ helpCreateDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -9055,6 +9097,7 @@ Namval_t * dtPrintSetupProcDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp ) { char * cbDataAddrStr; @@ -9081,6 +9124,7 @@ dtPrintSetupProcDisc( np2 = CreateEmptyNameValuePair(np, token, fp); XtFree(dupName); + fp->last = Empty; return(np2); } @@ -9486,3 +9530,329 @@ stdVerifyPrinterProc( return; } +void dtksh_init() +{ + ADDBUILTIN("XtMainLoop", do_XtMainLoop); + ADDBUILTIN("DtLoadWidget", do_DtLoadWidget); + ADDBUILTIN("DtWidgetInfo", do_DtWidgetInfo); + ADDBUILTIN("XBell", do_XBell); + ADDBUILTIN("XRootWindowOfScreen", do_XRootWindowOfScreen); + ADDBUILTIN("XWidthOfScreen", do_XWidthOfScreen); + ADDBUILTIN("XHeightOfScreen", do_XHeightOfScreen); + ADDBUILTIN("XDefineCursor", do_XDefineCursor); + ADDBUILTIN("XUndefineCursor", do_XUndefineCursor); + ADDBUILTIN("XFlush", do_XFlush); + ADDBUILTIN("XSync", do_XSync); + ADDBUILTIN("XRaiseWindow", do_XRaiseWindow); + ADDBUILTIN("XtInitialize", do_XtInitialize); + ADDBUILTIN("XtIsSensitive", do_XtIsSensitive); + ADDBUILTIN("XtIsShell", do_XtIsShell); + ADDBUILTIN("XtIsRealized", do_XtIsRealized); + ADDBUILTIN("XtIsManaged", do_XtIsManaged); + ADDBUILTIN("XtCreateManagedWidget", do_XtCreateManagedWidget); + ADDBUILTIN("XtCreateApplicationShell", do_XtCreateApplicationShell); + ADDBUILTIN("XtCreateWidget", do_XtCreateWidget); + ADDBUILTIN("XtDestroyWidget", do_XtDestroyWidget); + ADDBUILTIN("XtSetValues", do_XtSetValues); + ADDBUILTIN("XtSetSensitive", do_XtSetSensitive); + ADDBUILTIN("XtAugmentTranslations", do_XtAugmentTranslations); + ADDBUILTIN("XtOverrideTranslations", do_XtOverrideTranslations); + ADDBUILTIN("XtUninstallTranslations", do_XtUninstallTranslations); + ADDBUILTIN("XtAddCallback", do_XtAddCallback); + ADDBUILTIN("XtRemoveCallback", do_XtRemoveCallback); + ADDBUILTIN("XtRemoveAllCallbacks", do_XtRemoveAllCallbacks); + ADDBUILTIN("XtCallCallbacks", do_XtCallCallbacks); + ADDBUILTIN("XtHasCallbacks", do_XtHasCallbacks); + ADDBUILTIN("XtAddEventHandler", do_XtAddEventHandler); + ADDBUILTIN("XtRemoveEventHandler", do_XtRemoveEventHandler); + ADDBUILTIN("XtGetValues", do_XtGetValues); + ADDBUILTIN("XtCreatePopupShell", do_XtCreatePopupShell); + ADDBUILTIN("XtPopup", do_XtPopup); + ADDBUILTIN("XtPopdown", do_XtPopdown); + ADDBUILTIN("XtMapWidget", do_XtMapWidget); + ADDBUILTIN("XtUnmapWidget", do_XtUnmapWidget); + ADDBUILTIN("XtManageChild", do_XtManageChildren); + ADDBUILTIN("XtManageChildren", do_XtManageChildren); + ADDBUILTIN("XtIsSubclass", do_XtIsSubclass); + ADDBUILTIN("XtClass", do_XtClass); + ADDBUILTIN("XtUnmanageChild", do_XtUnmanageChildren); + ADDBUILTIN("XtUnmanageChildren", do_XtUnmanageChildren); + ADDBUILTIN("XtAddTimeOut", do_XtAddTimeOut); + ADDBUILTIN("XtRemoveTimeOut", do_XtRemoveTimeOut); + ADDBUILTIN("XtAddInput", do_XtAddInput); + ADDBUILTIN("XtRemoveInput", do_XtRemoveInput); + ADDBUILTIN("XtAddWorkProc", do_XtAddWorkProc); + ADDBUILTIN("XtRemoveWorkProc", do_XtRemoveWorkProc); + ADDBUILTIN("XtRealizeWidget", do_XtRealizeWidget); + ADDBUILTIN("XtUnrealizeWidget", do_XtUnrealizeWidget); + ADDBUILTIN("DtSessionRestorePath", do_DtSessionRestorePath); + ADDBUILTIN("DtSessionSavePath", do_DtSessionSavePath); + ADDBUILTIN("DtShellIsIconified", do_DtShellIsIconified); + ADDBUILTIN("DtSetStartupCommand", do_DtSetStartupCommand); + ADDBUILTIN("DtSetIconifyHint", do_DtSetIconifyHint); + ADDBUILTIN("DtWsmAddWorkspaceFunctions", do_DtWsmAddWorkspaceFunctions); + ADDBUILTIN("DtWsmRemoveWorkspaceFunctions", do_DtWsmRemoveWorkspaceFunctions); + ADDBUILTIN("DtWsmGetCurrentWorkspace", do_DtWsmGetCurrentWorkspace); + ADDBUILTIN("DtWsmSetCurrentWorkspace", do_DtWsmSetCurrentWorkspace); + ADDBUILTIN("DtWsmGetWorkspaceList", do_DtWsmGetWorkspaceList); + ADDBUILTIN("DtWsmGetWorkspacesOccupied", do_DtWsmGetWorkspacesOccupied); + ADDBUILTIN("DtWsmSetWorkspacesOccupied", do_DtWsmSetWorkspacesOccupied); + ADDBUILTIN("DtWsmGetCurrentBackdropWindow", do_DtWsmGetCurrentBackdropWindow); + ADDBUILTIN("DtWsmOccupyAllWorkspaces", do_DtWsmOccupyAllWorkspaces); + ADDBUILTIN("DtGetHourGlassCursor", do__DtGetHourGlassCursor); + ADDBUILTIN("DtTurnOnHourGlass", do__DtTurnOnHourGlass); + ADDBUILTIN("DtTurnOffHourGlass", do__DtTurnOffHourGlass); + ADDBUILTIN("_DtGetHourGlassCursor", do__DtGetHourGlassCursor); + ADDBUILTIN("_DtTurnOnHourGlass", do__DtTurnOnHourGlass); + ADDBUILTIN("_DtTurnOffHourGlass", do__DtTurnOffHourGlass); + ADDBUILTIN("DtWsmAddCurrentWorkspaceCallback", do_DtWsmAddCurrentWorkspaceCallback); + ADDBUILTIN("DtWsmRemoveWorkspaceCallback", do_DtWsmRemoveWorkspaceCallback); + ADDBUILTIN("DtDbLoad", do_DtDbLoad); + ADDBUILTIN("DtDbReloadNotify", do_DtDbReloadNotify); + ADDBUILTIN("DtActionExists", do_DtActionExists); + ADDBUILTIN("DtActionLabel", do_DtActionLabel); + ADDBUILTIN("DtActionDescription", do_DtActionDescription); + ADDBUILTIN("DtActionInvoke", do_DtActionInvoke); + ADDBUILTIN("DtDtsLoadDataTypes", do_DtDtsLoadDataTypes); + ADDBUILTIN("DtDtsFileToDataType", do_DtDtsFileToDataType); + ADDBUILTIN("DtDtsFileToAttributeValue", do_DtDtsFileToAttributeValue); + ADDBUILTIN("DtDtsFileToAttributeList", do_DtDtsFileToAttributeList); + ADDBUILTIN("DtDtsDataTypeToAttributeValue", do_DtDtsDataTypeToAttributeValue); + ADDBUILTIN("DtDtsDataTypeToAttributeList", do_DtDtsDataTypeToAttributeList); + ADDBUILTIN("DtDtsFindAttribute", do_DtDtsFindAttribute); + ADDBUILTIN("DtDtsDataTypeNames", do_DtDtsDataTypeNames); + ADDBUILTIN("DtDtsSetDataType", do_DtDtsSetDataType); + ADDBUILTIN("DtDtsDataTypeIsAction", do_DtDtsDataTypeIsAction); + ADDBUILTIN("ttdt_open", do_ttdt_open); + ADDBUILTIN("ttdt_close", do_ttdt_close); + ADDBUILTIN("tttk_Xt_input_handler", do_tttk_Xt_input_handler); + ADDBUILTIN("ttdt_session_join", do_ttdt_session_join); + ADDBUILTIN("ttdt_session_quit", do_ttdt_session_quit); + ADDBUILTIN("ttdt_file_event", do_ttdt_file_event); + ADDBUILTIN("ttdt_file_join", do_ttdt_file_join); + ADDBUILTIN("ttdt_file_quit", do_ttdt_file_quit); + ADDBUILTIN("ttdt_Get_Modified", do_ttdt_Get_Modified); + ADDBUILTIN("ttdt_Save", do_ttdt_Save); + ADDBUILTIN("ttdt_Revert", do_ttdt_Revert); + ADDBUILTIN("tt_error_pointer", do_tt_error_pointer); + ADDBUILTIN("tttk_message_destroy", do_tttk_message_destroy); + ADDBUILTIN("tttk_message_reject", do_tttk_message_reject); + ADDBUILTIN("tttk_message_fail", do_tttk_message_fail); + ADDBUILTIN("tt_file_netfile", do_tt_file_netfile); + ADDBUILTIN("tt_netfile_file", do_tt_netfile_file); + ADDBUILTIN("tt_host_file_netfile", do_tt_host_file_netfile); + ADDBUILTIN("tt_host_netfile_file", do_tt_host_netfile_file); + ADDBUILTIN("tt_message_reply", do_tt_message_reply); + ADDBUILTIN("XClearArea", do_XClearArea); + ADDBUILTIN("XClearWindow", do_XClearWindow); + ADDBUILTIN("XCopyArea", do_XCopyArea); + ADDBUILTIN("XDrawArc", do_XDrawArc); + ADDBUILTIN("XDrawImageString", do_XDrawImageString); + ADDBUILTIN("XDrawLine", do_XDrawLine); + ADDBUILTIN("XDrawLines", do_XDrawLines); + ADDBUILTIN("XDrawPoint", do_XDrawPoint); + ADDBUILTIN("XDrawPoints", do_XDrawPoints); + ADDBUILTIN("XDrawRectangle", do_XDrawRectangle); + ADDBUILTIN("XDrawSegments", do_XDrawSegments); + ADDBUILTIN("XDrawString", do_XDrawString); + ADDBUILTIN("XFillArc", do_XFillArc); + ADDBUILTIN("XFillPolygon", do_XFillPolygon); + ADDBUILTIN("XFillRectangle", do_XFillRectangle); + ADDBUILTIN("XTextWidth", do_XTextWidth); + ADDBUILTIN("XtDisplay", do_XtDisplay); + ADDBUILTIN("XtDisplayOfObject", do_XtDisplayOfObject); + ADDBUILTIN("XtNameToWidget", do_XtNameToWidget); + ADDBUILTIN("XtScreen", do_XtScreen); + ADDBUILTIN("XtWindow", do_XtWindow); + ADDBUILTIN("XtParent", do_XtParent); + ADDBUILTIN("XtLastTimestampProcessed", do_XtLastTimestampProcessed); + ADDBUILTIN("catopen", do_catopen); + ADDBUILTIN("catgets", do_catgets); + ADDBUILTIN("catclose", do_catclose); + ADDBUILTIN("XmCreateArrowButton", do_XmCreateArrowButton); + ADDBUILTIN("XmCreateArrowButtonGadget", do_XmCreateArrowButtonGadget); + ADDBUILTIN("XmCreateBulletinBoard", do_XmCreateBulletinBoard); + ADDBUILTIN("XmCreateBulletinBoardDialog", do_XmCreateBulletinBoardDialog); + ADDBUILTIN("XmCreateCascadeButton", do_XmCreateCascadeButton); + ADDBUILTIN("XmCreateCascadeButtonGadget", do_XmCreateCascadeButtonGadget); + ADDBUILTIN("XmCreateComboBox", do_XmCreateComboBox); + ADDBUILTIN("XmCreateCommand", do_XmCreateCommand); + ADDBUILTIN("XmCreateDialogShell", do_XmCreateDialogShell); + ADDBUILTIN("XmCreateDrawingArea", do_XmCreateDrawingArea); + ADDBUILTIN("XmCreateDrawnButton", do_XmCreateDrawnButton); + ADDBUILTIN("XmCreateErrorDialog", do_XmCreateErrorDialog); + ADDBUILTIN("XmCreateFileSelectionBox", do_XmCreateFileSelectionBox); + ADDBUILTIN("XmCreateFileSelectionDialog", do_XmCreateFileSelectionDialog); + ADDBUILTIN("XmCreateForm", do_XmCreateForm); + ADDBUILTIN("XmCreateFormDialog", do_XmCreateFormDialog); + ADDBUILTIN("XmCreateFrame", do_XmCreateFrame); + ADDBUILTIN("XmCreateInformationDialog", do_XmCreateInformationDialog); + ADDBUILTIN("XmCreateLabel", do_XmCreateLabel); + ADDBUILTIN("XmCreateLabelGadget", do_XmCreateLabelGadget); + ADDBUILTIN("XmCreateList", do_XmCreateList); + ADDBUILTIN("XmCreateMainWindow", do_XmCreateMainWindow); + ADDBUILTIN("XmCreateMenuBar", do_XmCreateMenuBar); + ADDBUILTIN("XmCreateMenuShell", do_XmCreateMenuShell); + ADDBUILTIN("XmCreateMessageBox", do_XmCreateMessageBox); + ADDBUILTIN("XmCreateOptionMenu", do_XmCreateOptionMenu); + ADDBUILTIN("XmCreatePanedWindow", do_XmCreatePanedWindow); + ADDBUILTIN("XmCreatePopupMenu", do_XmCreatePopupMenu); + ADDBUILTIN("XmCreatePromptDialog", do_XmCreatePromptDialog); + ADDBUILTIN("XmCreatePulldownMenu", do_XmCreatePulldownMenu); + ADDBUILTIN("XmCreatePushButton", do_XmCreatePushButton); + ADDBUILTIN("XmCreatePushButtonGadget", do_XmCreatePushButtonGadget); + ADDBUILTIN("XmCreateQuestionDialog", do_XmCreateQuestionDialog); + ADDBUILTIN("XmCreateRadioBox", do_XmCreateRadioBox); + ADDBUILTIN("XmCreateRowColumn", do_XmCreateRowColumn); + ADDBUILTIN("XmCreateScale", do_XmCreateScale); + ADDBUILTIN("XmCreateScrollBar", do_XmCreateScrollBar); + ADDBUILTIN("XmCreateScrolledList", do_XmCreateScrolledList); + ADDBUILTIN("XmCreateScrolledText", do_XmCreateScrolledText); + ADDBUILTIN("XmCreateScrolledWindow", do_XmCreateScrolledWindow); + ADDBUILTIN("XmCreateSelectionBox", do_XmCreateSelectionBox); + ADDBUILTIN("XmCreateSelectionDialog", do_XmCreateSelectionDialog); + ADDBUILTIN("XmCreateSeparator", do_XmCreateSeparator); + ADDBUILTIN("XmCreateSeparatorGadget", do_XmCreateSeparatorGadget); + ADDBUILTIN("XmCreateText", do_XmCreateText); + ADDBUILTIN("XmCreateTextField", do_XmCreateTextField); + ADDBUILTIN("XmCreateToggleButton", do_XmCreateToggleButton); + ADDBUILTIN("XmCreateToggleButtonGadget", do_XmCreateToggleButtonGadget); + ADDBUILTIN("XmCreateWarningDialog", do_XmCreateWarningDialog); + ADDBUILTIN("XmCreateWorkArea", do_XmCreateWorkArea); + ADDBUILTIN("XmCreateWorkingDialog", do_XmCreateWorkingDialog); + ADDBUILTIN("DtCreateHelpDialog", do_DtCreateHelpDialog); + ADDBUILTIN("DtCreateHelpQuickDialog", do_DtCreateHelpQuickDialog); + ADDBUILTIN("DtCreatePrintSetupBox", do_DtCreatePrintSetupBox); + ADDBUILTIN("DtCreatePrintSetupDialog", do_DtCreatePrintSetupDialog); + ADDBUILTIN("DtCreatePDMJobSetup", do_DtCreatePDMJobSetup); + ADDBUILTIN("DtHelpReturnSelectedWidgetId", do_DtHelpReturnSelectedWidgetId); + ADDBUILTIN("DtHelpSetCatalogName", do_DtHelpSetCatalogName); + ADDBUILTIN("DtHelpQuickDialogGetChild", do_DtHelpQuickDialogGetChild); + ADDBUILTIN("XmCommandAppendValue", do_XmCommandAppendValue); + ADDBUILTIN("XmCommandError", do_XmCommandError); + ADDBUILTIN("XmCommandSetValue", do_XmCommandSetValue); + ADDBUILTIN("XmCommandGetChild", do_XmCommandGetChild); + ADDBUILTIN("XmMessageBoxGetChild", do_XmMessageBoxGetChild); + ADDBUILTIN("XmFileSelectionBoxGetChild", do_XmFileSelectionBoxGetChild); + ADDBUILTIN("XmSelectionBoxGetChild", do_XmSelectionBoxGetChild); + ADDBUILTIN("XmMainWindowSetAreas", do_XmMainWindowSetAreas); + ADDBUILTIN("XmMainWindowSep1", do_XmMainWindowSep1); + ADDBUILTIN("XmMainWindowSep2", do_XmMainWindowSep2); + ADDBUILTIN("XmMainWindowSep3", do_XmMainWindowSep3); + ADDBUILTIN("XmProcessTraversal", do_XmProcessTraversal); + ADDBUILTIN("XmInternAtom", do_XmInternAtom); + ADDBUILTIN("XmGetAtomName", do_XmGetAtomName); + ADDBUILTIN("XmGetColors", do_XmGetColors); + ADDBUILTIN("XmUpdateDisplay", do_XmUpdateDisplay); + ADDBUILTIN("XmAddWMProtocols", do_XmAddWMProtocols); + ADDBUILTIN("XmRemoveWMProtocols", do_XmRemoveWMProtocols); + ADDBUILTIN("XmAddWMProtocolCallback", do_XmAddWMProtocolCallback); + ADDBUILTIN("XmRemoveWMProtocolCallback", do_XmRemoveWMProtocolCallback); + ADDBUILTIN("XmMenuPosition", do_XmMenuPosition); + ADDBUILTIN("XmScaleGetValue", do_XmScaleGetValue); + ADDBUILTIN("XmScaleSetValue", do_XmScaleSetValue); + ADDBUILTIN("XmScrollBarGetValues", do_XmScrollBarGetValues); + ADDBUILTIN("XmScrollBarSetValues", do_XmScrollBarSetValues); + ADDBUILTIN("XmScrollVisible", do_XmScrollVisible); + ADDBUILTIN("XmToggleButtonGetState", do_XmToggleButtonGetState); + ADDBUILTIN("XmToggleButtonGadgetGetState", do_XmToggleButtonGadgetGetState); + ADDBUILTIN("XmToggleButtonSetState", do_XmToggleButtonSetState); + ADDBUILTIN("XmToggleButtonGadgetSetState", do_XmToggleButtonGadgetSetState); + ADDBUILTIN("XmIsTraversable", do_XmIsTraversable); + ADDBUILTIN("XmOptionButtonGadget", do_XmOptionButtonGadget); + ADDBUILTIN("XmOptionLabelGadget", do_XmOptionLabelGadget); + ADDBUILTIN("XmGetVisibility", do_XmGetVisibility); + ADDBUILTIN("XmGetTearOffControl", do_XmGetTearOffControl); + ADDBUILTIN("XmGetTabGroup", do_XmGetTabGroup); + ADDBUILTIN("XmGetPostedFromWidget", do_XmGetPostedFromWidget); + ADDBUILTIN("XmGetFocusWidget", do_XmGetFocusWidget); + ADDBUILTIN("XmFileSelectionDoSearch", do_XmFileSelectionDoSearch); + ADDBUILTIN("XmListAddItem", do_XmListAddItem); + ADDBUILTIN("XmListAddItemUnselected", do_XmListAddItemUnselected); + ADDBUILTIN("XmListAddItems", do_XmListAddItems); + ADDBUILTIN("XmListAddItemsUnselected", do_XmListAddItemsUnselected); + ADDBUILTIN("XmListDeleteAllItems", do_XmListDeleteAllItems); + ADDBUILTIN("XmListDeleteItem", do_XmListDeleteItem); + ADDBUILTIN("XmListDeleteItems", do_XmListDeleteItems); + ADDBUILTIN("XmListDeleteItemsPos", do_XmListDeleteItemsPos); + ADDBUILTIN("XmListDeletePos", do_XmListDeletePos); + ADDBUILTIN("XmListDeletePositions", do_XmListDeletePositions); + ADDBUILTIN("XmListDeselectAllItems", do_XmListDeselectAllItems); + ADDBUILTIN("XmListDeselectItem", do_XmListDeselectItem); + ADDBUILTIN("XmListDeselectPos", do_XmListDeselectPos); + ADDBUILTIN("XmListGetKbdItemPos", do_XmListGetKbdItemPos); + ADDBUILTIN("XmListGetSelectedPos", do_XmListGetSelectedPos); + ADDBUILTIN("XmListGetMatchPos", do_XmListGetMatchPos); + ADDBUILTIN("XmListItemExists", do_XmListItemExists); + ADDBUILTIN("XmListItemPos", do_XmListItemPos); + ADDBUILTIN("XmListPosSelected", do_XmListPosSelected); + ADDBUILTIN("XmListPosToBounds", do_XmListPosToBounds); + ADDBUILTIN("XmListReplaceItemsPos", do_XmListReplaceItemsPos); + ADDBUILTIN("XmListReplaceItemsPosUnselected", do_XmListReplaceItemsPosUnselected); + ADDBUILTIN("XmListSelectItem", do_XmListSelectItem); + ADDBUILTIN("XmListSelectPos", do_XmListSelectPos); + ADDBUILTIN("XmListSetAddMode", do_XmListSetAddMode); + ADDBUILTIN("XmListSetBottomItem", do_XmListSetBottomItem); + ADDBUILTIN("XmListSetBottomPos", do_XmListSetBottomPos); + ADDBUILTIN("XmListSetHorizPos", do_XmListSetHorizPos); + ADDBUILTIN("XmListSetItem", do_XmListSetItem); + ADDBUILTIN("XmListSetKbdItemPos", do_XmListSetKbdItemPos); + ADDBUILTIN("XmListSetPos", do_XmListSetPos); + ADDBUILTIN("XmListUpdateSelectedList", do_XmListUpdateSelectedList); + ADDBUILTIN("XmTextDisableRedisplay", do_XmTextDisableRedisplay); + ADDBUILTIN("XmTextEnableRedisplay", do_XmTextEnableRedisplay); + ADDBUILTIN("XmTextGetTopCharacter", do_XmTextGetTopCharacter); + ADDBUILTIN("XmTextSetTopCharacter", do_XmTextSetTopCharacter); + ADDBUILTIN("XmTextScroll", do_XmTextScroll); + ADDBUILTIN("XmTextFindString", do_XmTextFindString); + ADDBUILTIN("XmTextGetBaseline", do_XmTextGetBaseline); + ADDBUILTIN("XmTextGetEditable", do_XmTextGetEditable); + ADDBUILTIN("XmTextGetInsertionPosition", do_XmTextGetInsertionPosition); + ADDBUILTIN("XmTextGetLastPosition", do_XmTextGetLastPosition); + ADDBUILTIN("XmTextGetMaxLength", do_XmTextGetMaxLength); + ADDBUILTIN("XmTextGetSelection", do_XmTextGetSelection); + ADDBUILTIN("XmTextGetSelectionPosition", do_XmTextGetSelectionPosition); + ADDBUILTIN("XmTextGetString", do_XmTextGetString); + ADDBUILTIN("XmTextInsert", do_XmTextInsert); + ADDBUILTIN("XmTextPosToXY", do_XmTextPosToXY); + ADDBUILTIN("XmTextRemove", do_XmTextRemove); + ADDBUILTIN("XmTextReplace", do_XmTextReplace); + ADDBUILTIN("XmTextSetEditable", do_XmTextSetEditable); + ADDBUILTIN("XmTextSetHighlight", do_XmTextSetHighlight); + ADDBUILTIN("XmTextSetInsertionPosition", do_XmTextSetInsertionPosition); + ADDBUILTIN("XmTextSetMaxLength", do_XmTextSetMaxLength); + ADDBUILTIN("XmTextSetSelection", do_XmTextSetSelection); + ADDBUILTIN("XmTextSetString", do_XmTextSetString); + ADDBUILTIN("XmTextShowPosition", do_XmTextShowPosition); + ADDBUILTIN("XmTextXYToPos", do_XmTextXYToPos); + ADDBUILTIN("XmTextClearSelection", do_XmTextClearSelection); + ADDBUILTIN("XmTextCopy", do_XmTextCopy); + ADDBUILTIN("XmTextCut", do_XmTextCut); + ADDBUILTIN("XmTextPaste", do_XmTextPaste); + ADDBUILTIN("XmTextSetAddMode", do_XmTextSetAddMode); + ADDBUILTIN("XmTextFieldGetBaseline", do_XmTextGetBaseline); + ADDBUILTIN("XmTextFieldGetEditable", do_XmTextGetEditable); + ADDBUILTIN("XmTextFieldGetInsertionPosition", do_XmTextGetInsertionPosition); + ADDBUILTIN("XmTextFieldGetLastPosition", do_XmTextGetLastPosition); + ADDBUILTIN("XmTextFieldGetMaxLength", do_XmTextGetMaxLength); + ADDBUILTIN("XmTextFieldGetSelection", do_XmTextGetSelection); + ADDBUILTIN("XmTextFieldGetSelectionPosition", do_XmTextGetSelectionPosition); + ADDBUILTIN("XmTextFieldGetString", do_XmTextGetString); + ADDBUILTIN("XmTextFieldInsert", do_XmTextInsert); + ADDBUILTIN("XmTextFieldPosToXY", do_XmTextPosToXY); + ADDBUILTIN("XmTextFieldRemove", do_XmTextRemove); + ADDBUILTIN("XmTextFieldReplace", do_XmTextReplace); + ADDBUILTIN("XmTextFieldSetEditable", do_XmTextSetEditable); + ADDBUILTIN("XmTextFieldSetHighlight", do_XmTextSetHighlight); + ADDBUILTIN("XmTextFieldSetInsertionPosition", do_XmTextSetInsertionPosition); + ADDBUILTIN("XmTextFieldSetMaxLength", do_XmTextSetMaxLength); + ADDBUILTIN("XmTextFieldSetSelection", do_XmTextSetSelection); + ADDBUILTIN("XmTextFieldSetString", do_XmTextSetString); + ADDBUILTIN("XmTextFieldShowPosition", do_XmTextShowPosition); + ADDBUILTIN("XmTextFieldXYToPos", do_XmTextXYToPos); + ADDBUILTIN("XmTextFieldClearSelection", do_XmTextClearSelection); + ADDBUILTIN("XmTextFieldCopy", do_XmTextCopy); + ADDBUILTIN("XmTextFieldCut", do_XmTextCut); + ADDBUILTIN("XmTextFieldPaste", do_XmTextPaste); + ADDBUILTIN("XmTextFieldSetAddMode", do_XmTextSetAddMode); +} diff --git a/cde/programs/dtksh/dtkcmds.h b/cde/programs/dtksh/dtkcmds.h index 9d9d11e3c..df063e3d5 100644 --- a/cde/programs/dtksh/dtkcmds.h +++ b/cde/programs/dtksh/dtkcmds.h @@ -50,6 +50,8 @@ #define CONVERT_POSTPONED 0 #define CONVERT_FAILED -1 +#define ADDBUILTIN(a,b) sh_addbuiltin(a, ((int (*)__PROTO__((int, char*[], Shbltin_t*)))b), (void*) 0) + extern Widget Toplevel; extern char str_nill[]; extern wtab_t * DTKSHConversionWidget; @@ -578,90 +580,112 @@ extern void FreeNestedVariables( void ) ; extern Namval_t * nopCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * dftCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * ehCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * transCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * scaleCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * arrowCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * comboCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * cmdCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * dAreaCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * dbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * dtPrintSetupProcDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp); extern Namval_t * fselCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * listCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * pbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * rcCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * sbarCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * swinCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * sboxCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * tbtnCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * textCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * textCreateDisc2( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern Namval_t * helpCreateDisc( Namval_t *np, char *name, + int flags, Namfun_t *fp) ; extern int * LockKshFileDescriptors( void ) ; extern void UnlockKshFileDescriptors( diff --git a/cde/programs/dtksh/dtkcvt.c b/cde/programs/dtksh/dtkcvt.c index 04a695949..2b0a2d36a 100644 --- a/cde/programs/dtksh/dtkcvt.c +++ b/cde/programs/dtksh/dtkcvt.c @@ -32,7 +32,7 @@ /* X includes */ -#include "shell.h" +#include "shell.h" #include #include #include @@ -55,9 +55,7 @@ #include
#include "hash.h" #include "stdio.h" -#define NO_AST #include "dtksh.h" -#undef NO_AST #include "xmksh.h" #include "XtCvtrs.h" #include "dtkcmds.h" @@ -105,7 +103,7 @@ DtkshCvtWindowToString( if (fval->size != sizeof(Window)) { - errmsg = strdup(GETMESSAGE(6,1, + errmsg = strdup(GETMESSAGE( "DtkshCvtWindowToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -135,7 +133,7 @@ DtkshCvtScreenToString( if (fval->size != sizeof(Screen *)) { - errmsg = strdup(GETMESSAGE(6,14, + errmsg = strdup(GETMESSAGE( "DtkshCvtScreenToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -225,7 +223,7 @@ DtkshCvtHexIntToString( if (fval->size != sizeof(long) && fval->size != sizeof(int) && fval->size != sizeof(short) && fval->size != sizeof(char)) { - errmsg = strdup(GETMESSAGE(6,2, + errmsg = strdup(GETMESSAGE( "DtkshCvtHexIntToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -257,7 +255,7 @@ DtkshCvtIntToString( if (fval->size != sizeof(int) && fval->size != sizeof(short)) { - errmsg = strdup(GETMESSAGE(6,3, + errmsg = strdup(GETMESSAGE( "DtkshCvtIntToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -286,7 +284,7 @@ DtkshCvtBooleanToString( if (fval->size != sizeof(int) && fval->size != sizeof(short) && fval->size != sizeof(char)) { - errmsg = strdup(GETMESSAGE(6,4, + errmsg = strdup(GETMESSAGE( "DtkshCvtBooleanToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -347,7 +345,7 @@ DtkshCvtStringToWidget( if (fval->size <= 0) { - errmsg = strdup(GETMESSAGE(6,5, + errmsg = strdup(GETMESSAGE( "DtkshCvtStringToWidget: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -387,7 +385,7 @@ DtkshCvtStringToWidget( { char errbuf[1024]; - errmsg = strdup(GETMESSAGE(6,6, + errmsg = strdup(GETMESSAGE( "DtkshCvtStringToWidget: Unable to find a widget named '%s'")); sprintf(errbuf, errmsg, wname); XtWarning(errbuf); @@ -414,7 +412,7 @@ DtkshCvtStringToCallback( if (fval->size <= 0) { - errmsg = strdup(GETMESSAGE(6,7, + errmsg = strdup(GETMESSAGE( "DtkshCvtStringToCallback: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -451,7 +449,7 @@ DtkshCvtCallbackToString( if (fval->size != sizeof(XtCallbackList)) { - errmsg = strdup(GETMESSAGE(6,8, + errmsg = strdup(GETMESSAGE( "DtkshCvtCallbackToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -508,7 +506,7 @@ DtkshCvtWidgetToString( if (fval->size != sizeof(Widget) || fval->addr == NULL) { - errmsg = strdup(GETMESSAGE(6,9, + errmsg = strdup(GETMESSAGE( "DtkshCvtWidgetToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -525,7 +523,7 @@ DtkshCvtWidgetToString( } if ((w = widget_to_wtab(widget)) == NULL) { - errmsg = strdup(GETMESSAGE(6,10, + errmsg = strdup(GETMESSAGE( "DtkshCvtWidgetToString: Unable to find a name for the widget")); XtWarning(errmsg); free(errmsg); @@ -646,7 +644,7 @@ DtkshCvtWidgetClassToString( if (fval->size != sizeof(WidgetClass)) { - errmsg = strdup(GETMESSAGE(6,11, + errmsg = strdup(GETMESSAGE( "DtkshCvtWidgetClassToString: The 'from' value is an invalid size")); XtWarning(errmsg); free(errmsg); @@ -673,7 +671,7 @@ DtkshCvtWidgetClassToString( } /* No match found */ - errmsg = strdup(GETMESSAGE(6,12, + errmsg = strdup(GETMESSAGE( "DtkshCvtWidgetClassToString: Unknown widget class")); XtWarning(errmsg); free(errmsg); @@ -717,7 +715,7 @@ DtkshCvtStringToWidgetClass( } /* No match found */ - errmsg = strdup(GETMESSAGE(6,13, + errmsg = strdup(GETMESSAGE( "DtkshCvtStringToWidgetClass: Unknown widget class name")); XtWarning(errmsg); free(errmsg); diff --git a/cde/programs/dtksh/dtksh.h b/cde/programs/dtksh/dtksh.h index 0205c0d95..5bc6e1069 100644 --- a/cde/programs/dtksh/dtksh.h +++ b/cde/programs/dtksh/dtksh.h @@ -33,10 +33,6 @@ #ifndef _Dtksh_dtksh_h #define _Dtksh_dtksh_h -#if !defined(NO_AST) -#include "nval.h" -#endif - #define SUCCESS 0 #define FAIL (-1) diff --git a/cde/programs/dtksh/examples/CallDataTest4.src b/cde/programs/dtksh/examples/CallDataTest4.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/CallbackTest2.src b/cde/programs/dtksh/examples/CallbackTest2.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/DtCursorTest2.src b/cde/programs/dtksh/examples/DtCursorTest2.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/DtWsTest1.src b/cde/programs/dtksh/examples/DtWsTest1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/EventHandlerTest.src b/cde/programs/dtksh/examples/EventHandlerTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/Imakefile b/cde/programs/dtksh/examples/Imakefile index 27bb3c249..9aa3bb4af 100644 --- a/cde/programs/dtksh/examples/Imakefile +++ b/cde/programs/dtksh/examples/Imakefile @@ -1,31 +1,30 @@ XCOMM $XConsortium: Imakefile /main/4 1996/04/21 19:30:42 drk $ -DESKTOP_VERSION_STRING = DesktopVersionString -MODULE=dtksh/examples +LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) -LOCAL_CPP_DEFINES = -DCDE_INSTALLATION_TOP=$(CDE_INSTALLATION_TOP) \ - -DCDE_CONFIGURATION_TOP=$(CDE_CONFIGURATION_TOP) +PROGRAMS = CallDataTest4 CallbackTest2 DtCursorTest2 DtWsTest1 \ + EventHandlerTest ListBounds1 ListItemPos1 ListPosSel1 PopupTest \ + SelBoxResTest SessionTest TextCutBuf1 TextDisp1 TextFXYPos1 \ + TransEventTest TransTest1 WorkProcTest1 XdrawTest crMovesText1 -CppSourceFile(CallDataTest4,CallDataTest4.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(CallbackTest2,CallbackTest2.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(DtCursorTest2,DtCursorTest2.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(DtWsTest1,DtWsTest1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(EventHandlerTest,EventHandlerTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(ListBounds1,ListBounds1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(ListItemPos1,ListItemPos1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(ListPosSel1,ListPosSel1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(PipeTest,PipeTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(PopupTest,PopupTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(SelBoxResTest,SelBoxResTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(SessionTest,SessionTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(TextCutBuf1,TextCutBuf1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(TextDisp1,TextDisp1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(TextFXYPos1,TextFXYPos1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(TransEventTest,TransEventTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(TransTest1,TransTest1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(WorkProcTest1,WorkProcTest1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(XCursorTest1,XCursorTest1.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(XdrawTest,XdrawTest.src,$(LOCAL_CPP_DEFINES),) -CppSourceFile(crMovesText1,crMovesText1.src,$(LOCAL_CPP_DEFINES),) +all:: $(PROGRAMS) -all:: +CppScriptTarget(CallDataTest4,CallDataTest4.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(CallbackTest2,CallbackTest2.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(DtCursorTest2,DtCursorTest2.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(DtWsTest1,DtWsTest1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(EventHandlerTest,EventHandlerTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(ListBounds1,ListBounds1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(ListItemPos1,ListItemPos1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(ListPosSel1,ListPosSel1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(PopupTest,PopupTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(SelBoxResTest,SelBoxResTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(SessionTest,SessionTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(TextCutBuf1,TextCutBuf1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(TextDisp1,TextDisp1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(TextFXYPos1,TextFXYPos1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(TransEventTest,TransEventTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(TransTest1,TransTest1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(WorkProcTest1,WorkProcTest1.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(XdrawTest,XdrawTest.src,$(LOCAL_CPP_DEFINES),) +CppScriptTarget(crMovesText1,crMovesText1.src,$(LOCAL_CPP_DEFINES),) diff --git a/cde/programs/dtksh/examples/ListBounds1.src b/cde/programs/dtksh/examples/ListBounds1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/ListItemPos1.src b/cde/programs/dtksh/examples/ListItemPos1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/ListPosSel1.src b/cde/programs/dtksh/examples/ListPosSel1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/PipeTest.src b/cde/programs/dtksh/examples/PipeTest.src deleted file mode 100755 index 06e5bcd3f..000000000 --- a/cde/programs/dtksh/examples/PipeTest.src +++ /dev/null @@ -1,43 +0,0 @@ -XCOMM! CDE_INSTALLATION_TOP/bin/dtksh -XCOMM $XConsortium: PipeTest.src /main/3 1996/04/23 20:18:30 drk $ - -XCOMM ######################################################################### -XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company -XCOMM (c) Copyright 1993, 1994 International Business Machines Corp. -XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc. -XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of -XCOMM Novell, Inc. -XCOMM ######################################################################### - - -XCOMM -XCOMM This sample shell script demonstrates some of the more advanced features -XCOMM of dtksh. It shows how a structure can be defined and accessed, and -XCOMM how a C library function can be called. -XCOMM - -XCOMM Define a structure made up of 2 integer fields: pipe_in and pipe_out -struct pipe_fds pipe_in:int pipe_out:int -typedef 'struct pipe_fds *' pipe_fds_ptr - -echo "Test 1" -XCOMM Malloc space for the structure, and initialize the fields -call -F nop '@pipe_fds_ptr:{0,0}' -PIPE_FDS=$RET -XCOMM Call the pipe(2) kernel intrinsic -call pipe $PIPE_FDS -RESULT=$RET -XCOMM Print the values of the fields in the structure -call strprint pipe_fds_ptr $PIPE_FDS -echo RESULT = $RESULT -echo - -XCOMM Repeat the test, to make sure we get different file descriptors -echo "Test 2" -call -F nop '@pipe_fds_ptr:{0,0}' -PIPE_FDS=$RET -call pipe $PIPE_FDS -RESULT=$RET -call strprint pipe_fds_ptr $PIPE_FDS -echo RESULT = $RESULT -echo diff --git a/cde/programs/dtksh/examples/PopupTest.src b/cde/programs/dtksh/examples/PopupTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/SelBoxResTest.src b/cde/programs/dtksh/examples/SelBoxResTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/SessionTest.src b/cde/programs/dtksh/examples/SessionTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/TextCutBuf1.src b/cde/programs/dtksh/examples/TextCutBuf1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/TextDisp1.src b/cde/programs/dtksh/examples/TextDisp1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/TextFXYPos1.src b/cde/programs/dtksh/examples/TextFXYPos1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/TransEventTest.src b/cde/programs/dtksh/examples/TransEventTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/TransTest1.src b/cde/programs/dtksh/examples/TransTest1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/WorkProcTest1.src b/cde/programs/dtksh/examples/WorkProcTest1.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/examples/XCursorTest1.src b/cde/programs/dtksh/examples/XCursorTest1.src deleted file mode 100755 index 622d8e375..000000000 --- a/cde/programs/dtksh/examples/XCursorTest1.src +++ /dev/null @@ -1,63 +0,0 @@ -XCOMM! CDE_INSTALLATION_TOP/bin/dtksh -XCOMM $XConsortium: XCursorTest1.src /main/3 1996/04/23 20:19:21 drk $ - -XCOMM ######################################################################### -XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company -XCOMM (c) Copyright 1993, 1994 International Business Machines Corp. -XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc. -XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of -XCOMM Novell, Inc. -XCOMM ######################################################################### - - -XCOMM -XCOMM This sample shell script demonstrates how the 'call' command can be used -XCOMM to obtain an 'X' cursor, and then how that cursor can be set for a -XCOMM widget hierarchy. -XCOMM - -XCOMM Pushbutton Callback: set the cursor for the widget hierarchy -DefineCursor() -{ - XDefineCursor $(XtDisplay "-" $TOPLEVEL) $(XtWindow "-" $TOPLEVEL) $CURSOR -} - -XCOMM Pushbutton Callback: unset the cursor for the widget hierarchy -UndefineCursor() -{ - XUndefineCursor $(XtDisplay "-" $TOPLEVEL) $(XtWindow "-" $TOPLEVEL) -} - -XCOMM ###################### Create the Main UI ############################### - -XtInitialize TOPLEVEL xCursorTest XCursorTest "$0" "$@" -XtSetValues $TOPLEVEL allowShellResize:True - -XtCreateManagedWidget DA da XmDrawingArea $TOPLEVEL -XtSetValues $DA height:200 width:200 - -XtRealizeWidget $TOPLEVEL - -XtCreateApplicationShell TOPLEVEL2 xCursorTesta TopLevelShell - -XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \ - orientation:HORIZONTAL \ - numColumns:2 \ - packing:PACK_COLUMN - -XtCreateManagedWidget PB1 pb1 XmPushButton $RC \ - labelString:"Define Cursor" -XtAddCallback $PB1 activateCallback "DefineCursor" - -XtCreateManagedWidget PB2 pb2 XmPushButton $RC \ - labelString:"Undefine Cursor" -XtAddCallback $PB2 activateCallback "UndefineCursor" - -XCOMM Call the X function for getting a cursor -call XCreateFontCursor $(XtDisplay "-" $TOPLEVEL) 10 -CURSOR=$RET -echo "Cursor = "$CURSOR - -XtRealizeWidget $TOPLEVEL2 - -XtMainLoop diff --git a/cde/programs/dtksh/examples/XdrawTest.src b/cde/programs/dtksh/examples/XdrawTest.src old mode 100755 new mode 100644 diff --git a/cde/programs/dtksh/exksh.h b/cde/programs/dtksh/exksh.h deleted file mode 100644 index 01783ff17..000000000 --- a/cde/programs/dtksh/exksh.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: exksh.h /main/3 1995/11/01 15:54:01 rswiston $ */ -/* "%W%" */ - -/* Copyright (c) 1991, 1992 UNIX System Laboratories, Inc. */ -/* All Rights Reserved */ - -/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF */ -/* UNIX System Laboratories, Inc. */ -/* The copyright notice above does not evidence any */ -/* actual or intended publication of such source code. */ - -#ifndef _Dtksh_exksh_h -#define _Dtksh_exksh_h - -#include - -#ifndef SYMS_ONLY - -#define SH_FAIL 1 -#define SH_SUCC 0 - -#define PRSYMBOLIC 1 -#define PRMIXED 2 -#define PRDECIMAL 4 -#define PRHEX 8 -#define PRMIXED_SYMBOLIC 16 -#define PRNAMES 32 - -#define UPP(CH) (islower(CH) ? toupper(CH) : (CH)) -#define C_PAIR(STR, CH1, CH2) (((STR)[0] == (CH1)) && ((STR)[1] == (CH2))) -#define XK_USAGE(X) return(xk_usage(X), SH_FAIL); - -/* In the future, this will require following pointers, unless we -** can always trace back types to typedefs. For example, unsigned long is -** a typedef, but it is simple because it is really just a long. -*/ -#define IS_SIMPLE(TBL) ((TBL)->flags & F_SIMPLE) - -#ifndef N_DEFAULT /* From name.h */ -/* Stolen out of include/name.h, the problems of including things -** out of the ksh code is major. Hence, the copy rather than the -** include. -*/ - -struct Bfunction { - long (*f_vp)(); /* value function */ - long (*f_ap)(); /* assignment function */ -}; - -#endif /* N_DEFAULT: From name.h */ - -#define ALLDATA INT_MAX - -#define BIGBUFSIZ (10 * BUFSIZ) - -#define IN_BAND 1 -#define OUT_BAND 2 -#define NEW_PRIM 4 - -struct fd { - int vfd; - int flags; - char mode; - struct strbuf *lastrcv; - int rcvcount; - int sndcount; - int uflags; -}; - -struct vfd { - int fd; -}; - -extern struct fd *Fds; -extern struct vfd *Vfds; - -struct libdesc { - char *name; - void *handle; -}; -struct libstruct { - char *prefix; - int nlibs; - struct libdesc *libs; -}; - - -#ifndef OSI_LIB_CODE -#define PARPEEK(b, s) (((b)[0][0] == s[0]) ? 1 : 0 ) -#define PAREXPECT(b, s) (((b)[0][0] == s[0]) ? 0 : -1 ) -#define OFFSET(T, M) ((int)(&((T)NULL)->M)) - -typedef char *string_t; - -/* - * Structures for driving generic print/parse/copy/free routines - */ - -typedef struct memtbl { - char *name; /* name of the member */ - char *tname; /* name of the typedef */ - char kind; /* kind of member, see #defines below */ - char flags; /* flags for member, see #defines below */ - short tbl; /* -1 or index into ASL_allmems[] array */ - short ptr; /* number of "*" in front of member */ - short subscr; /* 0 if no subscript, else max number of elems */ - short delim; /* 0 if no length delim, +1 if next field, -1 if prev */ - short id; /* Id of the ASL in which this def is made */ - short offset; /* offset into the C structure */ - short size; /* size of this member, for easy malloc'ing */ - long choice; /* def of tag indicating field chosen for unions */ -} memtbl_t; - -struct envsymbols { - char *name; - int id; - int (*parsefunc)(); - int (*printfunc)(); - char *tname; - int intlike; - int string; - int topptr; - int valbits; - struct { - char *name; - unsigned long val; - int cover; - } vals[64]; -}; - - -/* - * Definitions for the kind field of the above structure - */ - -#define K_CHAR (0) /* char or unchar */ -#define K_SHORT (1) /* short or ushort */ -#define K_INT (2) /* int or uint */ -#define K_LONG (3) /* long, unsigned long, PRIM, etc. */ -#define K_STRING (4) /* char * or char [] */ -#define K_OBJID (5) /* objid_t *, note the star is included */ -#define K_ANY (6) /* any_t */ -#define K_STRUCT (7) /* struct { } */ -#define K_UNION (8) /* union { } */ -#define K_TYPEDEF (9) /* typedef */ -#define K_DSHORT (10) /* short delimiter */ -#define K_DINT (11) /* int delimiter */ -#define K_DLONG (12) /* long delimiter */ - -/* - * Definitions for the flags field of the above structure, bitmask - */ - -#define F_SIMPLE (1) /* simple, flat type */ -#define F_FIELD (2) /* memtbl is a field of a structure, not the - name of a type */ -#define F_TBL_IS_PTR (4) /* tbl field is pointer, not number; */ -#define F_TYPE_IS_PTR (8) /* type is built-in, but is already a pointer, like K_STRING */ - -#define SUCCESS 0 -#define FAIL (-1) - -#define TRUE 1 -#define FALSE 0 - -/* The following macro, RIF, stands for Return If Fail. Practically - * every line of encode/decode functions need to do this, so it aids - * in readability. - */ -#define RIF(X) do { if ((X) == FAIL) return(FAIL); } while(0) - -#endif /* not OSI_LIB_CODE */ - -#if !defined(OSI_LIB_CODE) || defined(NEED_SYMLIST) -struct symlist { - struct memtbl tbl; - int isflag; - int nsyms; - struct symarray *syms; -}; -#endif - -#define DYNMEM_ID (1) -#define BASE_ID (2) - -#define ALTPUTS(STR) puts(STR) - -#ifndef NULL -#define NULL (0) -#endif - -#ifdef SPRINTF_RET_LEN -#define lsprintf sprintf -#endif - -#define MAX_CALL_ARGS 15 - -#define TREAT_SIMPLE(TBL) ((TBL)->ptr || IS_SIMPLE(TBL)) - -#ifdef EXKSH_INCLUDED -#define XK_PRINT(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) (_Delim = 0, xk_print(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) -#define XK_PARSE(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7) (_Delim = 0, xk_parse(ARG1, ARG2, ARG3, ARG4, ARG5, ARG6, ARG7)) -#define XK_FREE(ARG1, ARG2, ARG3, ARG4, ARG5) (_Delim = 0, xk_free(ARG1, ARG2, ARG3, ARG4, ARG5)) -#endif - -#define NOHASH 1 -#define TYPEONLY 2 -#define STRUCTONLY 4 - -#endif /* not SYMS_ONLY */ - -struct symarray { - const char *str; - unsigned long addr; -}; - -#endif /* _Dtksh_exksh_h */ -/* DON'T ADD ANYTHING AFTER THIS #endif */ diff --git a/cde/programs/dtksh/extra.c b/cde/programs/dtksh/extra.c index 28c40f309..a69ac0a61 100644 --- a/cde/programs/dtksh/extra.c +++ b/cde/programs/dtksh/extra.c @@ -70,7 +70,7 @@ int ksh_eval( char *cmd ) { - sh_eval(sfopen(NIL(Sfile_t*),cmd,"s"),0); + sh_eval(sfopen(NIL(Sfio_t*),cmd,"s"),0); sfsync(sh.outpool); return(sh.exitval); } @@ -154,3 +154,73 @@ printerrf( else printf("%s\n", buf); } + +/**************************************************************************** + * + * The following two functions are ugly, but necessary. Ksh reserves file + * descriptors 0 - 9 for use by shell scripts, and has intimate knowledge + * of how and when they were opened. Unfortunately, certain dtksh functions + * (XtInitialize, catopen, ttdt_open, _DtActionInvoke, others) open file + * descriptors which are not known to ksh. We can't let these file + * descriptors fall in the 0 - 9 range, because we can't afford to have + * the shell script overriding our file descriptors. Therefore, any of + * our commands which open files must first lock our file descriptors 0 - 9, + * thus forcing the command to get a file descriptor out of the shell's + * range. After the command has opened its file descriptor, it then needs + * to unlock file descriptors 0 - 9, so that the shell script will have + * access to them again. + * + **************************************************************************/ + + +/* + * Return a list of the file descriptors we had to open, to lock out file + * descriptors 0 - 9; this list should be freed (and the file descriptors + * closed) by calling UnlockkshFileDescriptors(). + */ + +int *LockKshFileDescriptors(void) +{ + int * fdList; + int i; + int fd, newfd; + + fdList = (int *)malloc(sizeof(int) * 10); + for (i = 0; i < 10; i++) + fdList[i] = -1; + + if ((fd = open("/dev/null", O_RDONLY)) >= 0) + { + if (fd < 10) + { + fdList[0] = fd; + for (i = 1; i < 10; i++) + { + if ((newfd = dup(fd)) < 10) + fdList[i] = newfd; + else + { + close(newfd); + break; + } + } + } + else + close(fd); + } + + return(fdList); +} + +void UnlockKshFileDescriptors(int *fdList) +{ + int i; + + for (i = 0; i < 10; i++) + { + if (fdList[i] != (-1)) + close(fdList[i]); + } + + free((char *)fdList); +} diff --git a/cde/programs/dtksh/findsym.c b/cde/programs/dtksh/findsym.c index 8f9396661..097c5804a 100644 --- a/cde/programs/dtksh/findsym.c +++ b/cde/programs/dtksh/findsym.c @@ -30,74 +30,42 @@ /* The copyright notice above does not evidence any */ /* actual or intended publication of such source code. */ +#include "shell.h" #include "stdio.h" #include -#ifdef DYNLIB #ifdef __aix #include #else #include #endif -/* from ksh93/include/ast/shell.h */ -extern void **sh_getliblist(void); -#endif -#ifdef HPUX_DYNLIB -#include -#endif #include #include #include -#include "xmdtksym.h" #include "msgs.h" /* * This function is currently only used to locate a widget class record, - * as requested by a DtLoadWidget request. In the future, if the exksh - * commands are ever added back in, then it will also need to be able - * to locate any arbitrary symbol. + * as requested by a DtLoadWidget request. */ -unsigned long +void * fsym( char *str, int lib ) { -#ifdef DYNLIB - void ** liblist; int i = 0; - long addr; -#endif -#ifdef HPUX_DYNLIB - void *found; - shl_t handle; -#endif + void * addr; -#ifdef DYNLIB - if ((liblist = sh_getliblist()) == NULL) - return(NULL); - - while (liblist[i]) + if (liblist == NULL) + return (NULL); + while (liblist[i].dll) { - if (addr = dlsym(liblist[i], str)) - return((unsigned long)addr); + if (addr = dlsym(liblist[i].dll, str)) + return(addr); i++; } -#else -#ifdef HPUX_DYNLIB - handle = NULL; - if ((shl_findsym(&handle, str, TYPE_PROCEDURE, &found)) == 0) - return((unsigned long) found); - if ((shl_findsym(&handle, str, TYPE_DATA, &found)) == 0) - return((unsigned long) found); - handle = PROG_HANDLE; - if ((shl_findsym(&handle, str, TYPE_PROCEDURE, &found)) == 0) - return((unsigned long) found); - if ((shl_findsym(&handle, str, TYPE_DATA, &found)) == 0) - return((unsigned long) found); -#endif -#endif return(0); } diff --git a/cde/programs/dtksh/init.patch b/cde/programs/dtksh/init.patch new file mode 100644 index 000000000..c0bf6cd69 --- /dev/null +++ b/cde/programs/dtksh/init.patch @@ -0,0 +1,47 @@ +--- ./ksh93/src/cmd/ksh93/sh/init.c 2021-01-16 15:27:03.589079734 -0600 ++++ init.c 2021-01-16 15:53:50.700864511 -0600 +@@ -48,6 +48,28 @@ + #include "lexstates.h" + #include "version.h" + ++#ifdef BUILD_DTKSH ++#include
++#include
++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "dtksh.h" ++#include "xmksh.h" ++#include "dtkcmds.h" ++#include "xmcvt.h" ++#include "widget.h" ++#include "extra.h" ++#include "xmwidgets.h" ++#include "msgs.h" ++#endif ++ + #if _hdr_wctype + #include + #include +@@ -1481,6 +1503,16 @@ + shp->exittrap = 0; + shp->errtrap = 0; + shp->end_fn = 0; ++#ifdef BUILD_DTKSH ++ int * lockedFds = LockKshFileDescriptors(); ++ (void) XtSetLanguageProc((XtAppContext)NULL, (XtLanguageProc)NULL, ++ (XtPointer)NULL); ++ DtNlInitialize(); ++ _DtEnvControl(DT_ENV_SET); ++ UnlockKshFileDescriptors(lockedFds); ++ ++ dtksh_init(); ++#endif + return(shp); + } diff --git a/cde/programs/dtksh/ksh93/Imakefile b/cde/programs/dtksh/ksh93/Imakefile deleted file mode 100644 index 91e6f1aeb..000000000 --- a/cde/programs/dtksh/ksh93/Imakefile +++ /dev/null @@ -1,73 +0,0 @@ -XCOMM $XConsortium: Imakefile /main/7 1996/05/09 17:33:38 drk $ -LOCAL_LIBRARIES = -SRCS = -SUBCFLAGS = -O -UFLAGS = $(SUBCFLAGS) -ULDFLAGS = -IFFECDEBUGFLAGS = -O0 - -#ifdef RsArchitecture -CCFLAGS = CCFLAGS=" " -#else -CCFLAGS = -#endif - -#ifdef SunArchitecture -.NO_PARALLEL: -#endif /* SunArchitecture */ - -FORCE_SHIP = -F - -MALLOCOBJ = - -KSHSRC = ./src/cmd/ksh93 - -KSHLIBS = \ - $(KSHSRC)/../../lib/libcmd/libcmd.a - -KSH_OBJS = \ - $(KSHSRC)/main.o \ - $(KSHSRC)/timers.o \ - $(KSHLIBS) - -OBJS = $(KSH_OBJS) $(KSH_LIBS) - -SUIDEXECDEFINES = \ - -DPROFILEPATH=\"$(CDE_CONFIGURATION_TOP)/config/profile\" \ - -DSUIDPROFILEPATH=\"$(CDE_CONFIGURATION_TOP)/config/suid_profile\" \ - -DSUIDEXECPATH=\"$(CDE_INSTALLATION_TOP)/bin/suid_exec\" \ - -DCDE_INSTALLATION_TOP=\"$(CDE_INSTALLATION_TOP)\" - -CCFLAGS = $(CDEBUGFLAGS) $(SUIDEXECDEFINES) $(STD_DEFINES) $(ANSI_DEFINES) -ICCFLAGS = $(IFFECDEBUGFLAGS) $(STD_DEFINES) $(ANSI_DEFINES) - -all:: ksh93src ksh93.o - -XCOMM -XCOMM A temporary hack until we get Imakefiles in the base of ksh-93. -XCOMM -XCOMM We test for presense of /bin/ksh because on HP/UX there is a -XCOMM limitation in the size of environment variables that prevents the -XCOMM ksh-93 build scripts from functioning. That will be worked around -XCOMM in a near future release of ksh-93 as well, but then again this -XCOMM whole target will change anyway. -XCOMM - -SHIP_DIR = ship -ALL_SUBS = * - -ksh93src: - $(RM) $(SHIP_DIR)/$(ALL_SUBS)/$(ALL_SUBS)/BUILT; \ - SHELL=$(KORNSHELL) CC="$(CC)" CCFLAGS="$(CCFLAGS)" ICCFLAGS="$(ICCFLAGS)" $(KORNSHELL) ship/shipin $(FORCE_SHIP) - -ksh93.o: $(OBJS) - $(LD) -r -o $@ $(OBJS) - -clobber:: clobmine - -clobmine: - $(RM) -f libksh93.a - -depend:: - -install:: diff --git a/cde/programs/dtksh/ksh93/ship/README b/cde/programs/dtksh/ksh93/ship/README deleted file mode 100644 index 81894296e..000000000 --- a/cde/programs/dtksh/ksh93/ship/README +++ /dev/null @@ -1,154 +0,0 @@ -/* $XConsortium: README /main/2 1996/07/15 14:13:29 drk $ */ -Software shipment information. [better documentation forthcoming ...] - -All files and directories, except for those in /var/spool/uucppublic, -are rooted at the shipment/installation directory named by -$INSTALLROOT. The $INSTALLROOT hierarchy is similar to the System V -/usr hierarchy. - -The $INSTALLROOT/ship subdirectory is automatically maintained by -shipin and shipout. If you expect to receive future shipments then -do not change files in this directory. - -pax is the Bell Labs implementation of the proposed POSIX (01/90) -portable archive interchange command. The default output format is -`cpio -c'. The pax delta format is a Bell Labs extension. - -The following assumes: - - INSTALLROOT= - -After each shipment: - - - cd $INSTALLROOT - ship/shipin - -`ship/shipin -n' shows actions but does not unbundle or build. -`ship/shipin -s ' unbundles from rather than /var/spool/uucppublic. -`ship/shipin -u' unbundles the shipment but does not build. -`ship/shipin -i' copies from spool area but does not unbundle or build. -`ship/shipin -E' rebuild components that failed last time (use after fixes). - -Any non-option arguments to shipin are passed as arguments to the -generating make or shell script for each component. - -To pass the shipment to another machine (requires ksh): - - # rcp # TO=host:ship - # uucp # TO=machine!user - # list of files # TO=%list - # remote dk pull script # TO=%pull - cd $INSTALLROOT - ship/shipin -i # if not installed on this machine - cd ship - shipout $TO - -{rcp,uucp} initiate copies whereas {list,pull} generate information on -stdout. {uucp} copies to an intermediate spool area on the other machine -whereas {rcp,list,pull} are relative to $INSTALLROOT on the other machine. - -To copy a command from $INSTALLROOT to a new root you must copy: - - $INSTALLROOT/bin/ - $INSTALLROOT/lib/ - -to the new root directory for all interdependent 's. Depending on -, only one of the above files/directories may exist. - -Be sure to maintain a different $INSTALLROOT for each machine architecture. -If the same $INSTALLROOT/ship must be reused for a different architecture -then delete everything except ship from $INSTALLROOT and run ship/shipin -F. -An alternative would be to use nmake and optionally 3d to viewpath a new -architecture hierarchy on top of $INSTALLROOT. In this case nmake would -be run from within the $INSTALLROOT/src/(cmd|lib) hierarchy. - -The files below may appear on the shipment side, the installation side, -or both. and are defined in the -shipment mail announcement. - -Each shipment is identified by a two part version number [R]YYMMDD - - R release -- if specified then it must match for compatibility - YYMMDD shipment year, month and day number - -/var/spool/uucppublic// directory hierarchy: - - . shipment control directory - ./manifest list of all files in shipment - -$INSTALLROOT directory hierarchy: - - bin/ executable binaries and scripts - include/ common header files - lib/ object archives a common data - man/ man page subtree - man1/ command man pages - man3/ library man pages - man8/ adminstration and maintenance man pages - src/ source subtree - cmd/ command source - lib/ library source - ship/ shipment and installation info - -$INSTALLROOT/ship contents: - - README installation info - ! shipment installation message for machine!user - ship.body optional shipment announcement main body - ship.head optional shipment announcement header - ship.tail optional shipment announcement trailer - shipcost show relative cost of delta/update shipment - shipcrate crate all components for shipout - shipin unbundle, build and install shipment - shiplist shipout using name-tool list - shipop shipin/shipout support executable - shipout split and send shipment - shipslog shipment log and recipient address info - shipswab clean old stuff from the ship area - shipyard shipment support tools component name - lib* library components - * command components - -$INSTALLROOT/ship/ contents: - - <[R]YYMMDD> information for the <[R]YYMMDD> shipment - base link to the newest pax base archive - delta link to the newest pax delta archive - in.log shipin log - items required components (excluding this one) - list optional list of persons to send to - message optional message to include in shipment announcement - owner mail address for installation report - release the the current shipment release number - report optional list of $INSTALLROOT relative files to report - -$INSTALLROOT/ship//<[R]YYMMDD> contents: - - <[R]YYMMDD> pax delta archive for ../[R]YYMMDD/base - <[R]YYMMDD>. delta archive split for uucp - BUILT present if release build succeeded - ERROR present if release build failed - GENERATED present if base archive was generated from a delta - UNCRATED present if release uncrate succeeded - base pax base archive - base. base archive split for uucp - items items for this release - message message for this release - owner owner for this release - report report for this release - -Each component $NAME is extracted into either $INSTALLROOT/src/lib/$NAME -or $INSTALLROOT/src/cmd/$NAME. The following are attempted, in order, -to build and install $NAME under $INSTALLROOT: - - $INSTALLROOT/bin/nmake -f Makefile install - mamexec install < Mamfile # mamexec is built into ship/shipin - make -f makefile install - sh Makescript - -where Mamfile, Makescript and makefile are usually generated from the -corresponding nmake Makefile. - - Glenn Fowler ulysses!gsf - David Korn ulysses!dgk diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/930519/base b/cde/programs/dtksh/ksh93/ship/ksh93/930519/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/930519/copyright b/cde/programs/dtksh/ksh93/ship/ksh93/930519/copyright deleted file mode 100644 index 2f17b10b2..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/930519/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{ulysses,attmail}!dgk -dgk@ulysses.att.com -David Korn 908-582-7975 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/930519/items b/cde/programs/dtksh/ksh93/ship/ksh93/930519/items deleted file mode 100644 index bc0708727..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/930519/items +++ /dev/null @@ -1 +0,0 @@ -libcmd libast diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/930519/owner b/cde/programs/dtksh/ksh93/ship/ksh93/930519/owner deleted file mode 100644 index fe2fd3391..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/930519/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!dgk diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950619/UNCRATED b/cde/programs/dtksh/ksh93/ship/ksh93/950619/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950619/base b/cde/programs/dtksh/ksh93/ship/ksh93/950619/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950619/copyright b/cde/programs/dtksh/ksh93/ship/ksh93/950619/copyright deleted file mode 100644 index 2f17b10b2..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950619/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{ulysses,attmail}!dgk -dgk@ulysses.att.com -David Korn 908-582-7975 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950619/items b/cde/programs/dtksh/ksh93/ship/ksh93/950619/items deleted file mode 100644 index bc0708727..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950619/items +++ /dev/null @@ -1 +0,0 @@ -libcmd libast diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950619/owner b/cde/programs/dtksh/ksh93/ship/ksh93/950619/owner deleted file mode 100644 index fe2fd3391..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950619/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!dgk diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/UNCRATED b/cde/programs/dtksh/ksh93/ship/ksh93/950807/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/base b/cde/programs/dtksh/ksh93/ship/ksh93/950807/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/copyright b/cde/programs/dtksh/ksh93/ship/ksh93/950807/copyright deleted file mode 100644 index 4274c7e18..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{research,attmail}!dgk -dgk@research.att.com -David Korn 908-582-7975 diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/items b/cde/programs/dtksh/ksh93/ship/ksh93/950807/items deleted file mode 100644 index bc0708727..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/items +++ /dev/null @@ -1 +0,0 @@ -libcmd libast diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/message b/cde/programs/dtksh/ksh93/ship/ksh93/950807/message deleted file mode 100644 index b3ff1a69c..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/message +++ /dev/null @@ -1,32 +0,0 @@ -The is the fourth point release for ksh-93. The RELEASEa -file contains a list of changes since the first release for ksh-93. -The file RELEASE lists the major changes since ksh-88. I have updated -the man page, sh.1, and the introductory memo, sh.memo. I have also -started to write a guideline for adding runtime builtins, builtins.mm. -This release should correspond very closely to the information in the -New KornShell Command and Programming Language book, by Bolsky -and Korn. - -This official release is being distributed and supported by the -Software Technology Center. They are the distributor of -ksh93 within AT&T and will provide support. I will only be -supplying ksh93 for research needs and for machine architectures -that are not supported by the Software Technology Center. -You can contact the STC by sending mail to ksh@mozart.att.com. - -I have fixed most of the bugs that have been reported in -the previous release. Let me know about any remaining bugs. - -There continues to be very few reports of compatibility -problems. The file COMPATIBILITY lists the known incompatibilities. -Please let me know about any script which runs under ksh-88 but -does not run under ksh-93. - -Please look at the man page (troff -man) and the sh.memo -file (troff -mm) and let me know what problems you find. - -I encourage you to run ksh -n script on each of your scripts -since the -n option produces warning messages for obsolete -features that you are using in the script. The file -OBSOLETE, written by Kevin Wall, contains a list of -obsolete features. diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/owner b/cde/programs/dtksh/ksh93/ship/ksh93/950807/owner deleted file mode 100644 index 42d7a55dc..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/owner +++ /dev/null @@ -1 +0,0 @@ -dgk diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/promo b/cde/programs/dtksh/ksh93/ship/ksh93/950807/promo deleted file mode 100644 index ac25656f4..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/promo +++ /dev/null @@ -1,146 +0,0 @@ -.SA 1 -.sp 2 -.H 1 "KSH-93 - The KornShell Command and Programming Language" -.sp 2 -.al -.P -KSH-93 is the most recent version of the KornShell Language -described in -"The KornShell Command and Programming Language," -by Morris Bolsky and David Korn of AT&T Bell Laboratories. -The KornShell is a shell programming language, -which is upward compatible with "sh" (the Bourne Shell), -and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and -Utilities standard. -KSH-93 provides an enhanced programming environment in -addition to the major command-entry features of the BSD -shell "csh". With KSH-93, medium-sized programming tasks can be -performed at shell-level without a significant loss in performance. -In addition, "sh" scripts can be run on KSH-93 without modification. -.P -The code should conform to the IEEE POSIX 1003.1 standard and to the -proposed ANSI-C standard so that it should be portable to all -such systems. Like the previous version, KSH-88, -it is designed to accept eight bit character sets -transparently, thereby making it internationally compatible. -It can support multi-byte characters sets with some characteristics -of the character set given at run time. -.P -KSH-93 provides the following features, many of which were also inherent -in KSH-88: -.BL -.LI -Enhanced Command Re-entry Capability: The KSH-93 history -function records commands entered at any shell level and stores -them, up to a user-specified limit, even after you log off. -This allows you to re-enter long commands with a few keystrokes -- even those commands you entered yesterday. -The history file allows for eight bit characters in -commands and supports essentially unlimited size histories. -.LI -In-line Editing: In "sh", the only way to fix mistyped -commands is to backspace or retype the line. KSH-93 allows you -to edit a command line using a choice of EMACS-TC or "vi" -functions. -You can use the in-line editors to complete filenames as -you type them. -You may also use this editing feature when entering -command lines from your history file. -A user can capture keystrokes and rebind keys to customize the -editing interface. -.LI -Extended I/O Capabilities: KSH-93 provides several I/O -capabilities not available in "sh", including the ability to: -.BL -.LI -specify a file descriptor for input and output -.LI -start up and run co-processes -.LI -produce a prompt at the terminal before a read -.LI -easily format and interpret responses to a menu -.LI -echo lines exactly as output without escape processing -.LI -format output using printf formats. -.LI -read and echo lines ending in "\e". -.LE -.LI -Improved performance: KSH-93 executes many scripts faster -than the System V Bourne shell. A major reason for this is -that many of the standard utilities are built-in. -To reduce the time to initiate a command, KSH-93 allows -commands to be added as built-ins at run time -on systems that support dynamic loading such as System V Release 4. -.LI -Arithmetic: KSH-93 allows you to do integer arithmetic in any -base from two to sixty-four. You can also do double -precision floating point arithmetic. -Almost the complete set of C language operators are available -with the same syntax and precedence. -Arithmetic expressions can be used to as an argument expansion -or as a separate command. -In addition there is an arithmetic for command that works -like the for statement in C. -.LI -Arrays: KSH-93 supports both indexed and associative arrays. -The subscript for an indexed array is an arithmetic expression, -whereas, the subscript for an associative array is a string. -.LI -Shell Functions and Aliases: Two mechanisms - functions and -aliases - can be used to assign a user-selected identifier to -an existing command or shell script. -Functions allow local variables and provide scoping -for exception handling. -Functions can be searched for and loaded on first reference the -way scripts are. -.LI -Substring Capabilities: KSH-93 allows you to create a -substring of any given string either by specifying the starting -offset and length, or by stripping off leading -or trailing substrings during parameter substitution. -You can also specify attributes, such as upper and lower case, -field width, and justification to shell variables. -.LI -More pattern matching capabilities: KSH-93 allows you to specify -extended regular expressions for file and string matches. -.LI -KSH-93 uses a hierarchal name space for variables. -Compound variables can be defined and variables can -be passed by reference. In addition, each variable -can have one or more disciplines associated with -it to intercept assignments and references. -.LI -Improved debugging: KSH-93 can generate line numbers on execution -traces. Also, I/O redirections are now traced. -There is a DEBUG trap that gets evaluated after each command -so that errors can be localized. -.LI -Job Control: On systems that support job control, including -System V Release 4, KSH-93 -provides a job-control mechanism almost identical to that of -the BSD "csh", version 4.1. -This feature allows you -to stop and restart programs, and to move programs between the -foreground and the background. -.LI -Added security: -KSH-93 can execute scripts which do not have read permission -and scripts which have the setuid and/or setgid set when -invoked by name, rather than as an argument to the shell. -It is possible to log or control the execution of setuid and/or -setgid scripts. -The noclobber option prevents you from accidentally erasing -a file by redirecting to an existing file. -.LI -KSH-93 can be extended by adding built-in commands at run time. -In addition, KSH-93 can be used as a library that can -be embedded into an application to allow scripting. -.LE -Documentation for KSH-93 consists of an "Introduction to KSH-93", -"Compatibility with the Bourne Shell" and a manual page and a -README file. In addition, the "New KornShell Command and Programming -Language," book is available from Prentice Hall. - diff --git a/cde/programs/dtksh/ksh93/ship/ksh93/950807/report b/cde/programs/dtksh/ksh93/ship/ksh93/950807/report deleted file mode 100644 index d844d7101..000000000 --- a/cde/programs/dtksh/ksh93/ship/ksh93/950807/report +++ /dev/null @@ -1,5 +0,0 @@ -src/cmd/ksh93/FEATURE/options -src/cmd/ksh93/FEATURE/ttys -src/cmd/ksh93/FEATURE/dymamic -src/cmd/ksh93/FEATURE/externs -src/cmd/ksh93/FEATURE/poll diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/UNCRATED b/cde/programs/dtksh/ksh93/ship/lib0ast/950509/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/base b/cde/programs/dtksh/ksh93/ship/lib0ast/950509/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/copyright b/cde/programs/dtksh/ksh93/ship/lib0ast/950509/copyright deleted file mode 100644 index 2f17b10b2..000000000 --- a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{ulysses,attmail}!dgk -dgk@ulysses.att.com -David Korn 908-582-7975 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/items b/cde/programs/dtksh/ksh93/ship/lib0ast/950509/items deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950509/owner b/cde/programs/dtksh/ksh93/ship/lib0ast/950509/owner deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/lib0ast/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/base b/cde/programs/dtksh/ksh93/ship/lib0ast/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/copyright b/cde/programs/dtksh/ksh93/ship/lib0ast/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/items b/cde/programs/dtksh/ksh93/ship/lib0ast/950811/items deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/owner b/cde/programs/dtksh/ksh93/ship/lib0ast/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/lib0ast/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/libAST/930519/UNCRATED b/cde/programs/dtksh/ksh93/ship/libAST/930519/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libAST/930519/base b/cde/programs/dtksh/ksh93/ship/libAST/930519/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libAST/930519/copyright b/cde/programs/dtksh/ksh93/ship/libAST/930519/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/libAST/930519/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libAST/930519/items b/cde/programs/dtksh/ksh93/ship/libAST/930519/items deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libAST/930519/owner b/cde/programs/dtksh/ksh93/ship/libAST/930519/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libAST/930519/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libast/930716/UNCRATED b/cde/programs/dtksh/ksh93/ship/libast/930716/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/930716/base b/cde/programs/dtksh/ksh93/ship/libast/930716/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/930716/copyright b/cde/programs/dtksh/ksh93/ship/libast/930716/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/930716/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libast/930716/items b/cde/programs/dtksh/ksh93/ship/libast/930716/items deleted file mode 100644 index a22cc9071..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/930716/items +++ /dev/null @@ -1 +0,0 @@ -libAST diff --git a/cde/programs/dtksh/ksh93/ship/libast/930716/owner b/cde/programs/dtksh/ksh93/ship/libast/930716/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/930716/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libast/950620/UNCRATED b/cde/programs/dtksh/ksh93/ship/libast/950620/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/950620/base b/cde/programs/dtksh/ksh93/ship/libast/950620/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/950620/copyright b/cde/programs/dtksh/ksh93/ship/libast/950620/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950620/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libast/950620/items b/cde/programs/dtksh/ksh93/ship/libast/950620/items deleted file mode 100644 index d34139bcc..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950620/items +++ /dev/null @@ -1 +0,0 @@ -lib0ast diff --git a/cde/programs/dtksh/ksh93/ship/libast/950620/owner b/cde/programs/dtksh/ksh93/ship/libast/950620/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950620/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libast/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/libast/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/950811/base b/cde/programs/dtksh/ksh93/ship/libast/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libast/950811/copyright b/cde/programs/dtksh/ksh93/ship/libast/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/libast/950811/items b/cde/programs/dtksh/ksh93/ship/libast/950811/items deleted file mode 100644 index d34139bcc..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950811/items +++ /dev/null @@ -1 +0,0 @@ -lib0ast diff --git a/cde/programs/dtksh/ksh93/ship/libast/950811/owner b/cde/programs/dtksh/ksh93/ship/libast/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/libast/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/930527/UNCRATED b/cde/programs/dtksh/ksh93/ship/libcmd/930527/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/930527/base b/cde/programs/dtksh/ksh93/ship/libcmd/930527/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/930527/copyright b/cde/programs/dtksh/ksh93/ship/libcmd/930527/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/930527/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/930527/items b/cde/programs/dtksh/ksh93/ship/libcmd/930527/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/930527/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/930527/owner b/cde/programs/dtksh/ksh93/ship/libcmd/930527/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/930527/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950620/UNCRATED b/cde/programs/dtksh/ksh93/ship/libcmd/950620/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950620/base b/cde/programs/dtksh/ksh93/ship/libcmd/950620/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950620/copyright b/cde/programs/dtksh/ksh93/ship/libcmd/950620/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950620/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950620/items b/cde/programs/dtksh/ksh93/ship/libcmd/950620/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950620/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950620/owner b/cde/programs/dtksh/ksh93/ship/libcmd/950620/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950620/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/libcmd/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950811/base b/cde/programs/dtksh/ksh93/ship/libcmd/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950811/copyright b/cde/programs/dtksh/ksh93/ship/libcmd/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950811/items b/cde/programs/dtksh/ksh93/ship/libcmd/950811/items deleted file mode 100644 index d34139bcc..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950811/items +++ /dev/null @@ -1 +0,0 @@ -lib0ast diff --git a/cde/programs/dtksh/ksh93/ship/libcmd/950811/owner b/cde/programs/dtksh/ksh93/ship/libcmd/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/libcmd/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/930125/UNCRATED b/cde/programs/dtksh/ksh93/ship/libodelta/930125/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/930125/base b/cde/programs/dtksh/ksh93/ship/libodelta/930125/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/930125/copyright b/cde/programs/dtksh/ksh93/ship/libodelta/930125/copyright deleted file mode 100644 index 24958e992..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/930125/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{ulysses,attmail}!advsoft -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/930125/items b/cde/programs/dtksh/ksh93/ship/libodelta/930125/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/930125/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/930125/owner b/cde/programs/dtksh/ksh93/ship/libodelta/930125/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/930125/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950509/UNCRATED b/cde/programs/dtksh/ksh93/ship/libodelta/950509/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950509/base b/cde/programs/dtksh/ksh93/ship/libodelta/950509/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950509/copyright b/cde/programs/dtksh/ksh93/ship/libodelta/950509/copyright deleted file mode 100644 index 24958e992..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950509/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Advanced Software Technology Department -{ulysses,attmail}!advsoft -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950509/items b/cde/programs/dtksh/ksh93/ship/libodelta/950509/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950509/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950509/owner b/cde/programs/dtksh/ksh93/ship/libodelta/950509/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950509/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/libodelta/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950811/base b/cde/programs/dtksh/ksh93/ship/libodelta/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950811/copyright b/cde/programs/dtksh/ksh93/ship/libodelta/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950811/items b/cde/programs/dtksh/ksh93/ship/libodelta/950811/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950811/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libodelta/950811/owner b/cde/programs/dtksh/ksh93/ship/libodelta/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/libodelta/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/UNCRATED b/cde/programs/dtksh/ksh93/ship/libvdelta/950509/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/base b/cde/programs/dtksh/ksh93/ship/libvdelta/950509/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/copyright b/cde/programs/dtksh/ksh93/ship/libvdelta/950509/copyright deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/items b/cde/programs/dtksh/ksh93/ship/libvdelta/950509/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950509/owner b/cde/programs/dtksh/ksh93/ship/libvdelta/950509/owner deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/libvdelta/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/base b/cde/programs/dtksh/ksh93/ship/libvdelta/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/copyright b/cde/programs/dtksh/ksh93/ship/libvdelta/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/items b/cde/programs/dtksh/ksh93/ship/libvdelta/950811/items deleted file mode 100644 index 2822a733b..000000000 --- a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/items +++ /dev/null @@ -1 +0,0 @@ -libast diff --git a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/owner b/cde/programs/dtksh/ksh93/ship/libvdelta/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/libvdelta/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/pax/930716/UNCRATED b/cde/programs/dtksh/ksh93/ship/pax/930716/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/930716/base b/cde/programs/dtksh/ksh93/ship/pax/930716/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/930716/copyright b/cde/programs/dtksh/ksh93/ship/pax/930716/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/930716/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/pax/930716/items b/cde/programs/dtksh/ksh93/ship/pax/930716/items deleted file mode 100644 index 7f8eef32e..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/930716/items +++ /dev/null @@ -1 +0,0 @@ -libodelta libast diff --git a/cde/programs/dtksh/ksh93/ship/pax/930716/owner b/cde/programs/dtksh/ksh93/ship/pax/930716/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/930716/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/pax/950620/UNCRATED b/cde/programs/dtksh/ksh93/ship/pax/950620/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/950620/base b/cde/programs/dtksh/ksh93/ship/pax/950620/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/950620/copyright b/cde/programs/dtksh/ksh93/ship/pax/950620/copyright deleted file mode 100644 index bc3d33f5d..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950620/copyright +++ /dev/null @@ -1,5 +0,0 @@ -AT&T Bell Laboratories -Software Engineering Research Department -advsoft@research.att.com -Randy Hackbarth 908-582-5245 -Dave Belanger 908-582-7427 diff --git a/cde/programs/dtksh/ksh93/ship/pax/950620/items b/cde/programs/dtksh/ksh93/ship/pax/950620/items deleted file mode 100644 index beed98fbb..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950620/items +++ /dev/null @@ -1 +0,0 @@ -libvdelta libodelta libast diff --git a/cde/programs/dtksh/ksh93/ship/pax/950620/owner b/cde/programs/dtksh/ksh93/ship/pax/950620/owner deleted file mode 100644 index bef864759..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950620/owner +++ /dev/null @@ -1 +0,0 @@ -liszt!easy!liszt!easy!usl!att!gryphon!gsf diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/UNCRATED b/cde/programs/dtksh/ksh93/ship/pax/950811/UNCRATED deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/base b/cde/programs/dtksh/ksh93/ship/pax/950811/base deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/copyright b/cde/programs/dtksh/ksh93/ship/pax/950811/copyright deleted file mode 100644 index 9a8022bcd..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950811/copyright +++ /dev/null @@ -1,6 +0,0 @@ -type=proprietary -corporation=AT&T -company="Bell Laboratories" -organization="Software Engineering Research Department" -license=http://www.research.att.com/orgs/ssr/book/reuse -contact=gsf@research.att.com diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/items b/cde/programs/dtksh/ksh93/ship/pax/950811/items deleted file mode 100644 index beed98fbb..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950811/items +++ /dev/null @@ -1 +0,0 @@ -libvdelta libodelta libast diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/owner b/cde/programs/dtksh/ksh93/ship/pax/950811/owner deleted file mode 100644 index 6936b2c4f..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950811/owner +++ /dev/null @@ -1 +0,0 @@ -gsf diff --git a/cde/programs/dtksh/ksh93/ship/pax/950811/promo b/cde/programs/dtksh/ksh93/ship/pax/950811/promo deleted file mode 100644 index 2e9b8766f..000000000 --- a/cde/programs/dtksh/ksh93/ship/pax/950811/promo +++ /dev/null @@ -1,48 +0,0 @@ -.H 1 pax -.B pax -is a POSIX 1003.2 conformant replacement for -.B tar -and -.B cpio -that handles most UNIX archive and tape formats. -.B pax -uses the -.I vdelta -algorithm to construct efficient delta archives that contain bytewise -changes from a given base archive. -.B gzip -and -.B compress -archives are also handled on input and output. -.P -To create a -.I vdelta -compressed base archive: -.EX -tw | pax -w -f base -z - -.EE -To create a delta archive on the base above (record file changes only): -.EX -tw | pax -w -f delta -z base -.EE -To read the delta archive: -.EX -pax -r -f delta -z base -.EE -To create a delta archive from linux-1.2.0 to linux-1.2.5: -.EX -pax -rf linux-1.2.5.tar.gz -wf 0-5.pax.gz -x gzip -z linux-1.2.0.tar.gz -.EE -To create the linux-1.2.5 archive: -.EX -pax -rf 0-5.pax.gz -z linux-1.2.0.tar.gz -wf linux-1.2.5.tar.gz -x tar -x gzip -.EE -The -.B bax -script, shipped with -.BR pax , -combines -.B tw -and -.B pax -for handy backup control. diff --git a/cde/programs/dtksh/ksh93/ship/shipfeature.sh b/cde/programs/dtksh/ksh93/ship/shipfeature.sh deleted file mode 100644 index fc1a26be1..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipfeature.sh +++ /dev/null @@ -1,1131 +0,0 @@ -# $XConsortium: shipfeature.sh /main/2 1995/07/19 17:09:46 drk $ -: -# Glenn Fowler & Phong Vo -# AT&T Bell Laboratories -# -# C feature test support -# @(#)feature (AT&T Bell Laboratories) 03/01/94 -# -# NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt - -command=feature -version=03/01/94 - -binding="-Bdynamic -Bstatic -Wl,-ashared -Wl,-aarchive -call_shared -non_shared" -occ=cc -debug= -defhdr= -deflib= -executable='test -x' -gothdr= -gotlib= -dir=FEATURE -in= -out= -pragma= -case $RANDOM in -$RANDOM)shell=bsh - $executable . 2>/dev/null || executable='test -r' - ;; -*) shell=ksh - ;; -esac -static=. -statictest= -case $COTEMP in -"") case $HOSTNAME in - ""|?|??|???|????|????) - tmp=${HOSTNAME} - ;; - *) case $shell in - ksh) tmp=${HOSTNAME%${HOSTNAME#????}} ;; - *) eval `echo $HOSTNAME | sed 's/\(....\).*/tmp=\1/'` ;; - esac - ;; - esac - tmp=${tmp}$$ - ;; -*) tmp=$COTEMP - ;; -esac -case $tmp in -??????????*) - case $shell in - ksh) tmp=${tmp%${tmp#?????????}} ;; - *) eval `echo $tmp | sed 's/\(.........\).*/tmp=\1/'` ;; - esac - ;; -?????????) - ;; -????????) - tmp=F$tmp - ;; -esac -tmp=./$tmp - -# standard error to /dev/null unless debugging -# standard output to the current output file -# -# stdout original standard output -# stderr original standard error -# nullin /dev/null input -# nullout /dev/null output - -stdout=5 stderr=6 nullin=7 nullout=8 -eval "exec $nullin>/dev/null $nullout>/dev/null $stdout>&1 $stderr>&2 2>&$nullout" - -# options -- `-' for output to stdout otherwise usage - -while : -do case $# in - 0) in=- - break - ;; - esac - case $1 in - -) out=- - ;; - -*) echo "Usage: $command [-] [op [arg ... [-l* *.a *.sh * ...]] [: op ...]" >&$stderr - exit 2 - ;; - *) break - ;; - esac - shift -done - -# tmp files cleaned up on exit -# status: 0:success 1:failure 2:interrupt - -status=2 -trap "rm -f $tmp*.*; exit \$status" 0 1 2 - -# loop on op [ arg [ ... ] ] [ : op [ arg [ ... ] ] ] - -cur=. -while : -do case $in in - "") case $# in - 0) set set out + ;; - esac - ;; - *) read lin || lin="set out +" - set x $lin - shift - ;; - esac - - # check if "run xxx" is equivalent to "set in xxx" - - case $1 in - run) case $shell in - ksh) x=${2##*[\\/]} - ;; - *) case $2 in - */*) x=`echo $2 | sed -e 's,.*[\\\\/],,'` ;; - *) x=$2 ;; - esac - ;; - esac - case $x in - *.*) ;; - *) set set in $2 ;; - esac - ;; - esac - - # set drops out early - - case $1 in - ""|\#*) continue - ;; - set) shift - case $1 in - ""|\#*) op= - ;; - *) op=$1 - shift - arg= - while : - do case $# in - 0) break ;; - esac - case $1 in - *" "*) shift - continue - ;; - ""|\#*) break - ;; - :) shift - break - ;; - esac - case $arg in - "") arg=$1 ;; - *) arg="$arg $1" ;; - esac - shift - done - ;; - esac - case $op in - cc) occ= - for x in $arg - do case $occ in - "") case $x in - *=*) case $shell in - ksh) export $x - ;; - *) eval $x - export `echo $x | sed -e 's/=.*//'` - ;; - esac - ;; - *) occ=$x - ;; - esac - ;; - *) occ="$occ $x" - ;; - esac - done - continue - ;; - debug) case $arg in - 0) exec 2>&$nullout - set - - debug= - ;; - ""|1) exec 2>&$stderr - set - - debug= - ;; - 2) exec 2>&$stderr - case $shell in - ksh) PS4="${PS4%+*([ ])}+\$LINENO+ " - esac - set -x - debug=-x - ;; - *) echo "$command: $arg: debug levels are 0, 1, 2" >&$stderr - ;; - esac - continue - ;; - "in") case $arg in - "") in=- - ;; - *) in=$arg - if test ! -f $in - then echo "$command: $in: not found" >&$stderr - exit 1 - fi - exec < $in - case $out in - "") case $in in - *[.\\/]*) - case $shell in - ksh) out=${in##*[\\/]} - out=${out%.*} - ;; - *) eval `echo $in | sed -e 's,.*[\\\\/],,' -e 's/\.[^.]*//' -e 's/^/out=/'` - ;; - esac - ;; - *) out=$in - ;; - esac - ;; - esac - ;; - esac - continue - ;; - nodebug)exec 2>&$nullout - set - - continue - ;; - out) out=$arg - defhdr= - deflib= - gothdr= - gotlib= - ;; - prototyped|noprototyped) - pragma="$pragma $op" - ;; - pragma) pragma="$pragma $arg" - ;; - shell) shell=$arg - continue - ;; - static) static=$arg - continue - ;; - *) echo "$command: $op: unkown option" >&$stderr - exit 1 - ;; - esac - ;; - *) case $1 in - *\{) op=- - ;; - *) op=$1 - shift - ;; - esac - arg= - cc=$occ - fail= - hdr= - lib= - lst=hdr - opt= - pass= - run= - src= - tst= - case $# in - 0) ;; - *) case $1 in - \#*) set x - shift - ;; - *) case $op in - ref) ;; - *) case $1 in - *\{) arg=- - ;; - *) arg=$1 - shift - esac - ;; - esac - ;; - esac - while : - do case $# in - 0) break ;; - esac - case $1 in - "") ;; - \#*) set x - ;; - [a-z]*\{) - v=$1 - x= - shift - while : - do case $# in - 0) case $in in - "") echo "$command: missing }end" >&$stderr - exit 1 - ;; - esac - while : - do if read o lin - then case $o in - \}end) set $o $lin - break 2 - ;; - ' '*|' '*) - set '' $o - o=$2 - ;; - esac - - case $lin in - "") x="$x -$o" ;; - *) x="$x -$o $lin" ;; - esac - else echo "$command: missing }end" >&$stderr - exit 1 - fi - done - ;; - esac - case $1 in - \}end) break - ;; - *) x="$x -$1" - ;; - esac - shift - done - case $v in - fail\{) fail=$x ;; - pass\{) pass=$x ;; - test\{) tst=$x ;; - *) src=$x run=$v ;; - esac - ;; - :) shift - break - ;; - *[\(\)\{\}\ \ ]*) - tst="$tst $1" - ;; - -) case $lst in - hdr) hdr="$hdr $1" ;; - lib) lib="$lib $1" ;; - esac - ;; - -l*) lib="$lib $1" - lst=lib - ;; - -*|+*) case $op in - ref) occ="$occ $1" ;; - run) opt="$opt $1" ;; - *) cc="$cc $1" ;; - esac - ;; - *.a) lib="$lib $1" - lst=lib - ;; - *[.\\/]*) - hdr="$hdr $1" - lst=hdr - ;; - *) tst="$tst $1" - ;; - esac - shift - done - ;; - esac - ;; - esac - - # check the candidate headers - - case $hdr in - ?*) z=$hdr - hdr= - hit=0 - for x in $z - do case $x in - -) case $hit in - 0) hit=1 ;; - 1) ;; - *) break ;; - esac - continue - ;; - *.h) echo "#include \"$x\"" > $tmp.c - $cc -E $tmp.c <&$nullin >&$nullout || continue - ;; - *) test -r $x || continue - ;; - esac - hdr="$hdr $x" - case $hit in - 0) ;; - 1) hit=2 ;; - esac - done - ;; - esac - - # check the candidate libraries - - case $lib in - ?*) z=$lib - e= - lib= - echo "int main(){return(0);}" > $tmp.c - for x in $z - do case $x in - -) case $lib in - "") continue ;; - esac - break - ;; - esac - while : - do rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c $e $x <&$nullin >&$nullout - then lib="$lib $e $x" - e= - break - else case $e in - "") e=$x - break - ;; - *) e= - ;; - esac - fi - done - done - ;; - esac - - # precheck some more ops - - case $op in - ref) deflib="$deflib $lib" - defhdr="$defhdr $hdr" - continue - ;; - esac - ifs=$IFS - IFS=, - eval op=\"$op\" - eval arg=\"$arg\" - IFS=$ifs - - # check for op aliases - - x= - for o in $op - do case $o in - def|default) x="$x cmd hdr key lib mth sys typ" ;; - *) x="$x $o" ;; - esac - done - - # loop on the ops o and args a - - for o in $x - do for a in $arg - do user= - case $a in - *[.\\/]*) - case $o in - hdr|sys) - case $a in - *[\\/]*) x=/ ;; - *) x=. ;; - esac - case $shell in - ksh) p=${a%%${x}*} - v=${a##*${x}} - ;; - *) eval `echo $a | sed -e "s/\\(.*\\)\\\\${x}\\(.*\\)/p=\\1 v=\\2/"` - ;; - esac - ;; - *) case $shell in - ksh) p=${a%.*} - p=${p##*[\\/]} - v=${a##*.} - v=${v##*[\\/]} - ;; - *) eval `echo $a | sed -e 's,.*[\\\\/],,' -e 's/\(.*\)\.\(.*\)/p=\1 v=\2/'` - ;; - esac - ;; - esac - f=${p}/${v} - case $o in - run) v=$p - p= - m=_${v} - ;; - mem) m=_${v}_${p} - ;; - *) m=_${p}_${v} - ;; - esac - ;; - *) p= - v=$a - f=$a - m=_${v} - ;; - esac - - # check output redirection - - case $out in - $cur) ;; - *) case $cur in - $a|$v) ;; - *) case $cur in - .) ;; - -) echo "#endif" - ;; - *) echo "#endif" - exec >&- - case $cur in - *[\\/]*|*.h) x=$cur ;; - *) x=$dir/$cur ;; - esac - proto -r $tmp.h - sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c - sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t - if cmp -s $tmp.c $tmp.t - then rm -f $tmp.h - else case $x in - ${dir}[\\/]$cur) test -d $dir || mkdir $dir || exit 1 ;; - esac - mv $tmp.h $x - fi - ;; - esac - case $out in - +) case $status in - 1) ;; - *) status=0 ;; - esac - exit $status - ;; - -) eval "exec >&$stdout" - ;; - *) exec >$tmp.h - ;; - esac - case $out in - "") case $a in - *[\\/]*|???????????????*) cur=$v ;; - *) cur=$a ;; - esac - ;; - *) cur=$out - ;; - esac - case $in in - ""|-|+) case $o in - run) x=" from $a" ;; - *) x= ;; - esac - ;; - *) x=" from $in" - ;; - esac - echo "/* : : generated$x by $command version $version : : */" - for x in $pragma - do echo "#pragma $x" - done - case $out in - ""|-|+) x=$m - ;; - *.*) case $shell in - ksh) i=$out - x=_ - while : - do case $i in - *.*) x=$x${i%%.*}_ - i=${i#*.} - ;; - *) x=$x$i - break - ;; - esac - done - ;; - *) eval `echo $in | sed -e 's,\.,_,g' -e 's/^/x=/'` - ;; - esac - ;; - *) x=_$out - ;; - esac - case $x in - *-*) echo "#if 1" - ;; - *) case $x in - _cmd|_lib) - case $shell in - ksh) c=${PWD##*[\\/]} - c=${c#lib} - c=${c%%.*} - x=${x}_${c} - ;; - *) x=${x}_`echo $x | sed -e 's,.*[\\\\/],,' -e 's,^lib,,' -e 's,\..*,,'` - ;; - esac - ;; - esac - x=`echo $x | sed -e 's/[^a-zA-Z0-9_]/_/g'` - echo "#ifndef _def${x}" - echo "#define _def${x} 1" - ;; - esac - ;; - esac - ;; - esac - - # set up the candidate include list - - inc= - for x in $defhdr $hdr - do case $x in - *.h) case $shell in - ksh) c=${x##*[\\/]} - c=${c%%.*} - case $x in - */*) c=${x%%[\\/]*}_${c} ;; - esac - ;; - *) eval `echo $x | sed -e 's,^\([^\\\\/]*\).*[\\\\/]\([^\\\\/]*\)\$,\1_\2,' -e 's/\..*//' -e 's/^/c=/'` - ;; - esac - case " $gothdr " in - *" $x "*) - ;; - *) gothdr="$gothdr $x" - echo "#define _inc_${c} 1 /* candidate header <$x> found */" - ;; - esac - inc="$inc -#include <$x>" - ;; - esac - done - - # set up the candidate lib list - - for x in $lib $deflib - do case " $gotlib " in - *" $x "*) - ;; - *) gotlib="$gotlib $x" - echo "/* candidate library $x found */" - ;; - esac - done - - # src overrides builtin test - - case $o in - tst) ;; - *) m=_${o}${m} - ;; - esac - pre="#undef $v" - case $src in - ?*) echo "$inc -$src" > $tmp.c - e= - case $run in - cat*|nocat*) - echo "$src" - ;; - run*|norun*) - (eval "$src") <&$nullin || e=1 - ;; - mac*|nomac*) - if $cc -E $tmp.c <&$nullin >$tmp.i - then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i - else e=1 - fi - ;; - p*|nop*)$cc -DTEST=$p -DID=$v -E $tmp.c <&$nullin >&$nullout || e=1 - ;; - c*|noc*)$cc -DTEST=$p -DID=$v -c $tmp.c <&$nullin >&$nullout || e=1 - ;; - *) rm -f $tmp.exe - if $cc -DTEST=$p -DID=$v -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then case $run in - l*|nol*);; - o*|noo*)$tmp.exe <&$nullin || e=1 ;; - *) $tmp.exe <&$nullin >&$nullout || e=1 ;; - esac - else e=1 - fi - ;; - esac - case $run in - no*) case $e in - "") e=1 ;; - *) e= ;; - esac - ;; - esac - case $e in - "") case $m in - *-*) ;; - *) echo "#define $m 1 /* ${run}} passed */" ;; - esac - (eval "$pass") <&$nullin - ;; - *) (eval "$fail") <&$nullin - ;; - esac - continue - ;; - esac - - # initialize common builtin state - - case $o in - dat|lib|mth|run) - case $statictest in - "") statictest=FoobaR - echo "#if __cplusplus -extern \"C\" { -#endif -extern int $statictest(); -#if __cplusplus -} -#endif -static int ((*i)())=$statictest;main(){return(i==0);}" > $tmp.c - rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && $executable $tmp.exe - then case $static in - .) static= - echo '#include -main(){printf("hello");return(0);}' > $tmp.c - rm -f $tmp.exe - if $cc -c $tmp.c <&$nullin >&$nullout && $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe - then e=`wc -l $tmp.e` - set x x $binding - while : - do shift - shift - case $# in - 0) break ;; - esac - rm -f $tmp.exe - $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue - case `wc -l $tmp.e` in - $e) ;; - *) continue ;; - esac - d=`ls -s $tmp.exe` - rm -f $tmp.exe - $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue - case `wc -l $tmp.e` in - $e) ;; - *) continue ;; - esac - case `ls -s $tmp.exe` in - $d) ;; - *) static=$2 - set x - shift - break - ;; - esac - done - fi - ;; - esac - else static= - fi - ;; - esac - ;; - esac - - # builtin tests - - case $o in - cmd) case $p in - ?*) continue ;; - esac - k= - for j in "" usr - do case $j in - "") d= s= ;; - *) d=/$j s=_$j ;; - esac - for i in bin etc ucb - do if test -f $d/$i/$a - then case $k in - "") k=1 - echo "#define $m 1 /* $a in ?(/usr)/(bin|etc|ucb) */" - ;; - esac - echo "#define ${s}_${i}_${v} 1 /* $d/$i/$a found */" - fi - done - done - ;; - dat) case $p in - ?*) continue ;; - esac - { - echo "$pre" - case $inc in - ?*) echo "$inc" - ;; - *) echo "#if __cplusplus -extern \"C\" { -#endif -extern int $v; -#if __cplusplus -} -#endif" - ;; - esac - echo "int main(){char* i = (char*)&$v; return i!=0;}" - } > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout && - rm -f $tmp.exe - if $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then echo "#define $m 1 /* $v in default lib(s) */" - fi - ;; - hdr|lcl|sys) - case $p in - lcl) eval p='$'_lcl_$v - case $p in - ?*) continue ;; - esac - eval _lcl_$v=1 - p= - f=$v - ;; - *) case $o in - hdr) echo "#include <$f.h>" > $tmp.c - $cc -E $tmp.c <&$nullin >&$nullout && - echo "#define $m 1 /* #include <$f.h> ok */" - ;; - sys) echo "#include " > $tmp.c - $cc -E $tmp.c <&$nullin >&$nullout && - echo "#define $m 1 /* #include ok */" - ;; - esac - continue - ;; - esac - case $p in - ?*) x="$p\\$v" ;; - *) x=$f ;; - esac - case $f in - *[\\/]*)g=$f ;; - *) g="$f sys/$f" ;; - esac - for f in $g - do echo "$pre -$inc -#include <$f.h>" > $tmp.c - if $cc -E $tmp.c <&$nullin >$tmp.i - then i=`sed -e '/^#[line ]*1[ ][ ]*"[\\\\/].*[\\\\/]'$x'\.h"/!d' -e '/[\\\\/]sys[\\\\/]'$x'\.h"/d' -e s'/.*"\(.*\)".*/\1/' $tmp.i` - for i in $i - do break - done - else i= - fi - case $i in - [\\/]*) echo "#if defined(__STDPP__directive)" - echo "__STDPP__directive pragma pp:hosted" - echo "#endif" - echo "#include \"$i\" /* untrusted local <$f.h> */" - echo "#undef $m" - echo "#define $m 1" - break - ;; - *) echo "/* no local <$f.h> */" - ;; - esac - done - ;; - key) case $p in - ?*) continue ;; - esac - echo "$pre -int f(){int $v = 1;return($v);}" > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout || - echo "#define $m 1 /* $v is a reserved keyword */" - ;; - lib|mth)case $p in - ?*) continue ;; - esac - echo "$pre -$inc -#if __cplusplus -extern \"C\" { -#endif -extern int $v(); -#if __cplusplus -} -#endif -static int ((*i)())=$v;main(){return(i==0);}" > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout && - rm -f $tmp.exe - if $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then case $o in - lib) echo "#define $m 1 /* $v() in default lib(s) */" ;; - esac - else case $o in - mth) rm -f $tmp.exe - $cc $static -o $tmp.exe $tmp.o -lm <&$nullin >&$nullout && - $executable $tmp.exe && - echo "#define $m 1 /* $v() in math lib */" - ;; - esac - fi - ;; - mac) case $p in - ?*) continue ;; - esac - echo "$pre -$inc -#ifdef $v -'#define $m 1 /* $v is a macro */' -#endif" > $tmp.c - $cc -E $tmp.c <&$nullin | sed -e "/^'#define/!d" -e "s/'//g" - ;; - mem) case $p in - ?*) for i in "" "struct " - do echo "$pre -$inc -static $i$p i; -int n = sizeof(i.$v);" > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout && - echo "#define $m 1 /* $v is member of $i$p */" && - break - done - ;; - *) echo "$command: $o: . expected" >&$stderr - status=1 - ;; - esac - ;; - nop) ;; - one) for i in $a $hdr - do x="#include <$i>" - echo "$x" > $tmp.c - if $cc -E $tmp.c <&$nullin >&$nullout - then echo "$x" - break - fi - done - ;; - out) ;; - run) if test ! -f $a - then echo "$command: $a: not found" >&$stderr - exit 1 - fi - case $a in - *.c) rm -f $tmp.exe - cp $a $tmp.c - $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && - $executable $tmp.exe && - $tmp.exe $opt <&$nullin - ;; - *.sh) ${SHELL-sh} $debug $a "cc='$cc' executable='$executable' id='$m' static='$static' tmp='$tmp'" $opt $hdr <&$nullin - ;; - *) false - ;; - esac - case $? in - 0) ;; - *) echo "$command: $a: cannot run" >&$stderr - exit 1 - ;; - esac - ;; - sym) case $tst in - "") x=$v ;; - *) x=$tst ;; - esac - echo "$pre -$inc -'=' $x '='" > $tmp.c - $cc -E $tmp.c <&$nullin \ - | sed \ - -e "/'='/!d" \ - -e "s/'='//g" \ - -e 's/[ ]//g' \ - -e 's/((([^()]*)))->/->/g' \ - -e 's/(([^()]*))->/->/g' \ - -e 's/([^()]*)->/->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\[/\ -ary \1[/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)(/\ -fun \1[/g' \ - -e 's/\*->\([a-zA-Z_]\)/->\ -ptr \1/g' \ - -e 's/->\([a-zA-Z_]\)/->\ -reg \1/g' \ - -e "/^$v\$/d" \ - -e 's/^[a-zA-Z_][a-zA-Z_0-9]*$/\ -nam &/g' \ - | sed \ - -e '/^... /!d' \ - | sort \ - -u \ - | sed \ - -e 's/\(...\) \([a-zA-Z_][a-zA-Z_0-9]*\).*/#ifndef _\1_'$v'\ -#define _\1_'$v' \2\ -#define _\1_'$v'_str "\2"\ -#endif/' - ;; - typ) case $p in - "") x= ;; - *) x="$p " ;; - esac - case $typ in - "") typ=" -#include " - c= - h= - for i in time "" times - do case $i in - "") c=sys_ - h=sys/ - continue - ;; - esac - c=${c}$i - h=${h}$i.h - t="$typ -#include <$h>" - echo "$t" > $tmp.c - if $cc -c $tmp.c <&$nullin >&$nullout - then typ="$t" - echo "#define _inc_${c} 1 /* candidate header <$h> found */" - fi - c= - h= - done - t= - for i in stddef stdlib - do u="$t -#include <$i.h>" - echo "$u$typ" > $tmp.c - if $cc -c $tmp.c <&$nullin >&$nullout - then t="$u" - echo "#define _inc_$i 1 /* candidate header <$i.h> found */" - else break - fi - done - typ="$t$typ" - ;; - esac - { - case $p in - long) echo "$pre -$typ$inc -static $x$v i; -$x$v f() { -$x$v v; v = i;" - echo "v <<= 4; i = v >> 2; i = v * i; i = i / v; v = v + i; i = i - v; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i; -return v; }" - ;; - *) echo "$pre -$typ$inc -struct xxx { $x$v mem; }; -static struct xxx v; -struct xxx* f() { return &v; }" - ;; - esac - echo "int main() { f(); return 0; }" - } > $tmp.c - rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && - $executable $tmp.exe - then echo "#define $m 1 /* $x$v is a type */" - user=$pass - else user=$fail - fi - ;; - *) echo "$command: $o: unknown feature test" >&$stderr - status=1 - ;; - esac - case $user in - ?*) (eval "$user") <&$nullin ;; - esac - done - done -done diff --git a/cde/programs/dtksh/ksh93/ship/shipiffe.sh b/cde/programs/dtksh/ksh93/ship/shipiffe.sh deleted file mode 100644 index 87f3737a9..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipiffe.sh +++ /dev/null @@ -1,1419 +0,0 @@ -: $XConsortium: shipiffe.sh /main/3 1996/05/10 16:41:50 drk $ -: -# Glenn Fowler & Phong Vo -# AT&T Bell Laboratories -# -# test if feature exists -# -# @(#)iffe (AT&T Bell Laboratories) 05/09/95 -# -# NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt - -command=iffe -version=05/09/95 - -binding="-Bdynamic -Bstatic -Wl,-ashared -Wl,-aarchive -call_shared -non_shared" -occ=cc -defhdr= -usr= -deflib= -dir=FEATURE -executable="test -x" -gothdr= -gotlib= -ifs=$IFS -in= -menu= -nl=" -" -one= -out= -puthdr= -putlib= -pragma= -prompt= -case $RANDOM in -$RANDOM)shell=bsh - $executable . 2>/dev/null || executable='test -r' - ;; -*) shell=ksh - ;; -esac -static=. -statictest= -style=C -case $COTEMP in -"") case $HOSTNAME in - ""|?|??|???|????|????) - tmp=${HOSTNAME} - ;; - *) case $shell in - ksh) tmp=${HOSTNAME%${HOSTNAME#????}} ;; - *) eval `echo $HOSTNAME | sed 's/\(....\).*/tmp=\1/'` ;; - esac - ;; - esac - tmp=${tmp}$$ - ;; -*) tmp=$COTEMP - ;; -esac -case $tmp in -??????????*) - case $shell in - ksh) tmp=${tmp%${tmp#?????????}} ;; - *) eval `echo $tmp | sed 's/\(.........\).*/tmp=\1/'` ;; - esac - ;; -?????????) - ;; -????????) - tmp=F$tmp - ;; -esac -tmp=./$tmp - -# standard error to /dev/null unless debugging -# standard output to the current output file -# -# stdout original standard output -# stderr original standard error -# nullin /dev/null input -# nullout /dev/null output - -stdin=4 stdout=5 stderr=6 nullin=7 nullout=8 -eval "exec $stdin<&0 $nullin>/dev/null $nullout>/dev/null $stdout>&1 $stderr>&2 2>&$nullout" - -# options -- `-' for output to stdout otherwise usage - -while : -do case $# in - 0) in=- - break - ;; - esac - case $1 in - -) out=- - ;; - -*) echo "Usage: $command [-] [op [arg ... [-l* *.a *.sh * ...]] [: op ...]" >&$stderr - exit 2 - ;; - *) break - ;; - esac - shift -done - -# tmp files cleaned up on exit -# status: 0:success 1:failure 2:interrupt - -status=2 -trap "rm -f $tmp*.*; exit \$status" 0 1 2 - -# standard header for c source - -std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) -#define _STD_ 1 -#define _ARG_(x) x -#define _VOID_ void -#else -#define _STD_ 0 -#define _ARG_(x) () -#define _VOID_ char -#endif -#if defined(__cplusplus) -#define _BEGIN_EXTERNS_ extern "C" { -#define _END_EXTERNS_ } -#else -#define _BEGIN_EXTERNS_ -#define _END_EXTERNS_ -#endif -#define _NIL_(x) ((x)0)' - -# loop on op [ arg [ ... ] ] [ : op [ arg [ ... ] ] ] - -cur=. -while : -do case $in in - "") case $# in - 0) set set out + ;; - esac - ;; - *) read lin || lin="set out +" - set x $lin - shift - ;; - esac - - # check if "run xxx" is equivalent to "set in xxx" - - case $1 in - run) case $shell in - ksh) x=${2##*[\\/]} - ;; - *) case $2 in - */*) x=`echo $2 | sed -e 's,.*[\\\\/],,'` ;; - *) x=$2 ;; - esac - ;; - esac - case $x in - *.*) ;; - *) set set in $2 ;; - esac - ;; - esac - - # set drops out early - - case $1 in - ""|\#*) continue - ;; - set) shift - case $1 in - ""|\#*) op= - ;; - *) op=$1 - shift - arg= - while : - do case $# in - 0) break ;; - esac - case $1 in - *" "*) shift - continue - ;; - ""|\#*) break - ;; - :) shift - break - ;; - esac - case $arg in - "") arg=$1 ;; - *) arg="$arg $1" ;; - esac - shift - done - ;; - esac - case $op in - cc) occ= - for x in $arg - do case $occ in - "") case $x in - *=*) case $shell in - ksh) export $x - ;; - *) eval $x - export `echo $x | sed -e 's/=.*//'` - ;; - esac - ;; - *) occ=$x - ;; - esac - ;; - *) occ="$occ $x" - ;; - esac - done - continue - ;; - debug) case $arg in - 0) exec 2>&$nullout - set - - ;; - ""|1) exec 2>&$stderr - set - - ;; - 2) exec 2>&$stderr - case $shell in - ksh) PS4="${PS4%+*([ ])}+\$LINENO+ " - esac - set -x - ;; - *) echo "$command: $arg: debug levels are 0, 1, 2" >&$stderr - ;; - esac - continue - ;; - "in") case $arg in - "") in=- - ;; - *) in=$arg - if test ! -r $in - then echo "$command: $in: not found" >&$stderr - exit 1 - fi - exec < $in - case $out in - "") case $in in - *[.\\/]*) - case $shell in - ksh) out=${in##*[\\/]} - out=${out%.*} - ;; - *) eval `echo $in | sed -e 's,.*[\\\\/],,' -e 's/\.[^.]*//' -e 's/^/out=/'` - ;; - esac - ;; - *) out=$in - ;; - esac - ;; - esac - ;; - esac - continue - ;; - nodebug)exec 2>&$nullout - set - - continue - ;; - out) out=$arg - defhdr= - usr= - deflib= - gothdr= - gotlib= - one= - puthdr= - putlib= - ;; - prototyped|noprototyped) - pragma="$pragma $op" - ;; - pragma) pragma="$pragma $arg" - ;; - shell) shell=$arg - continue - ;; - static) static=$arg - continue - ;; - *) echo "$command: $op: unkown option" >&$stderr - exit 1 - ;; - esac - ;; - *) case $1 in - *\{) op=- - ;; - *) op=$1 - shift - ;; - esac - arg= - cc=$occ - fail= - hdr= - lib= - lst=hdr - note= - opt= - pass= - run= - src= - test= - case $# in - 0) ;; - *) case $1 in - \#*) set x - shift - ;; - *) case $op in - ref) ;; - *) case $1 in - *\{) arg=- - ;; - *) arg=$1 - shift - esac - ;; - esac - ;; - esac - while : - do case $# in - 0) break ;; - esac - case $1 in - "") ;; - \#*) set x - ;; - [a-z]*\{) - v=$1 - shift - x= - case $v in - menu\{) sep=" $nl " ;; - *) sep=$nl ;; - esac - while : - do case $# in - 0) case $in in - "") echo "$command: missing }end" >&$stderr - exit 1 - ;; - esac - while : - do if read lin - then set "" $lin - case $2 in - \}end) shift - break 2 - ;; - esac - x="$x$sep$lin" - else echo "$command: missing }end" >&$stderr - exit 1 - fi - done - ;; - esac - case $1 in - \}end) break - ;; - *) x="$x$sep$1" - ;; - esac - shift - done - case $v in - fail\{) fail=$x ;; - menu\{) menu=$x ;; - nofail\{) pass=$x v=pass\{ ;; - nopass\{) fail=$x v=fail\{ ;; - note\{) note=$x ;; - pass\{) pass=$x ;; - prompt\{) prompt=$x ;; - test\{) test=$x ;; - *) src=$x run=$v ;; - esac - ;; - :) shift - break - ;; - *[\(\)\{\}\ \ ]*) - test="$test $1" - ;; - -) case $lst in - hdr) hdr="$hdr $1" ;; - lib) lib="$lib $1" ;; - esac - ;; - -l*) lib="$lib $1" - lst=lib - ;; - -*|+*) case $op in - ref) cc="$cc $1" occ="$occ $1" ;; - run) opt="$opt $1" ;; - *) cc="$cc $1" ;; - esac - ;; - *.a) lib="$lib $1" - lst=lib - ;; - *[.\\/]*) - hdr="$hdr $1" - lst=hdr - ;; - *) test="$test $1" - ;; - esac - shift - done - ;; - esac - ;; - esac - - # check for interactive queries - - case $menu$prompt in - ?*) style=sh - case $arg in - "") arg=REPLY ;; - esac - eval $arg= - while : - do case $prompt in - ?*) case $prompt in - $nl*) ;; - *) echo >&$stdout ;; - esac - echo "$prompt" >&$stdout - esac - echo >&$stdout - IFS=" " - set "" $menu "$nl" - IFS=$ifs - shift - any= - n= - while : - do case $1 in - $nl) shift; continue ;; - esac - n=_$n - case $# in - 0) break ;; - esac - case $1 in - -) p="*" any=1 ;; - *) p=$1 ;; - esac - shift - case $1 in - $nl) t= ;; - -) t=; shift ;; - *) t=" $1"; shift ;; - esac - v=$1 - shift - case $1 in - $nl) shift ;; - esac - x=$v - case $v in - -|$nl) v= ;; - esac - case $t in - "") t=$v ;; - esac - case $v$x in - $nl) v=$p ;; - esac - echo " $p)$t" >&$stdout - eval p$n='"$p"' v$n='"$v"' - done - eval p$n="*" v$n= - case $n in - _) any=1 ;; - *) echo >&$stdout ;; - esac - case $shell in - ksh) read -u$stdin val ;; - *) val=`exec <&$stdin; read val; echo val` ;; - esac - i= - while : - do i=_$i - case $i in - $n) case $any in - "") val= ;; - esac - break - ;; - esac - eval p='$'p$i v='$'v$i - case $val in - "$p") any=1 - val=$v - break - ;; - "$v") any=1 - break - ;; - esac - done - case $any:$val in - ":") ;; - *) eval $arg=\$val - case $test in - "") break ;; - *) ( eval "$test" ) <&$stdin >&$stdout 2>&$stderr && break ;; - esac - ;; - esac - echo "$command: invalid input" >&$stderr - done - menu= - prompt= - op=val - ;; - esac - - # check the candidate headers - - case $hdr in - ?*) z=$hdr - hdr= - hit=0 - for x in $z - do case $x in - -) case $hit in - 0) hit=1 ;; - 1) ;; - *) break ;; - esac - continue - ;; - *.h) case " $gothdr " in - *" - $x "*) - continue - ;; - *" + $x "*) - ;; - *) echo "#include <$x>" > $tmp.c - if $cc -E $tmp.c <&$nullin >&$nullout - then gothdr="$gothdr + $x" - else gothdr="$gothdr - $x" - continue - fi - ;; - esac - ;; - *) test -r $x || continue - ;; - esac - hdr="$hdr $x" - case $hit in - 0) ;; - 1) hit=2 ;; - esac - done - ;; - esac - - # check the candidate libraries - - case $lib in - ?*) z=$lib - e= - lib= - echo "int main(){return(0);}" > $tmp.c - for x in $z - do case $x in - -) case $lib in - "") continue ;; - esac - break - ;; - esac - while : - do case $e in - "") p=$x ;; - *) p="$e $x" ;; - esac - case " $gotlib " in - *"- $p "*) - ;; - *"+ $p"*) - lib="$lib $p" - e= - break - ;; - *) rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c $p <&$nullin >&$nullout - then gotlib="$gotlib + $p" - lib="$lib $p" - e= - break - else gotlib="$gotlib - $p" - fi - ;; - esac - case $e in - "") e=$x - break - ;; - *) e= - ;; - esac - done - done - ;; - esac - - # precheck some more ops - - case $op in - ref) deflib="$deflib $lib" - defhdr="$defhdr $hdr" - continue - ;; - esac - IFS=, - eval op=\"$op\" - eval arg=\"$arg\" - IFS=$ifs - - # check for op aliases - - x= - for o in $op - do case $o in - def|default) x="$x cmd dat hdr key lib mth sys typ" ;; - *) x="$x $o" ;; - esac - done - - # loop on the ops o and args a - - for o in $x - do for a in $arg - do user= - case $a in - *[.\\/]*) - case $o in - hdr|sys) - case $a in - *[\\/]*) x=/ ;; - *) x=. ;; - esac - case $shell in - ksh) p=${a%%${x}*} - v=${a##*${x}} - ;; - *) eval `echo $a | sed -e "s/\\(.*\\)\\\\${x}\\(.*\\)/p=\\1 v=\\2/"` - ;; - esac - case $v in - lcl) t=$p - p=$v - v=$t - ;; - esac - ;; - *) case $shell in - ksh) p=${a%.*} - p=${p##*[\\/]} - v=${a##*.} - v=${v##*[\\/]} - ;; - *) eval `echo $a | sed -e 's,.*[\\\\/],,' -e 's/\(.*\)\.\(.*\)/p=\1 v=\2/'` - ;; - esac - ;; - esac - f=${p}/${v} - case $o in - run) v=$p - p= - m=_${v} - ;; - mem) m=_${v}_${p} - ;; - *) m=_${p}_${v} - ;; - esac - ;; - *) p= - v=$a - f=$a - m=_${v} - ;; - esac - - # check output redirection - - case $out in - $cur) ;; - *) case $cur in - $a|$v) ;; - *) case $cur in - .) ;; - -) case $style in - C) echo "#endif" ;; - esac - ;; - *) case $style in - C) echo "#endif" ;; - esac - exec >&- - case $cur in - *[\\/]*|*.h) x=$cur ;; - *) x=$dir/$cur ;; - esac - case $style in - C) proto -r $tmp.h - sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c - sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t - ;; - *) sed '/^#/d' $tmp.h > $tmp.c - sed '/^#/d' $x > $tmp.t - ;; - esac - if cmp -s $tmp.c $tmp.t - then rm -f $tmp.h - else case $x in - ${dir}[\\/]$cur) test -d $dir || mkdir $dir || exit 1 ;; - esac - mv $tmp.h $x - fi - ;; - esac - case $out in - +) case $status in - 1) ;; - *) status=0 ;; - esac - exit $status - ;; - -) eval "exec >&$stdout" - ;; - *) exec >$tmp.h - ;; - esac - case $out in - "") case $a in - *[\\/]*|???????????????*) cur=$v ;; - *) cur=$a ;; - esac - ;; - *) cur=$out - ;; - esac - case $in in - ""|-|+) case $o in - run) x=" from $a" ;; - *) x= ;; - esac - ;; - *) x=" from $in" - ;; - esac - case $style in - C) echo "/* : : generated$x by $command version $version : : */" - for x in $pragma - do echo "#pragma $x" - done - case $out in - ""|-|+) x=$m - ;; - *.*) case $shell in - ksh) i=$out - x=_ - while : - do case $i in - *.*) x=$x${i%%.*}_ - i=${i#*.} - ;; - *) x=$x$i - break - ;; - esac - done - ;; - *) eval `echo $in | sed -e 's,\.,_,g' -e 's/^/x=/'` - ;; - esac - ;; - *) x=_$out - ;; - esac - case $x in - *-*) echo "#if 1" - ;; - *) x=`pwd | sed -e 's,.*[\\\\/],,' -e 's,\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^a-zA-Z0-9_],_,g'` - echo "#ifndef _def${x}" - echo "#define _def${x} 1" - ;; - esac - ;; - *) echo "# : : generated$x by $command version $version : : #" - ;; - esac - ;; - esac - ;; - esac - - # set up the candidate include list - - inc= - for x in $defhdr $hdr - do case $x in - *.h) case $shell in - ksh) c=${x##*[\\/]} - c=${c%%.*} - case $x in - */*) c=${x%%[\\/]*}_${c} ;; - esac - ;; - *) eval `echo $x | sed -e 's,^\([^\\\\/]*\).*[\\\\/]\([^\\\\/]*\)\$,\1_\2,' -e 's/\..*//' -e 's/^/c=/'` - ;; - esac - case $x in - */*) c=_${c} ;; - *) c=_hdr_${c} ;; - esac - case " $puthdr " in - *" $c "*) - ;; - *) puthdr="$puthdr $c" - usr="$usr$nl#define $c 1" - echo "#define $c 1 /* #include <$x> ok */" - ;; - esac - inc="$inc -#include <$x>" - ;; - esac - done - - # set up the candidate lib list - - for x in $lib $deflib - do case " $putlib " in - *" $x "*) - ;; - *) putlib="$putlib $x" - echo "/* candidate library $x found */" - ;; - esac - done - - # src overrides builtin test - - case $o in - tst) ;; - *) m=_${o}${m} ;; - esac - pre="#undef $v" - case $src in - ?*) cat > $tmp.c <$tmp.i - then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i - else e=1 - fi - ;; - p*|nop*)$cc -DTEST=$p -DID=$v -E $tmp.c <&$nullin >&$nullout || e=1 - ;; - c*|noc*)$cc -DTEST=$p -DID=$v -c $tmp.c <&$nullin >&$nullout || e=1 - ;; - *) rm -f $tmp.exe - if $cc -DTEST=$p -DID=$v -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then case $run in - l*|nol*);; - o*|noo*)$tmp.exe <&$nullin || e=1 ;; - *) $tmp.exe <&$nullin >&$nullout || e=1 ;; - esac - else e=1 - fi - ;; - esac - case $run in - no*) case $e in - "") e=1 ;; - *) e= ;; - esac - ;; - esac - case $e in - "") case $m in - *-*) ;; - *) usr="$usr$nl#define $m 1" - case $note in - "") echo "#define $m 1 /* ${run}} passed */" ;; - *) echo "#define $m 1 /*"$note" */" ;; - esac - ;; - esac - (eval "$pass") <&$nullin - ;; - *) (eval "$fail") <&$nullin - ;; - esac - continue - ;; - esac - - # initialize common builtin state - - case $o in - dat|lib|mth|run) - case $statictest in - "") statictest=FoobaR - echo "$std -$usr -_BEGIN_EXTERNS_ -extern int $statictest; -_END_EXTERNS_ -int main(){char* i = (char*)&$statictest; return i!=0;}" > $tmp.c - rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && $executable $tmp.exe - then case $static in - .) static= - echo '#include -int main(){printf("hello");return(0);}' > $tmp.c - rm -f $tmp.exe - if $cc -c $tmp.c <&$nullin >&$nullout && $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe - then e=`wc -l $tmp.e` - set x x $binding - while : - do shift - shift - case $# in - 0) break ;; - esac - rm -f $tmp.exe - $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue - case `wc -l $tmp.e` in - $e) ;; - *) continue ;; - esac - d=`ls -s $tmp.exe` - rm -f $tmp.exe - $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue - case `wc -l $tmp.e` in - $e) ;; - *) continue ;; - esac - case `ls -s $tmp.exe` in - $d) ;; - *) static=$2 - set x - shift - break - ;; - esac - done - fi - ;; - esac - else static= - fi - ;; - esac - ;; - esac - - # builtin tests - - case $o in - cmd) case $p in - ?*) continue ;; - esac - k= - for j in "" usr - do case $j in - "") d= s= ;; - *) d=/$j s=_$j ;; - esac - for i in bin etc ucb - do if test -f $d/$i/$a - then case $k in - "") k=1 - usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $a in ?(/usr)/(bin|etc|ucb) */" - ;; - esac - c=${s}_${i}_${v} - usr="$usr$nl#define $c 1" - echo "#define $c 1 /* $d/$i/$a found */" - fi - done - done - ;; - dat) case $p in - ?*) continue ;; - esac - { - echo "$std -$usr -$pre" - case $inc in - ?*) echo "$inc" - ;; - *) echo "_BEGIN_EXTERNS_ -extern int $v; -_END_EXTERNS_" - ;; - esac - echo "int main(){char* i = (char*)&$v; return i!=0;}" - } > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout && - rm -f $tmp.exe - if $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $v in default lib(s) */" - fi - ;; - hdr|lcl|sys) - case $o in - lcl) p=lcl ;; - esac - case $p in - lcl) eval p='$'_lcl_$v - case $p in - ?*) continue ;; - esac - eval _lcl_$v=1 - p= - f=$v - ;; - *) case " $puthdr " in - *" $m "*) - ;; - *) case $o in - hdr) x=$f.h ;; - sys) x=sys/$f.h ;; - esac - case " $gothdr " in - *" - $x "*) - ;; - *" + $x "*) - ;; - *) echo "#include <$x>" > $tmp.c - if $cc -E $tmp.c <&$nullin >&$nullout - then gothdr="$gothdr + $x" - usr="$usr$nl#define $m 1" - echo "#define $m 1 /* #include <$x> ok */" - else gothdr="$gothdr - $x" - fi - ;; - esac - ;; - esac - continue - ;; - esac - case $p in - ?*) x="$p\\$v" ;; - *) x=$f ;; - esac - case $f in - *[\\/]*)g=$f ;; - *) g="$f sys/$f" ;; - esac - for f in $g - do echo "$pre -$inc -#include <$f.h>" > $tmp.c - case $f in - sys/*) e= ;; - *) e='-e /[\\\\/]sys[\\\\/]'$x'\.h"/d' ;; - esac - if $cc -E $tmp.c <&$nullin >$tmp.i - then i=`sed -e '/^#[line ]*[0-9][0-9]*[ ][ ]*"[\\\\/].*[\\\\/]'$x'\.h"/!d' $e -e '/\/bits\//d' -e s'/.*"\(.*\)".*/\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sort -u` - for i in $i - do break - done - else i= - fi - case $i in - [\\/]*) echo "#if defined(__STDPP__directive)" - echo "__STDPP__directive pragma pp:hosted" - echo "#endif" - echo "#include \"$i\" /* untrusted local <$f.h> */" - echo "#undef $m" - usr="$usr$nl#define $m 1" - echo "#define $m 1" - break - ;; - *) echo "/* no local <$f.h> */" - ;; - esac - done - ;; - key) case $p in - ?*) continue ;; - esac - echo "$pre -int f(){int $v = 1;return($v);}" > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout || - { - usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $v is a reserved keyword */" - } - ;; - lib|mth)case $p in - ?*) continue ;; - esac - echo "$std -$usr -$pre -$inc -_BEGIN_EXTERNS_ -extern int $v(); -_END_EXTERNS_ -static int ((*i)())=$v;int main(){return(i==0);}" > $tmp.c - $cc -c $tmp.c <&$nullin >&$nullout && - rm -f $tmp.exe - if $cc $static -o $tmp.exe $tmp.o $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe - then case $o in - lib) usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $v() in default lib(s) */" ;; - esac - else case $o in - mth) rm -f $tmp.exe - $cc $static -o $tmp.exe $tmp.o -lm <&$nullin >&$nullout && - $executable $tmp.exe && - { - usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $v() in math lib */" - } - ;; - esac - fi - ;; - mac) case $p in - ?*) continue ;; - esac - echo "$pre -$inc -#ifdef $v -'#define $m 1 /* $v is a macro */' -#endif" > $tmp.c - $cc -E $tmp.c <&$nullin | sed -e "/#define/!d" -e "s/'//g" -e "s/^[ ][ ]*//" - ;; - mem) case $p in - ?*) for i in "" "struct " - do echo "$pre -$inc -static $i$p i; -int n = sizeof(i.$v);" > $tmp.c - if $cc -c $tmp.c <&$nullin >&$nullout - then usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $v is member of $i$p */" - break - fi - done - ;; - *) echo "$command: $o: . expected" >&$stderr - status=1 - ;; - esac - ;; - nop) ;; - one) for i in $a $hdr - do x="#include <$i>" - case " $gothdr " in - *" - $i "*) - continue - ;; - *" + $i "*) - ;; - *) echo "$x" > $tmp.c - if $cc -E $tmp.c <&$nullin >&$nullout - then gothdr="$gothdr + $x" - else gothdr="$gothdr - $x" - continue - fi - ;; - esac - case $one in - "") one=$x - ;; - *"$x"*) break - ;; - *) echo "$one" > $tmp.c - if $cc -E $tmp.c <&$nullin >$tmp.i - then c=$i - case $c in - *[\\/]*) c=`echo $c | sed 's,[\\\\/],[/],g'` ;; - esac - case `sed -e '/^#[line ]*1[ ][ ]*"[\\\\/].*[\\\\/]'$c'"/!d' $tmp.i` in - ?*) break ;; - esac - fi - one="$one$nl$x" - ;; - esac - echo "$x" - break - done - ;; - out) ;; - run) if test ! -r $a - then echo "$command: $a: not found" >&$stderr - exit 1 - fi - case $a in - *.c) rm -f $tmp.exe - cp $a $tmp.c - $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$stderr 2>&$stderr && - $executable $tmp.exe && - $tmp.exe $opt <&$nullin - ;; - *.sh) ( - set "cc='$cc' executable='$executable' id='$m' static='$static' tmp='$tmp'" $opt $hdr $test - . $a - ) <&$nullin - ;; - *) false - ;; - esac - case $? in - 0) ;; - *) echo "$command: $a: cannot run" >&$stderr - exit 1 - ;; - esac - ;; - sym) case $test in - "") x=$v ;; - *) x=$test ;; - esac - echo "$pre -$inc -'=' $x '='" > $tmp.c - $cc -E $tmp.c <&$nullin \ - | sed \ - -e "/'='/!d" \ - -e "s/'='//g" \ - -e 's/[ ]//g' \ - -e 's/((([^()]*)))->/->/g' \ - -e 's/(([^()]*))->/->/g' \ - -e 's/([^()]*)->/->/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)\[/\ -ary \1[/g' \ - -e 's/\([a-zA-Z_][a-zA-Z_0-9]*\)(/\ -fun \1[/g' \ - -e 's/\*->\([a-zA-Z_]\)/->\ -ptr \1/g' \ - -e 's/->\([a-zA-Z_]\)/->\ -reg \1/g' \ - -e "/^$v\$/d" \ - -e 's/^[a-zA-Z_][a-zA-Z_0-9]*$/\ -nam &/g' \ - | sed \ - -e '/^... /!d' \ - | sort \ - -u \ - | sed \ - -e 's/\(...\) \([a-zA-Z_][a-zA-Z_0-9]*\).*/#ifndef _\1_'$v'\ -#define _\1_'$v' \2\ -#define _\1_'$v'_str "\2"\ -#endif/' - ;; - typ) case $p in - "") x= ;; - *) x="$p " ;; - esac - case $typ in - "") typ=" -#include " - c=_hdr_ - h= - for i in time "" times - do case $i in - "") c=_sys_ - h=sys/ - continue - ;; - esac - f=$h$i.h - t="$typ -#include <$f>" - case " $gothdr " in - *" - $f "*) - continue - ;; - *" + $f "*) - ;; - *) echo "$t" > $tmp.c - if $cc -c $tmp.c <&$nullin >&$nullout - then gothdr="$gothdr + $f" - else gothdr="$gothdr - $f" - continue - fi - ;; - esac - typ="$t" - c=$c$i - case " $puthdr " in - *" $c "*) - ;; - *) puthdr="$puthdr $c" - usr="$usr$nl#define $c 1" - echo "#define $c 1 /* #include <$f> ok */" - ;; - esac - done - t= - for i in stddef stdlib - do f=$i.h - u="$t -#include <$f>" - case " $gothdr " in - *" - $f "*) - break - ;; - *" + $f "*) - ;; - *) echo "$u$typ" > $tmp.c - if $cc -c $tmp.c <&$nullin >&$nullout - then gothdr="$gothdr + $f" - else gothdr="$gothdr - $f" - break - fi - ;; - esac - t="$u" - c=_hdr_$i - case " $puthdr " in - *" $c "*) - ;; - *) puthdr="$puthdr $c" - usr="$usr$nl#define $c 1" - echo "#define $c 1 /* #include <$f> ok */" - ;; - esac - done - typ="$t$typ" - ;; - esac - { - case $p in - long) echo "$pre -$typ$inc -static $x$v i; -$x$v f() { -$x$v v; v = i;" - echo "v <<= 4; i = v >> 2; i = v * i; i = i / v; v = v + i; i = i - v; i = 10; i = v % i; i |= v; v ^= i; i = 123; v &= i; -return v; }" - ;; - *) echo "$pre -$typ$inc -struct xxx { $x$v mem; }; -static struct xxx v; -struct xxx* f() { return &v; }" - ;; - esac - echo "int main() { f(); return 0; }" - } > $tmp.c - rm -f $tmp.exe - if $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && - $executable $tmp.exe - then usr="$usr$nl#define $m 1" - echo "#define $m 1 /* $x$v is a type */" - user=$pass - else user=$fail - fi - ;; - val) case $arg in - \"*\") echo $arg=\'$val\' ;; - *) echo $arg=\"$val\" ;; - esac - ;; - :) shift - ;; - *) echo "$command: $o: unknown feature test" >&$stderr - status=1 - ;; - esac - case $user in - ?*) (eval "$user") <&$nullin ;; - esac - done - done -done diff --git a/cde/programs/dtksh/ksh93/ship/shipin b/cde/programs/dtksh/ksh93/ship/shipin deleted file mode 100755 index 0aef3e9a2..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipin +++ /dev/null @@ -1,1787 +0,0 @@ -csh=obsolete || exec sh $0 $argv:q -OLDEST_nmake=950509 OLDEST_pax=950509 -csh=obsolete || exec sh $0 $argv:q -# -# software shipment installation control -# -: "this id string works around a bug introduced sometime in 1991 -@(#)shipin (AT&T Bell Laboratories) 05/09/95 -" -# -# ship/shipin [options] [component ...] [name=value ...] -# -# options: -# -# -c don't compute closure if components specified -# -d for debugging -# -i read in from spool but do not uncrate or build -# (files set up for shipout) -# -n show actions but do not execute -# -p don't run proto on uncrate -# -r usr usr is the shipment recipient -# -s dir shipment spool hierarchy copied to dir -# -t show component closure but do not build -# -u uncrate shipment source but do not build -# -x set -x -# -E ignore previous tool build errors -# -F force (re)build (no uncrating unless -u) -# -L don't generate proto line syncs on uncrate -# -O preserve old shipments -# -P delete #pragma prototyped on input -# -X tool exclude tools from uncrating or building -# -# The component arguments cause shipin to build only on those components. -# All component source will be uncrated. -# -# The remaining arguments are passed as arguments to the generating -# makes or shell scripts -- handy for `name=value' overrides. -# -# The minimum configuration must have an $INSTALLROOT/ship subdirectory. -# See $INSTALLROOT/ship/README for more details. -# -# If $CC is not set then CC=$INSTALLROOT/bin/cc if it exists. This -# provides a workaround hook for botches in the compilation system -# that go beyond setting CC and CCFLAGS. Botches are so bad/ugly/temporary -# that we refuse to incorporate workarounds in our mainline code. -# Systems that currently require workarounds are: -# NeXT -# Win/NT -# - -case $1 in --x) set -x - ;; -*) case $- in - *x*) set '' -x ${1+"$@"}; shift ;; - esac - ;; -esac -case $- in -*x*) case $PS4 in - *'$LINENO'*) ;; - *) PS4='+$LINENO+ ' ;; - esac - ;; -esac - -# disable the builtin wc because ksh may hang during the execution later of "wc pic.o" -builtin -d wc - -# -# this script may be overwritten while it is being executed -# so copy it and exec from the copy -# - -_command_=ship/shipin -_command_save_=ship/SHIPin -_check_=": $* :" -case $_ship_check_ in -$_check_) - ;; -*) _ship_check_=$_check_ - export _ship_check_ - cp $_command_ $_command_save_ 2>/dev/null && chmod +x $_command_save_ && exec $_command_save_ ${1+"$@"} - ;; -esac - -# -# the components in ORDER are built first -# OLDEST_ is the oldest version of that can be used -# - -INSTALLROOT=`pwd` -export INSTALLROOT - -ORDER="pax ksh nmake" - -USER=${USER-${LOGNAME-`echo $HOME | sed 's/.*\///'`}} -INSTALLER=$USER -export INSTALLER -RECIPIENT=${RECIPIENT-$USER} -FROMSYS=`(uname -n || hostname || cat /etc/whoami) 2>/dev/null` -d=/lib:/usr/lib:/usr/local/lib -for i in LD_LIBRARY_PATH -do eval v='$'$i - case $v in - "") eval $i='$'INSTALLROOT/lib ;; - *) eval $i='$'INSTALLROOT/lib:$v ;; - esac - export $i -done -OPATH=/bin:/usr/bin:$PATH -PATH=:$PATH:$INSTALLROOT/bin -export PATH -case $PS4 in -+\ *|+*\ ) - ;; -*) PS4="+ $PS4" - export PS4 - ;; -esac - -SHIP=$INSTALLROOT/ship -BIN=$INSTALLROOT/bin -_bypass_=Install -LOG=in.log -_mail_=/bin/mail -OWNER=owner -_read_= -REPORT=report -SHIPDATE=[0-9][0-9][0-9][0-9][0-9][0-9] -SHIPMENT=*$SHIPDATE -SHIPSLOG=$SHIP/shipslog -TMP=tmp - -for f in $ORDER -do eval RELEASE_$f= - eval STATE_$f= -done - -if (unalias make) 2> /dev/null -then unalias cp make rm -fi - -# -# check for old exit status botch -# - -_set_= -(set -e; false || true) && _set_=e || echo "$_command_: command errors ignored because of shell botch" >&2 -_set_="set -x$_set_;" - -# -# gobble the options -# - -_closure_=1 -_debug_= -_exclude_=" bin cmd lib src shipslog " -_export_="CC CCFLAGS" -_force_= -_ignore_= -_intermediate_= -_options_= -_preserve_= -_proto_=1 -_proto_default_=npr -_proto_opt_= -_total_= -_trace_= -_uncrate_= -_uuspool_= -while : -do case $# in - 0) break ;; - esac - case $1 in - -[rsX]) case $# in - 1) set '?'; continue ;; - esac - case $1 in - -r) RECIPIENT=$2 ;; - -s) _uuspool_="$_uuspool_ $2" ;; - -X) _exclude_="$_exclude$2 " ;; - esac - _options_="$_options_ $1" - shift - ;; - -c) _closure_= ORDER= ;; - -d) _debug_=1 ;; - -i) _intermediate_=1 ;; - -n) _trace_=echo ;; - -p) _proto_= ;; - -t) _total_=1 _trace_=: _components_= ;; - -u) _uncrate_=1 ;; - -x) set -x ;; - -E) _ignore_=1 ;; - -F) _force_=1 ;; - -L) _proto_default_=pr ;; - -O) _preserve_=1 ;; - -P) _proto_opt_=z$_proto_opt_ ;; - --) _options_="$_options_ $1"; shift; break ;; - '?'|[-+]*) echo "Usage: $_command_ [-cinptuxEF] [-r recipient] [-s spool-dir] [-X tool] [tool ...] [name=value ...]" >&2; exit 2 ;; - *=*) eval `echo $1 | sed -e '/^[a-zA-Z0-9_]*=/!d' -e "s/\([^=]*\)=\(.*\)/i=\1 \1=\'\2\'/"` - _export_="$_export_ $i" - ;; - *) break ;; - esac - _options_="$_options_ $1" - shift -done - -# -# option controlled vars -# - -export RECIPIENT -case $_uuspool_ in -"") case $SHIPSPOOL in - "") SHIPSPOOL="/var/spool/uucppublic/$RECIPIENT/* /var/spool/uucppublic/receive/$RECIPIENT/*" ;; - esac - ;; -*) SHIPSPOOL=$_uuspool_ ;; -esac -export SHIPSPOOL - -# -# must be in $INSTALLROOT -# - -if test ! -d ship -then echo "$_command_: must have \$INSTALLROOT/ship directory" >&2; exit 1 -fi - -cd $SHIP -case $_trace_ in -?*) $_trace_ cd $SHIP ;; -esac -_tmp_=SHIPtmp - -# -# best guess for cc command and flags -# probe info cached in $_ship_probe_ -# - -case $CC in -""|cc) test -f $INSTALLROOT/bin/cc && CC=$INSTALLROOT/bin/cc ;; -esac -case $CC in -$INSTALLROOT/bin/cc) - ;; -*) _ship_probe_=SHIPprobe - _ship_probe_PATH= - _ship_probe_CC= - _ship_probe_CCFLAGS= - test -f $_ship_probe_ && . ./$_ship_probe_ - case "+ $_ship_probe_PATH + $_ship_probe_CC +" in - "+ $PATH + $CC +") - CC="$_ship_probe_CC $_ship_probe_CCFLAGS" - case $_ship_probe_CCFLAGS in - ?*) CC="$CC $_ship_probe_CCFLAGS" ;; - esac - ;; - *) _ship_probe_PATH=$PATH - case $CC in - "") echo 'int main() { return 0; }' > ${_tmp_}0.c - cat > $_tmp_.c <<'!' -#include -#include -#define STD_POSIX1 (1<<5) -#define STD_LIMITS (1<<4) -#define STD_C (0<<3) -#define STD_POSIX2 (1<<2) -#define STD_XOPEN (1<<1) -#define STD_ALL (1<<0) -main(argc, argv) -int argc; -char** argv; -{ - int std = 0; -#ifdef __STDC__ - std |= STD_C; -#endif -#ifdef CHAR_BIT - std |= STD_LIMITS; -#endif -#ifdef PIPE_BUF - std |= STD_POSIX1; -#endif -#ifdef LINE_MAX - std |= STD_POSIX2; -#endif -#ifdef DBL_MAX - std |= STD_XOPEN; -#endif -#ifdef PID_MAX - std |= STD_ALL; -#endif - printf("#ccflags#%04o#%s\n", std, argv[1]); - return 0; -} -! - CC="`ifs=\$IFS - IFS=: - set /opt/SUNWspro/bin:+:$PATH:+:/opt/gnu/bin:/usr/add-on/gnu/bin:/usr/local/bin - IFS=\$ifs - path=\$* - set cc 9 gcc 8 xlc 7 acc 6 apcc 5 - std= - while : - do case \$# in - 0|1) break ;; - esac - for bin in \$path - - do case \$bin in - +) std=1\$std; continue ;; - -) break 2 ;; - esac - test -x \$bin/\$1 && break - done - case $std in - 1) cmd=\$1 ;; - *) cmd=\$bin/\$1 ;; - esac - seq= - rm -f ${_tmp_}0.exe - \$cmd -o ${_tmp_}0.exe ${_tmp_}0.c && ./${_tmp_}0.exe && - for opt in \ - '' \ - -D_ALL_SOURCE \ - -D_ANSI_SOURCE \ - -D_ANSI_C_SOURCE \ - -D_POSIX_SOURCE \ - -D_XOPEN_SOURCE \ - '-D_ANSI_SOURCE -D_POSIX_SOURCE' \ - '-D_ANSI_SOURCE -D_XOPEN_SOURCE' \ - '-D_ANSI_C_SOURCE -D_POSIX_SOURCE' \ - '-D_ANSI_C_SOURCE -D_XOPEN_SOURCE' \ - '-D_POSIX_SOURCE -D_XOPEN_SOURCE' \ - '-D_ANSI_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE' \ - '-D_ANSI_C_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE' \ - -posix - do seq=x$seq - xxx=$cmd - case \$opt in - '') tie=1 ;; - *) xxx=\"\$xxx \$opt\" tie=0 ;; - esac - \$xxx $_tmp_.c -o $_tmp_.exe && ./$_tmp_.exe \"\$2#\$tie# \$seq#\$xxx\" - done - shift - shift - done 2>/dev/null | sort +0r -1 +1 | grep '^#ccflags#' | sed -e '2,$d' -e 's/.*#//'`" - rm -f ${_tmp_}*.* - ;; - esac - case $CC in - "") CC=cc ;; - esac - echo 'int x;' > $_tmp_.c - rm -f $_tmp_.o 2>/dev/null - if $CC -c $_tmp_.c >/dev/null 2>&1 && test -f $_tmp_.o - then : ok - else echo "$_command_: must have CC=\"$CC\" to continue" >&2 - exit 1 - fi - _ship_probe_CC=$CC - _ship_probe_CCFLAGS= - - # - # commit the wimps - # - - echo "#if !defined(TEST) && (defined(__STDC__) || defined(__cplusplus)) -( -#else -#include -#include -#include -#include -#if defined(TEST) -#define glue(a,b) a ## b -glue(i, nt) -#else -int -#endif -int main(int argc, char** argv) { return 0; } -#endif -" > $_tmp_.c - if $CC $CCFLAGS -c $_tmp_.c >/dev/null 2>&1 - then if $CC $CCFLAGS -DTEST -c $_tmp_.c >/dev/null 2>&1 - then : ok - elif $CC -D__STDC__ $CCFLAGS -DTEST -c $_tmp_.c >/dev/null 2>&1 - then CC="$CC -D__STDC__" - case $_ship_probe_CCFLAGS in - ?*) _ship_probe_CCFLAGS="$_ship_probe_CCFLAGS " ;; - esac - _ship_probe_CCFLAGS="${_ship_probe_CCFLAGS}-D__STDC__" - fi - fi - echo "#include -#include -#include -int main() { return socket(0, 0, 0); }" > $_tmp_.c - for i in "" "-systype bsd43" - do if $CC $CCFLAGS $i -o $_tmp_.exe $_tmp_.c >/dev/null 2>&1 - then case $i in - ?*) CC="$CC $i" - case $_ship_probe_CCFLAGS in - ?*) _ship_probe_CCFLAGS="$_ship_probe_CCFLAGS " ;; - esac - _ship_probe_CCFLAGS="${_ship_probe_CCFLAGS}$i" - ;; - esac - break - fi - done - rm -f $_tmp_.* - { - echo _ship_probe_PATH="'$_ship_probe_PATH'" - echo _ship_probe_CC="'$_ship_probe_CC'" - echo _ship_probe_CCFLAGS="'$_ship_probe_CCFLAGS'" - } > $_ship_probe_ - ;; - esac - ;; -esac - -for i in $_export_ -do eval d='"$'$i'"' - case $d in - ?*) export $i ;; - esac -done - -# -# check the manifest and then copy from the spool area to $SHIP -# - -case $_debug_ in -?*) SHIPSPOOL= ;; -esac -for UUSHIP in $SHIPSPOOL -do if test -d $UUSHIP - then cd $UUSHIP - case $_trace_ in - ?*) $_trace_ cd $UUSHIP ;; - esac - for f in ${SHIPDATE}*.* - do if test -f $f/manifest - then _manifest_=`cat $f/manifest` - d= - for i in $_manifest_ - do if test ! -f $i - then case $i in - */*/*) case $i in - *.???) p=`echo $i | sed -e 's/\....$//'` ;; - *) p=$i ;; - esac - if test -d $SHIP/$p - then continue - fi - ;; - esac - echo "$f: $i has not arrived yet" >&2 - d=1 - fi - done - case $d in - ?*) continue ;; - esac - _unspool_= - for i in $_manifest_ - do case $i in - $f/unspool) _unspool_=$i ;; - esac - done - if test "" != "$_unspool_" -a -f $_unspool_ && $_trace_ . $_unspool_ - then : ok - else echo "$f: cannot unspool shipment" >&2; continue - fi - d= - for i in $_manifest_ - do case $i in - $f/*) ;; - *.000) d="$d $i" ;; - */*.*) ;; - */*/*) d="$d $i" ;; - esac - done - d=`echo "$d " | sed -e 's,//*[^/ ]* , ,g'` - $_trace_ rm -rf $f $d - fi - done - cd $INSTALLROOT - case $_trace_ in - ?*) $_trace_ cd $INSTALLROOT ;; - esac - fi -done - -# -# check for shipment support update -# -# B install in $BIN -# M must exist -# P must exist on PATH -# - -_path_=`echo $PATH | sed -e 's/:/ /g' -e 's,///*,/,g'` -_stamp_='`sed -e /@(#)$c'\''.* (AT.T.*).* [0-9][0-9]\\/[0-9][0-9]\\/[0-9][0-9]/!d'\'' -e '\''s/.*@(#).* (.*).* \\(..\\)\\/\\(..\\)\\/\\(..\\).*/\\3\\1\\2/'\'' -e q $f 2>/dev/null`' -_update_= -cd $SHIP -set iffe .sh BM \ - in '' M \ - op .c M \ - proto .c BM \ - ar /usr/ccs/bin P \ - -- ${1+"$@"} -while : -do case $1 in - --) shift; break ;; - esac - _cmd_=$1 - _suf_=$2 - _flg_=$3 - shift; shift; shift - case $_flg_ in - *B*) c=$_cmd_ ;; - *) c=ship$_cmd_ ;; - esac - case $_flg_ in - *P*) for i in $_path_ - do if test -x $i/$_cmd_ - then _flg_= - break - fi - done - case $_flg_ in - *P*) for i in $_suf_ - do if test -x $i/$_cmd_ - then PATH=$PATH:$i - _path_="$_path_ $i" - _flg_= - break - fi - done - case $_flg_ in - *P*) echo "$_command_: must have $_cmd_ to continue" >&2 - exit 1 - ;; - esac - ;; - esac - continue - ;; - esac - eval _ship${_cmd_}_=$SHIP/ship$_cmd_ - case $_trace_ in - ?*) continue ;; - esac - if test -f ship$_cmd_$_suf_ - then f=ship$_cmd_$_suf_; eval new=$_stamp_ - if test -f SHIP$_cmd_$_suf_ - then f=SHIP$_cmd_$_suf_; eval old=$_stamp_ - else old=0 - fi - else case $_flg_ in - *M*) echo "$_command_: must have ship$_cmd_$_suf_ to continue" >&2 - exit 1 - ;; - esac - eval _ship${_cmd_}_= - continue - fi - # the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0 - if test "$new" -gt "${old:-0}" - then case $_suf_ in - ?*) cp ship$_cmd_$_suf_ SHIP$_cmd_$_suf_ ;; - esac - elif test "$new" -lt "$old" - then cp SHIP$_cmd_$_suf_ ship$_cmd_$_suf_ - new=$old - _update_="$_update_ $_cmd_$_suf_" - fi - case $_suf_ in - ?*) f=ship$_cmd_; eval old=$_stamp_ - case $_suf_ in - .c) test -f $f && ./$f /dev/null 2>&1 || old=0 ;; - esac - # the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0 - if test "$new" -gt "${old:-0}" - then case $old in - ""|0) ;; - *) cp ship$_cmd_ SHIP$_cmd_ ;; - esac - case $_suf_ in - .c) if $CC $CCFLAGS -o SHIPa.out ship$_cmd_$_suf_ - then mv SHIPa.out ship$_cmd_ - else case $old in - ""|0) case $_flg_ in - *M*) echo "$_command_: must have ship$_cmd_ to continue" >&2 - exit 1 - ;; - esac - eval _ship${_cmd_}_= - continue - ;; - esac - fi - ;; - .sh) cp ship$_cmd_$_suf_ ship$_cmd_ - chmod +x ship$_cmd_ - ;; - esac - else new=$old - fi - esac - case $_flg_ in - *B*) f=$BIN/$_cmd_; eval old=$_stamp_ - # the variable "old" can be empty, to avoid "arithmetic syntax error" from ksh, set it to 0 - if test "$new" -gt "${old:-0}" - then if test ! -d $BIN - then mkdir $BIN - fi - cp ship$_cmd_ $BIN/$_cmd_ - fi - ;; - esac -done -case $_trace_ in -"") test -x $BIN/feature || ln $BIN/iffe $BIN/feature ;; -esac -case $_proto_ in -"") _shipproto_= ;; -esac -cd $INSTALLROOT -case " $_update_ " in -*" in "*) $_trace_ exec $_command_ $_options_ ${1+"$@"} ;; -esac - -# -# intermediate unpacking from spool area done -# - -case $_debug_$_intermediate_ in -?*) exit 0 ;; -esac - -# -# grab the select args -# - -SELECT=" " -while : -do case $# in - 0) break ;; - esac - case $1 in - *=*) break ;; - esac - SELECT="$SELECT$1 " - shift -done - -# -# handle character class botch -- it's hard to believe 9th edition -# did this, easier to believe BSD never added it -# - -cclasstype='^' -case a in -[${cclasstype}0]) ;; -[!0]) cclasstype='!' ;; -*) cclasstype='' ;; -esac - -# -# set up and verify the default directory hierarchy -# - -hierarchy="src src/cmd src/lib ship/shipslog" -case $_uncrate_ in -"") hierarchy="$hierarchy bin fun include lib man man/man1 man/man3 man/man8" ;; -esac -for d in $hierarchy -do if test ! -d $d - then $_trace_ mkdir $d - fi -done -if test ! -f src/Makefile -then case $_trace_ in - "") echo ":MAKE: lib - cmd" > src/Makefile ;; - *) $_trace_ echo ":MAKE: lib - cmd" "> src/Makefile" ;; - esac -fi -if test ! -f src/lib/Makefile -then case $_trace_ in - "") echo ':MAKE: lib[0-9]* - libast - *' > src/lib/Makefile ;; - *) $_trace_ echo ':MAKE: lib[0-9]* - libast - *' '> src/lib/Makefile' ;; - esac -fi -if test ! -f src/cmd/Makefile -then case $_trace_ in - "") echo ':MAKE: probe - cpp - *' > src/cmd/Makefile ;; - *) $_trace_ echo ':MAKE: probe - cpp - *' '> src/cmd/Makefile' ;; - esac -fi - -# -# ignore and silent may be used by nmake generated bootstraps -# - -case $_trace_$_uncrate_ in -"") if test ! -f bin/ignore - then cat > bin/ignore <<'!' -: -"$@" -exit 0 -! - chmod +x bin/ignore - fi - if test ! -f bin/silent - then cat > bin/silent <<'!' -: -case $1 in -+|-|"") exit 0 ;; -esac -"$@" -! - chmod +x bin/silent - fi - ;; -esac -trap 'exit 2' 1 2 - -# -# check if we can use nmake from the start -# if so then limit proto to notices only -# - -ACCEPT=nmake -_make_= -for p in $_path_ -do if test -f $p/nmake && test "`$p/nmake -n -f - 'error 0 \$(MAKEVERSION:@/.*\\(..\\)\\/\\(..\\)\\/\\(..\\)\$/\\3\\1\\2/)' 'nop:' nop &1`" -ge "$OLDEST_nmake" 2>/dev/null - then l=`echo $p | sed 's,[^/]*\$,lib,'` - _make_="$p/nmake MAKEPP=$l/cpp MAKERULES=$l/make/makerules" - ACCEPT= - _proto_default_=d$_proto_default_ - break - fi -done -_proto_default_=$_proto_default_$_proto_opt_ - -# -# some context for nohup.out -# - -if test -f nohup.out -then _nohup_="===============================================================================" - echo "$_nohup_" - id="`(uname -a) 2>/dev/null`" - case $id in - ?*) echo "system $id" ;; - esac - echo "installroot $INSTALLROOT" - case $SHIPSPOOL in - *"*"*) ;; - *) echo "shipspool $SHIPSPOOL" ;; - esac - case $INSTALLER in - $RECIPIENT) echo "by $FROMSYS!$INSTALLER" ;; - *) echo "by $FROMSYS!$INSTALLER for $RECIPIENT" ;; - esac - echo "archive $AR_PATH $AR_DELTA" - case $_make_ in - ?*) x=$_make_ ;; - *) x=mamexec ;; - esac - echo "build $x" - echo "cc $CC $CCFLAGS" - case $CCS in - ?*) echo "preroot $CCS" ;; - esac - echo "start `date`" - echo "$_nohup_" -else _nohup_= -fi - -# -# finish up initialization -# - -case $_trace_ in -?*) $_trace_ cd $SHIP ;; -esac -cd $SHIP - -# -# uncrate the archives into the source tree -# - -COMPONENTS_SELECT=" " -for NAME in * -do case $_exclude_ in - *" $NAME "*) continue ;; - esac - if test -f $NAME/items - then # don't rebuild items under local control - echo "$_command_: warning: $NAME: delete ship/$NAME/items to build" >&2 - continue - fi - case $cclasstype in - '!'|'^') - case $NAME in - *[${cclasstype}a-zA-Z_0-9]*) - continue ;; - esac - ;; - '') case "`echo $NAME | grep '[^a-zA-Z_0-9]'`" in - ?*) continue ;; - esac - ;; - esac - if test -d $NAME - then _release_= - _state_=found - case $NAME in - *_*) eval `echo $NAME | sed 's/\([^_]*\)_\(.*\)/_system_=\1 _tool_=\2/'` - _root_=$INSTALLROOT/$_system_ - if test ! -d $_root_ - then $_trace_ mkdir $_root_ - fi - for d in $hierarchy - do case $d in - ship/*) ;; - *) if test ! -d $_root_/$d - then $_trace_ mkdir $_root_/$d - fi - ;; - esac - done - ;; - *) _root_=$INSTALLROOT - _tool_=$NAME - ;; - esac - case $_tool_ in - lib*) _type_=lib ;; - *) _type_=cmd ;; - esac - _source_=$_root_/src/$_type_/$_tool_ - if test ! -d $_source_ - then $_trace_ mkdir $_source_ - fi - cd $NAME - base= # newest base - delta= # newest delta for newest base [not in dlist] - dlist= # list of deltas for newest base [no delta] - need= # pax needed to uncrate - new= # delta shipments requiring new base - old= # first base for new chain - remove= # old shipments to be removed - type= # base|delete|delta|patch - for d in $SHIPMENT - do case $d in - "$SHIPMENT") continue ;; - esac - if test -f $d/base -o -f $d/delete - then remove="$remove $base $dlist $delta $need $new" - base=$d - delta= - need= - new= - if test -f $d/delete - then type=delete - else type=base - fi - else if test "" != "$base" -a -f $d/$base && egrep 'DELTA!!!|!PAX!D!' $d/$base >/dev/null - then case $AR_DELTA in - "") need="$need $d" - continue - ;; - esac - type=delta - else type=patch - fi - case $base in - "") dlist="$dlist $d" - ;; - *) if test -f $d/$base - then dlist="$dlist $delta" - delta=$d - elif test "" != "$delta" -a -f $d/$delta - then dlist="$dlist $base" - case $new in - "") old=$base ;; - esac - new="$new $delta" - base=$delta - delta=$d - else dlist="$dlist $d" - fi - ;; - esac - fi - done - case $type in - delete) case $NAME in - lib*) i=lib ;; - *) i=cmd ;; - esac - cd $SHIP - $_trace_ rm -rf $SHIP/$NAME $INSTALLROOT/src/$i/$NAME - continue - ;; - esac - for i in $new - do echo generate $NAME $i base from $old >&2 - case $_trace_ in - "") echo "generate $NAME $i base from $old [`date`]" >> $SHIP/$NAME/$LOG - case $type in - delta) $AR_DELTA -rf $i/$old -z $old/base -wf $i/base - _code_=$? - ;; - patch) mkdir /tmp/ship.$$ - cd /tmp/ship.$$ - $AR_READ < $SHIP/$NAME/$old/base && - $AR_READ < $SHIP/$NAME/$i/$old && - { - $AR_LIST < $SHIP/$NAME/$old/base - $AR_LIST < $SHIP/$NAME/$i/$old - } | sort -u | $AR_WRITE > $SHIP/$NAME/$i/base - _code_=$? - cd $SHIP/$NAME - rm -rf /tmp/ship.$$ - ;; - esac - case $_code_ in - 0) touch $i/GENERATED - ;; - *) echo "cannot generate $i base from $old" >&2 - echo "cannot generate $i base from $old" >> $SHIP/$NAME/$LOG - break - ;; - esac - ;; - *) $_trace_ $AR_DELTA -rf $SHIP/$NAME/$i/$old -z $SHIP/$NAME/$old/base -wf $i/base - $_trace_ touch $SHIP/$NAME/$i/GENERATED - ;; - esac - old=$i - done - case $base in - "") echo "$_command_: warning: $NAME: no base archive" >&2 - cd $SHIP - continue - ;; - esac - case $_preserve_ in - ?*) case `echo $remove $dlist` in - ?*) case $_trace_ in - "") rm -rf $remove $dlist 2>/dev/null ;; - *) $_trace_ "(cd $NAME; rm -rf" $remove $dlist")" ;; - esac - ;; - esac - ;; - esac - $_trace_ cd $_source_ - case $delta in - "") _release_=$base ;; - *) _release_=$delta ;; - esac - if test 11 = "$_force_$_uncrate_" -o ! -f $SHIP/$NAME/$_release_/UNCRATED - then echo uncrate $NAME $_release_ $type >&2 - case $_trace_ in - "") echo "uncrate $NAME $_release_ $type [`date`]" >> $SHIP/$NAME/$LOG ;; - esac - error= - if test -f $SHIP/$NAME/$_release_/delete - then cd $SHIP - rm -rf $NAME - continue - fi - if test ! -f $SHIP/$NAME/$_release_/items - then echo "$_command_: warning: $NAME: no items file" >&2 - fi - _proto_options_="-${_proto_default_}c`cat $SHIP/$NAME/$_release_/copyright 2>/dev/null`" - if test "" = "$AAR_LIST" -o "delta" = "$type" || $OAR_LIST < $SHIP/$NAME/$base/base >/dev/null 2>&1 - then AR_PATH=$OAR_PATH - AR_LIST=$OAR_LIST - AR_READ=$OAR_READ - AR_WRITE=$OAR_WRITE - else AR_PATH=$AAR_PATH - AR_LIST=$AAR_LIST - AR_READ=$AAR_READ - AR_WRITE=$AAR_WRITE - fi - for i in base $base - do case $type in - base|patch) - case $type in - base) if test ! -f $SHIP/$NAME/$_release_/GENERATED - then case $_trace_ in - "") rm -rf * ;; - *) $_trace_ "(cd $_source_; rm -rf *)" ;; - esac - fi - ;; - esac - _base_=$i - case $_base_ in - base) _release_=$base ;; - *) _release_=$delta ;; - esac - case $_trace_ in - "") if $AR_READ < $SHIP/$NAME/$_release_/$_base_ - then case $_shipproto_ in - ?*) $AR_LIST <$SHIP/$NAME/$_release_/$_base_ 2>/dev/null | grep '\.[chlyY]$' | $_shipproto_ -l - "${_proto_options_}" - ;; - esac - if test -d features && test ! -d feature - then ln -s features feature 2>/dev/null - elif test -d feature && test ! -d features - then ln -s feature features 2>/dev/null - fi - else error="$AR_PATH $type read failed" - fi - ;; - *) $_trace_ "$AR_READ < $SHIP/$NAME/$_release_/$_base_" - case $_shipproto_ in - ?*) $_trace_ "$AR_LIST <$SHIP/$NAME/$_release_/$_base_ 2>/dev/null | grep '\.[chlyY]\$' | $_shipproto_ -l - ${_proto_options_}" ;; - esac - ;; - esac - case $type in - base) break ;; - esac - ;; - delta) if $_trace_ $AR_DELTA -rf $SHIP/$NAME/$_release_/$base -z $SHIP/$NAME/$base/base - then $_trace_ touch $SHIP/$NAME/$base/UNCRATED - case $_shipproto_ in - ?*) case $_trace_ in - "") ($AR_DELTA -f $SHIP/$NAME/$base/base '*.[chlyY]'; $AR_DELTA -f $SHIP/$NAME/$_release_/$base '*.[chlyY]') 2>/dev/null | sort -u | $_shipproto_ -l - "${_proto_options_}" ;; - *) $_trace_ "($AR_DELTA -f $SHIP/$NAME/$base/base '*.[chlyY]'; $AR_DELTA -f $SHIP/$NAME/$_release_/$base '*.[chlyY]') 2>/dev/null | sort -u | $_shipproto_ -l - ${_proto_options_}" ;; - esac - ;; - esac - case $_trace_ in - "") if test -d features && test ! -d feature - then ln -s features feature 2>/dev/null - elif test -d feature && test ! -d features - then ln -s feature features 2>/dev/null - fi - ;; - esac - else error="$AR_DELTA $type read failed" - fi - break - ;; - esac - done - case $error in - "") $_trace_ touch $SHIP/$NAME/$_release_/UNCRATED ;; - *) echo "$_command_: $NAME: $_release_: uncrate error: $error" >&2 - case $_trace_ in - "") echo "uncrate $NAME $_release_ $type error: $error" >> $SHIP/$NAME/$LOG ;; - esac - _state_=error - ;; - esac - fi - cd $SHIP - eval STATE_$NAME=$_state_ - case $_state_ in - error) ;; - *) case $need in - ?*) for i in $need - do NEED_pax="$NEED_pax $NAME/$i" - done - ;; - *) eval RELEASE_$NAME=$_release_ SOURCE_$NAME=$_source_ TOOL_$NAME=$_tool_ - COMPONENTS_SELECT="$COMPONENTS_SELECT$NAME " - ;; - esac - ;; - esac - fi -done -case $COMPONENTS_SELECT in -" ") exit 0 ;; -esac -case $_uncrate_ in -?*) case $NEED_pax in - ?*) case $STATE_pax in - found) ;; - *) echo $_command_: pax required to uncrate$NEED_pax >&2 ;; - esac - ;; - esac - exit 0 - ;; -esac - -# -# determine the ordered list of components to (re)build -# - -case $SELECT in -" ") COMPONENTS="$ORDER $COMPONENTS_SELECT" ;; -*) COMPONENTS= - for NAME in $COMPONENTS_SELECT - do case $SELECT in - *" $NAME "*) COMPONENTS="$COMPONENTS $NAME" ;; - esac - done - ;; -esac - -# -# get the component closure -# - -case $_closure_ in -"") ORDER=$COMPONENTS - ;; -*) ORDER= - for NAME in $COMPONENTS - do old= - new=$NAME - while : - do case $new in - $old) break ;; - esac - dup= - for _item_ in $new - do # we assume ITEMS_* not in environment - eval _items_='"$'ITEMS_$_item_'"' - case $_items_ in - "") eval _release_='$'RELEASE_$_item_ - _items_=`cat $_item_/$_release_/items 2>/dev/null`" $_item_" - eval ITEMS_$_item_='"$'_items_'"' - ;; - esac - dup="$dup $_items_" - done - old=$new - new= - for _item_ in $dup - do eval SEEN_$_item_= - done - for _item_ in $dup - do eval seen='$'SEEN_$_item_ - case $seen in - "") eval SEEN_$_item_=1 - new="$new $_item_" - ;; - esac - done - done - eval ITEMS_$NAME='"'$new'"' - ORDER="$ORDER $new" - done - dup=$ORDER - ORDER= - for NAME in $dup - do eval SEEN_$NAME= - done - for NAME in $dup - do eval seen='$'SEEN_$NAME - case $seen in - "") eval SEEN_$NAME=1 - ORDER="$ORDER $NAME" - ;; - esac - done - ;; -esac -_built_= -COMPONENTS= - -for NAME in $ORDER -do case $_exclude_ in - *" $NAME "*) continue ;; - esac - eval _release_='$'RELEASE_$NAME - test -f $NAME/$_release_/items || continue - case $_force_ in - "") _built_=$NAME/$_release_/BUILT - eval _items_='$'ITEMS_$NAME - for i in $_items_ - do case " $COMPONENTS " in - *" $i "*) _built_=; break ;; - esac - case $i in - $NAME) ;; - *) eval _built_='"'$_built_ $i/'$'RELEASE_$i/BUILT'"' ;; - esac - done - case $_built_ in - ?*) if $_shipop_ newer $_built_ - then continue - fi - ;; - esac - ;; - esac - $_trace_ rm -f $NAME/$_release_/BUILT - if test "" != "$_force_" -o "" != "$_ignore_" -o ! -f $NAME/$_release_/ERROR - then COMPONENTS="$COMPONENTS $NAME" - $_trace_ rm -f $NAME/$_release_/ERROR - elif test ! -f $NAME/$_release_/BYPASS - then echo "$_command_: $NAME/$_release_: new shipment required" >&2 - fi -done - -# -# tame the environment -# - -case $_make_ in -?*) STATE_nmake=installed ;; -esac -case $_make_ in -""|$BIN/nmake) - MAKEPP=$INSTALLROOT/lib/cpp - MAKERULES=$INSTALLROOT/lib/make/makerules - export MAKEPP MAKERULES - _make_=$BIN/nmake - ;; -esac -COSHELL_OPTIONS=nodevfd -ENV= -MAKE_OPTIONS="clobber compare link=lib*.a*" -MAKEPATH= -PATH=:$INSTALLROOT/bin:$PATH -VPATH= -export COSHELL_OPTIONS ENV MAKE_OPTIONS MAKEPATH PATH VPATH -case $_AST_FEATURES in -"") _AST_FEATURES='UNIVERSE - att PATH_RESOLVE - logical' - export _AST_FEATURES - ;; -esac - -# -# (re)build the components -# - -cd $INSTALLROOT -for NAME in $COMPONENTS -do case $_exclude_ in - *" $NAME "*) continue ;; - esac - eval _items_='$'ITEMS_$NAME - case $_trace_ in - "") for i in $_items_ - do case $i in - $NAME) ;; - *) eval r='$'RELEASE_$i - if test ! -f $SHIP/$i/$r/BUILT - then if test -f $SHIP/$i/$r/ERROR - then m="had build errors" - elif test -f $SHIP/$i/$r/UNCRATED - then m="was not built" - else m="was not shipped" - fi - m="$NAME requires $i but $i $m" - echo "$m" >&2 - echo "$m" >> $SHIP/$NAME/$LOG - continue 2 - fi - ;; - esac - done - ;; - esac - eval _release_='$'RELEASE_$NAME _source_='$'SOURCE_$NAME _tool_='$'TOOL_$NAME - case $_total_ in - ?*) _components_="$_components_ $NAME/$_release_" - continue - ;; - esac - echo build $NAME $_release_ >&2 - $_trace_ cd $_source_ - case $_trace_ in - "") start="`date`" - if test -f $_bypass_ - then touch $SHIP/$NAME/$_release_/BYPASS - else case $STATE_nmake in - installed|ok) - case $NAME in - nmake) $_make_ -o "ignorelock mismatch" ${1+"$@"} - MAKEPP=$INSTALLROOT/lib/cpp ./nmake -o "ignorelock mismatch" -bcf Makerules.mk - MAKEPP=$INSTALLROOT/lib/cpp MAKERULES=./Makerules.mo ./nmake -o "ignorelock mismatch" install ${1+"$@"} - ;; - *) $_make_ -o "ignorelock mismatch" install ${1+"$@"} - ;; - esac - error=$? - ;; - *) if test -f Mamfile - then # here it is -- make+state in v7 shell -case $_read_ in -"") case `(echo ok | (read -r a; echo $a) 2>/dev/null)` in - ok) _read_='read -r' ;; - *) _read_=read ;; - esac - eval `( - mkdir /tmp/mam$$ - cd /tmp/mam$$ - echo 'int main(){return 0;}' > main.c - if $CC -c main.c >/dev/null 2>&1 - then if $CC -L. main.o -lc >/dev/null 2>&1 - then $CC -L. main.o -lc > libc.a >/dev/null 2>&1 || echo "mam_cc_L=' '" - fi - fi - echo "int f(){return(0);} int main(){return(f());}" > pic.c - if $CC -c pic.c >/dev/null 2>e - then e=\`wc -l e\` - s=\`wc pic.o\` - set x -Kpic -fpic -pic +z '-G 0' - while : - do shift - case $# in - 0) break ;; - esac - rm -f pic.o pic.exe - $CC $1 -c pic.c >/dev/null 2>e && test -f pic.o && $CC $1 -o ./pic.exe pic.o >/dev/null 2>&1 && test -f pic.exe || continue - case \`wc -l e\` in - $e) ;; - *) continue ;; - esac - case $1 in - ???*) os=\`wc pic.o\` - case $os in - $s) continue ;; - esac - m=\`echo " $1" | sed -e 's/^ [-+]//g' -e 's/./-& /g' -e 's/[-+] //g'\` - rm -f pic.o pic.exe - if $CC $m -c pic.c >/dev/null 2>e && test -f pic.o && $CC $m -o ./pic.exe pic.o >/dev/null 2>&1 && test -f pic.exe - then case \`wc -l e\` in - $e) continue - ;; - *) case \`wc pic.o\` in - $s|$os) continue ;; - esac - ;; - esac - fi - echo "mam_cc_PIC='$1'" - break - ;; - *) case \`wc pic.o\` in - $s) ;; - *) echo "mam_cc_PIC='$1'" - break - ;; - esac - ;; - esac - done - fi - cd / - rm -rf /tmp/mam$$ - )` - ;; -esac -case $_redirect_ in -"") case `(a=old; eval a=new /dev/null` in - new) _redirect_=new ;; - *) _redirect_=old ;; - esac - ;; -esac -( -_code_=1 -_list_= -_main_=0 -_mam_=MAM -_targ_=install - -trap " - mv $_mam_.list.tmp $_mam_.list - rm -f $_mam_.*.tmp - $_shipop_ state $_mam_.list < $_mam_.list | sort > $_mam_.time - trap 0 1 2 - exit \$_code_ -" 0 1 2 -# some shells die with diff,next,same in vars -: > $_mam_.diff.tmp -exec 9> $_mam_.list.tmp -if test -f $_mam_.list -a -f $_mam_.time -then $_shipop_ state $_mam_.list < $_mam_.list | sort > $_mam_.sort.tmp - comm -12 $_mam_.time $_mam_.sort.tmp | sed 's/ .*//' > $_mam_.same.tmp - rm -f $_mam_.sort.tmp -else : > $_mam_.same.tmp -fi - -_index_=_ -_ifs_=$IFS -case $_read_ in -"read") # read strips \ -- thanks a lot - # tmp file avoids char at a time read - sed 's/\\/\\\\/g' Mamfile > $_mam_.read.tmp - exec < $_mam_.read.tmp - ;; -*) exec < Mamfile - ;; -esac -eval `sed -e '1,/^make /d' -e '/^setv /!d' -e 's/^setv \([^ ]*\).*/\1= /' Mamfile` -for _data_ -do eval `echo $_data_ | sed -e 's/\"/\\\\"/g' -e 's/=/=\\"/' -e 's/\$/\\"/'` -done -_old_=1 -while IFS=' '; $_read_ _op_ _arg_ _val_ -do IFS=$_ifs_ - case $_op_ in - "note") continue - ;; - "info") case $_arg_ in - "mam") _old_= ;; - esac - continue - ;; - "setv") eval _data_='$'$_arg_ - case $_index_:$_data_ in - __*:*|*:) - case $_redirect_ in - new) eval $_arg_="$_val_" /dev/null && _attr_= ;; - esac - ;; - *) _attr_= - ;; - esac - case " $_val_ " in - *" metarule "*) _attr_=M$_attr_ ;; - esac - case $_attr_ in - *u*) echo $_name_ >> $_mam_.diff.tmp ;; - esac - _index_=_$_index_ - eval _name_$_index_=$_name_ - eval _prev_$_index_=$_prev_ - eval _cmds_$_index_=$_cmds_ - eval _attr_$_index_=$_attr_ - echo $_name_ >&9 - continue - ;; - "prev") case $_attr_ in - *u*) ;; - *) case $_force_ in - "") eval _arg_=$_arg_ - if grep "^$_arg_\$" $_mam_.diff.tmp >/dev/null - then _attr_=u$_attr_ - elif grep "^$_arg_\$" $_mam_.same.tmp >/dev/null - then : - else _attr_=u$_attr_ - fi - ;; - *) _attr_=u$_attr_ - ;; - esac - ;; - esac - continue - ;; - esac - case $_index_ in - _) echo $_op_: missing make op >&2; continue ;; - esac - case $_op_ in - "attr") case $_arg_ in - "meta"|"suff") _attr_=M ;; - esac - ;; - "exec"|"....") - case $_old_ in - "") _arg_=$_val_ - ;; - *) case $_val_ in - ?*) _arg_="$_arg_ $_val_" ;; - esac - ;; - esac - case $_cmds_ in - "") _cmds_=$_arg_ - ;; - *) _cmds_="$_cmds_ -$_arg_" - ;; - esac - ;; - "done") eval _arg_=$_arg_ - _prop_= - case $_arg_ in - $_targ_) _main_=2 ;; - esac - case $_arg_ in - $_name_)case $_attr_ in - *M*) ;; - *u*) case $_cmds_ in - "") case $_attr_ in - *u*) _prop_=u ;; - esac - ;; - *) eval "($_set_$_cmds_) &2 - _code_=$_status_ - exit $_code_ - ;; - esac - } - _prop_=u - echo $_name_ >> $_mam_.diff.tmp - ;; - esac - ;; - esac - _index_=$_prev_ - eval _name_='$'_name_$_index_ - eval _prev_='$'_prev_$_index_ - eval _cmds_='$'_cmds_$_index_ - eval _attr_='$'_attr_$_index_ - case $_attr_ in - *u*) ;; - *) _attr_=$_prop_$_attr_ ;; - esac - ;; - *) echo $_arg_: $_op_ $_name_ expected >&2 - ;; - esac - ;; - esac -done -exec 9>&- -case $_main_ in -2) _code_=0 ;; -*) echo "*** don't know how to make $_targ_" >&2 ;; -esac -exit $_code_ -); error=$? - # ... indent - elif test -f makefile - then make -f makefile install ${1+"$@"}; error=$? - elif test -f Makescript - then ./Makescript ${1+"$@"}; error=$? - elif test -f $_tool_.bs - then ./$_tool_.bs ${1+"$@"}; error=$? - else echo "$_command_: cannot build $NAME" >&2; error=1 - fi - ;; - esac - case $error+$NAME in - 0+nmake) $BIN/nmake -n -f /dev/null debug /dev/null 2>&1 || error=1 ;; - esac - case $error in - 0) touch $SHIP/$NAME/$_release_/BUILT ;; - *) touch $SHIP/$NAME/$_release_/ERROR ;; - esac - fi 2>&1 | (PATH=$OPATH; tee $SHIP/$NAME/$TMP 1>&2) - if test -f $SHIP/$NAME/$_release_/BUILT - then state=ok - elif test -f $SHIP/$NAME/$_release_/BYPASS - then state=bypass - else state=error - fi - { - echo "build $NAME $_release_ $state [$start] [`date`]" - case $CCS in - ?*) echo preroot CCS = $CCS ;; - esac - # some egreps blow this - sed \ - -e '/^$/d' \ - -e '/^[ ]/d' \ - -e '/^+ /d' \ - -e '/^[^ ]*:$/d' \ - -e '/^[a-z] - /d' \ - -e '/^[a-zA-Z_][a-zA-Z_0-9]*$/d' \ - -e '/^[a-zA-Z_][a-zA-Z_0-9]*=/d' \ - -e '/[Cc]opyright/d' \ - -e '/: warning: assignment .* == was expected/d' \ - -e '/: warning: if .* no effect/d' \ - -e '/: warning: Symbol .* multiply defined/d' \ - $SHIP/$NAME/$TMP - rm -f $SHIP/$NAME/$TMP - } >> $SHIP/$NAME/$LOG 2> /dev/null - eval STATE_$NAME=$state - ;; - *) if test -f $_source_/$_bypass_ - then $_trace_ "refer to $_source_/$_bypass_ to install $NAME" - else case $STATE_nmake in - installed|ok) - case $NAME in - nmake) $_trace_ $_make_ -o "ignorelock mismatch" ${1+"$@"} - $_trace_ ./nmake -o "ignorelock mismatch" -bcf Makerules.mk - $_trace_ ./nmake -o "ignorelock mismatch" install ${1+"$@"} - ;; - *) $_trace_ $_make_ -o "ignorelock mismatch" install ${1+"$@"} - ;; - esac - ;; - *) if test -f $_source_/Mamfile - then $_trace_ "mamexec < Mamfile" - elif test -f $_source_/Makescript - then $_trace_ ./Makescript ${1+"$@"} - elif test -f $_source_/$_tool_.bs - then $_trace_ ./$_tool_.bs ${1+"$@"} - else $_trace_ install $NAME - fi - ;; - esac - fi - ;; - esac - $_trace_ cd $INSTALLROOT - - # - # accept stuff built before nmake to sync the state files - # - - case $NAME in - $ACCEPT) - for NAME in $COMPONENTS - do eval state='$'STATE_$NAME _source_='$'SOURCE_$NAME - case $state in - ok) case $_trace_ in - "") cd $_source_ - { - $BIN/nmake -o "accept ignorelock mismatch touch" install force_shared=1 - case $NAME in - lib*) $BIN/nmake -o "accept" install ;; - esac - } 2>&1 | (PATH=$OPATH; tee $SHIP/$NAME/$TMP 1>&2) - { - echo "accept $NAME" - egrep -v '^([^ ]*:$| |\+ |[a-z] - |[a-zA-Z_][a-zA-Z_0-9]*=|$)' $SHIP/$NAME/$TMP - rm -f $SHIP/$NAME/$TMP - } 2>&1 >> $SHIP/$NAME/$LOG - cd $INSTALLROOT - ;; - *) $_trace_ cd $_source_ - $_trace_ $BIN/nmake -o "accept ignorelock mismatch touch" install force_shared=1 - case $NAME in - lib*) $_trace_ $BIN/nmake -o "accept" install ;; - esac - $_trace_ cd $INSTALLROOT - ;; - esac - ;; - esac - done - case $NAME in - $ACCEPT) break ;; - esac - ;; - esac -done -case $_total_ in -?*) case $RANDOM in - $RANDOM)cd $SHIP - ls -Cd $_components_ - ;; - *) PS3='' - eval ' select i in $_components_ - do : - done /dev/null` - case $r in - *\[no\]*) r= ;; - esac - case $r' + '$state in - ?*' + '*|*' + 'error) - address=`cat $o` - owner=`echo $address | sed -e 's/.*\(.............\)/\1/' -e 's/^[^a-zA-Z_]/_/' -e 's/[^a-zA-Z_0-9]/_/g'` - eval f='$'built_$owner - eval built_$owner='"$'f $NAME'"' - report= - for f in $SHIP/$NAME/$LOG $r - do case `ls -dt $f $SHIPSLOG/!$owner 2>/dev/null` in - $f*) report="$report $f" ;; - esac - done - case $report in - ?*) eval f='$'address_$owner - case $f in - "") owners="$owners $owner" - eval address_$owner=$address - ;; - esac - eval eval report_$owner=\\\"\$report_$owner \\\[$NAME\\\] $report\\\" - ;; - esac - ;; - esac - fi -done - -# -# check if any components required pax to uncrate -# - -case $NEED_pax in -?*) AR_DELTA=$INSTALLROOT/bin/pax - ($AR_DELTA -f /dev/null -z /dev/null) >/dev/null 2>&1 || STATE_pax=error - case $STATE_pax in - ok) $_trace_ exec $_command_ $_options_ $SELECT ${1+"$@"} ;; - *) echo $_command_: pax required to uncrate$NEED_pax >&2 ;; - esac - ;; -esac - -# -# done -# - -exit 0 diff --git a/cde/programs/dtksh/ksh93/ship/shipop.c b/cde/programs/dtksh/ksh93/ship/shipop.c deleted file mode 100644 index ecb5281ee..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipop.c +++ /dev/null @@ -1,280 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: shipop.c /main/4 1996/10/04 15:58:45 drk $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS PROPRIETARY SOURCE CODE LICENSED BY * -* AT&T CORP. * -* * -* Copyright (c) 1995 AT&T Corp. * -* All Rights Reserved * -* * -* This software is licensed by AT&T Corp. * -* under the terms and conditions of the license in * -* http://www.research.att.com/orgs/ssr/book/reuse * -* * -* This software was created by the * -* Software Engineering Research Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* gsf@research.att.com * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -static const char id[] = "\n@(#)shipop (AT&T Bell Laboratories) 06/11/92\0\n"; - -#include -#include -#include - -#define elementsof(x) (sizeof(x)/sizeof(x[0])) - -static char* cmd = "shipop"; -static char* op; - -static int status; - -extern __MANGLE__ int close __PROTO__((int)); -extern __MANGLE__ void exit __PROTO__((int)); -extern __MANGLE__ int open __PROTO__((const char*, int, ...)); -extern __MANGLE__ int read __PROTO__((int, char*, int)); -extern __MANGLE__ int strcmp __PROTO__((const char*, const char*)); -extern __MANGLE__ time_t time __PROTO__((time_t*)); - -static void -error __PARAM__((int level, const char* file, const char* msg), (level, file, msg)) __OTORP__(int level; const char* file; const char* msg;){ - fprintf(stderr, "%s: %s", cmd, op); - if (level == 1) fprintf(stderr, ": warning"); - if (file) fprintf(stderr, ": %s", file); - if (msg) fprintf(stderr, ": %s", msg); - fprintf(stderr, "\n"); - if (level > status) - { - if (level > 2) exit(level - 2); - status = level; - } -} - -/* - * shipop newer [ reference [ file ... ] ] - */ - -static int -shipnewer __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){ - unsigned long ref; - struct stat st; - - if (!*argv || stat(*argv, &st)) return(1); - ref = (unsigned long)st.st_mtime; - while (*++argv) - if (stat(*argv, &st) || ref < (unsigned long)st.st_mtime) return(1); - return(0); -} - -#define HASHPART(h,c) (h = (h) * 987654321L + 123456879L + (c)) - -static char buf[4096]; - -static unsigned long -sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP__(char* file; int fd; unsigned long s;){ - unsigned char* b; - unsigned char* e; - int n; - - HASHPART(s, 0); - while ((n = read(fd, buf, sizeof(buf))) > 0) - { - b = (unsigned char*)buf; - e = b + n; - while (b < e) HASHPART(s, *b++); - } - if (n < 0) error(2, file, "read error"); - return(s); -} - -/* - * shipop seal [ file ... ] - */ - -static int -shipseal __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){ - char* f; - int fd; - unsigned long s; - - s = 0; - if (!*argv) s = sealfile("/dev/stdin", 0, s); - else while (f = *argv++) - { - if (*f == '-' && !*(f + 1)) s = sealfile("/dev/stdin", 0, s); - else if ((fd = open(f, 0)) < 0) error(2, f, "cannot read"); - else - { - s = sealfile(f, fd, s); - close(fd); - } - } - printf("%08lx\n", s); - return(status); -} - -/* - * shipop state reference [ file ... | buf) - { - *s = 0; - if (!stat(buf, &st)) - printf("%s %ld\n", buf, (long)st.st_mtime - ref); - } - } while (c != EOF); - return(status); -} - -/* - * shipop time [ file ] - */ - -static int -shiptime __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){ - struct stat st; - time_t date; - - if (*argv && !stat(*argv, &st)) date = st.st_mtime; - else time(&date); - printf("%08lx\n", (long)date); - return(status); -} - -/* - * shipop xap [ file ... ] - */ - -static int -shipxap __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){ - error(2, "xap not implemented yet", (char*)0); - return(1); -} - -struct optab -{ - char* name; - int (*func) __PROTO__((char**)); -}; - -static struct optab ops[] = -{ - "newer", shipnewer, - "seal", shipseal, - "state", shipstate, - "time", shiptime, - "xap", shipxap, -}; - -int main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ - char* s; - int i; - - if (!(s = *++argv)) - exit(0); - for (i = 0; i < elementsof(ops); i++) - if (!strcmp(s, ops[i].name)) - { - op = ops[i].name; - exit((*ops[i].func)(argv + 1)); - } - fprintf(stderr, "Usage: %s %s", cmd, ops[0].name); - for (i = 1; i < elementsof(ops); i++) - fprintf(stderr, " | %s", ops[i].name); - fprintf(stderr, " [ file ... ]\n"); - exit(2); -} diff --git a/cde/programs/dtksh/ksh93/ship/shipout b/cde/programs/dtksh/ksh93/ship/shipout deleted file mode 100755 index 5ef658963..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipout +++ /dev/null @@ -1,1908 +0,0 @@ -: -# @(#)shipout (gsf@research.att.com) 07/17/95 -# -# shipout [ options ... ] [ name ... ] [ tool ... ] -# -# ship software to recipient using system|user info in $SHIPINFO -# -# options -- + turns the corresponding option off -# -# -b ship bases with deltas -# -c don't generate tool closure -# -d don't ship deltas -# -i list info on specified recipient(s) only -# -k mark recipient(s) as having received tool(s) -# -l file list of people to ship to -# -m don't send shipment manifest mail message -# -n show but don't execute -# -o set shipment ownership to shipper -# -p name next argument is a recipient to ship to -# -s don't send shipment support files -# -t don't execute but show total shipment -# -u [[yy]mm]dd ignore db info for date pattern -# -v yymmdd override current date stamp -# -w shipment suitable for www -# -x format pax output format and compression -# -C files add to default crate file list -# -D secs delay in seconds between sends -# -F force db override -# -S files add to default support file list -# -# name -- recipient address -# -# machine!user uucp address -# host:directory rcp address -# *%[beta.]bin[.arch] compressed cpio binary archive in Z/*[.arch] -# *%ftp sh script with ftp get's on stdout -# *%[beta.]lib[.arch] compressed cpio binary archive in Z/*[.arch] -# *%list shipment file list on stdout -# *%pull sh script with datakit pull's on stdout -# *%push sh script with datakit push's on stdout -# *%[beta.]src compressed cpio src archive in Z/* -# -# the message file is evaluated by the shell and the following variables -# are predefined by ship: -# -# f list of expanded file names -# name name of shipee -# - -umask 02 -PATH=:$PATH - -SHIPSLOG=${SHIPSLOG:-shipslog} -SHIPINFO=${SHIPINFO:-$SHIPSLOG/info} -SHIPFILES="README shipin shipout" -SHIPAUX="shipiffe.sh shipop.c shipproto.c" -SHIPMENT=*[0-9][0-9][0-9][0-9][0-9][0-9] -SHIPPER=${SHIPPER:-${USER:-${LOGNAME:-${HOME##*/}}}} -SHIPSPOOL=${SHIPSPOOL:-/var/spool/uucppublic} -SHIPORG=${SHIPORG:-"Software and Systems Research"} -SHIPLOGO=${SHIPLOGO:-"http://www1126.research.att.com/logos/attbllogo.gif align=middle"} -SHIPMM2HTML=${SHIPMM2HTML:-mm2html} -CRATEFILES="copyright items message promo release report" -TMP=${TMPDIR:=/tmp}/ship$$ -FROMSYS=$( (uname -n || hostname || cat /etc/whoami) 2>/dev/null ) - -test -f shipinit && . ./shipinit - -function errexit -{ - # print out an error message on unit 2 and exit - print -u2 - "$command: $@" - exit 1 -} - -function warning -{ - print -u2 - "$command: warning: $@" -} - -function cleanup # exitcode -{ - trap - EXIT INT TERM - db_done - rm -f $TMP.? - exit $1 -} - -db_access= -db_data= -db_disable= -db_key_base= -db_key_delta= -db_pid= -db_status= - -# -# send request to dbm server -# status returned in db_status -# data returned in db_data -# - -function db_request # op args ... -{ - print -p "$@" - read -p db_status db_data - case $db_debug in - ?*) print -u2 DB: "$@": $db_status $db_data ;; - esac - case $db_status in - I) return 0 ;; - E) print -u2 $logfile: $db_data; return 1 ;; - *) return 1 ;; - esac -} - -# -# initialize db -# - -function db_init # machine user -{ - typeset log=$logfile machine=$1 user=$2 i j l - - case $db_disable in - ?*) return 0 ;; - esac - case $db_debug in - grep) db_access=grep ;; - esac - case $db_access in - "") case $log in - "") ifs=$IFS - IFS=: - set -- $PATH - IFS=$ifs - for i - do case $i in - */bin) i=${i%/bin} - for j in /share/ / - do l=${i}${j}lib/ship/log - if test -f $l.dir -a -r $l.dir -a -w $l.dir - then log=$l - break 2 - fi - done - ;; - esac - done - case $log in - "") log=$SHIPSLOG/log ;; - esac - ;; - esac - case $log in - /*) ;; - *) log=$PWD/$log ;; - esac - db_access=grep - if cs /dev/null 2>&1 - then cs -i /dev/tcp/share/dbm/group=ship |& - db_pid=$! - if db_request version - then db_request open $log w || errexit $log: cannot access log - db_access=dbm - logfile=$log - fi - fi - ;; - esac - case $db_debug in - ?*) print -u2 DB: init: access=$db_access logfile=$logfile ;; - esac - case $db_access in - dbm) first_time=0 - db_check - $machine $user shipin "*" base || first_time=1 - ;; - grep) typeset -L2 dir=$machine - case $logfile in - ?*) mv $logfile $SHIPSLOG/.tmp. - sort -r < $SHIPSLOG/.tmp. | sort -m -u +0 -1 > $logfile - rm -f $SHIPSLOG/.tmp. - ;; - esac - logfile=$SHIPSLOG/$dir/$machine/$user - if test "" = "$force" -a -r "$logfile" - then first_time=0 - else first_time=1 - case $noexec in - "") if test ! -d "$SHIPSLOG/$dir" - then mkdir "$SHIPSLOG/$dir" || logfile=$SHIPSLOG/log - fi - if test ! -d "$SHIPSLOG/$dir/$machine" - then mkdir "$SHIPSLOG/$dir/$machine" || logfile=$SHIPSLOG/log - fi - ;; - esac - fi - ;; - esac -} - -# -# end db interaction -# - -function db_done # -{ - case $db_disable in - ?*) return 0 ;; - esac - case $noexec in - "") case $db_access in - dbm) db_request close - db_request quit - kill $db_pid - ;; - grep) case $logfile in - ?*) mv $logfile $SHIPSLOG/.tmp. - sort -r < $SHIPSLOG/.tmp. | sort -m -u +0 -1 > $logfile - rm -f $SHIPSLOG/.tmp. - ;; - esac - ;; - esac - ;; - esac -} - -# -# check if < machine user tool version type > was sent -# - -function db_check # [ - ] machine user tool version type -{ - typeset k key ks sav x nocheck= - - case $db_disable:$first_time:$force in - 1:*:*|*:1:*|*:*:1) return 1 ;; - esac - case $1 in - -) shift; nocheck=1 ;; - esac - typeset a=$1!$2 n=$3 v=$4 t=$5 m - case $5 in - "*") ks="base delta" ;; - base) ks=base ;; - *) ks=delta ;; - esac - for k in $ks - do key=$a,$n,$k - eval sav=\$db_key_$k - case $key in - $sav) eval set -- \$db_val_$k - ;; - *) case $db_access in - dbm) if db_request get $key - then set -- $db_data - else continue - fi - ;; - grep) set -- $(grep "^$key" $logfile) - case $# in - 0) continue ;; - esac - shift - ;; - esac - eval db_key_$k='$key' db_val_$k='$*' - ;; - esac - case $1/$2 in - $v/$t) case $undo in - "") ;; - *) case $nocheck in - "") case $3 in - $undo) continue ;; - esac - ;; - esac - ;; - esac - case $v in - "*") return 0 ;; - esac - ;; - *) case "$v" in - "*") return 0 ;; - esac - continue - ;; - esac - if test -d $n - then m=$(shipop time $n/$1/$2) - else m=$(shipop time $n) - fi - case $6 in - ""|$m) return 0 ;; - *) return 1 ;; - esac - done - return 1 -} - -# -# note that < machine user tool version type > was sent -# - -function db_note # machine user tool version type name -{ - typeset k v m - - case $db_disable in - ?*) return 0 ;; - esac - case $5 in - base) k=base ;; - *) k=delta ;; - esac - if test -d $3 - then m=$(shipop time $3/$4/$5) - else m=$(shipop time $3) - fi - v="$1!$2,$3,$k $4 $5 $date $SHIPPER $6 $m" - case $db_access in - dbm) db_request put $v ;; - grep) print $v >> $logfile ;; - esac -} - -# -# output SHIPMENT stamp for file [current date] -# - -function shipstamp # file -{ - typeset -Z2 day month - typeset -R2 year - integer mon Jan=1 Feb=2 Mar=3 Apr=4 May=5 Jun=6 \ - Jul=7 Aug=8 Sep=9 Oct=10 Nov=11 Dec=12 - case $# in - 0) set -- $(date) - shift 1 - ;; - *) set -- $(ls -ld $1 2>/dev/null) - while : - do case $# in - [01]) break ;; - esac - case $1 in - Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) - case $2 in - [1-9]|[0-3][0-9]) - case $3 in - [0-9]*) break ;; - esac - ;; - esac - ;; - - esac - shift - done - ;; - esac - mon=$1 - day=$2 - month=$mon - case $3 in - *:*:*) year=$5 - ;; - *:*) set -- $(date) - year=$6 - if (($mon > $2)) - then let year=year-1 - fi - ;; - *) year=$3 - ;; - esac - print $year$month$day -} - -# -# prepare $tool for shipping -# - -function package # tool [blocks] -{ - typeset tool=$1 - integer package_blocks=${2-20} - integer package_chunk=package_blocks*8*1024 - integer size i=0 skip=0 - typeset -RZ3 suffix - typeset fsize - - if test $tool.000 -nt $tool - then return 0 - fi - fsize=$(wc -c $tool) - size=${fsize%$tool} - if ((size <= package_chunk)) - then return 1 - fi - print packaging $tool - rm -f $tool.??? - while (( size > 0)) - do suffix=$i - dd if=$tool of=$tool.$suffix bs=8k skip=$skip count=$package_blocks 2> /dev/null - let i=i+1 skip=skip+package_blocks size=size-package_chunk - done - set -- $tool.??? - case $1 in - *.\?\?\?) errexit "$tool: cannot package" ;; - esac - return 0 -} - -function gencontrol # tool -{ - typeset tool=${1%/*} - typeset format=${1#$tool/} - typeset init - typeset parts - - if test -f $1 - then if package $1 - then parts='.???' - else parts='' - fi - else # $SHIPFILES - print - "cp $date.$SHIPPER/${tool%/*} \$INSTALLROOT/ship" >> $TMP.u - return - fi - tooldir=${tool%%/*} - { - print - "if test ! -f \$INSTALLROOT/ship/$tooldir/items" - set -- $tool/$format$parts - case $# in - 1) print - "then if test -f $tool/$format$parts" - prefix="then" - ;; - *) print - "then _unspool_nope= - for i in $* - do if test ! -f \$i - then _unspool_nope=1 - break - fi - done - case \$_unspool_nope in" - prefix='"")' - ;; - esac - case $format in - base|delete) init= ;; - *) init=$basetoo ;; - esac - case $init in - "") print - " $prefix if test ! -d \$INSTALLROOT/ship/$tooldir - then mkdir \$INSTALLROOT/ship/$tooldir - fi - rm -rf \$INSTALLROOT/ship/$tool - mkdir \$INSTALLROOT/ship/$tool" - prefix= - ;; - esac - print - " $prefix cat $tool/$format$parts > \$INSTALLROOT/ship/$tool/$format" - print - " rm -f $tool/$format$parts" - case $init in - "") for i in $CRATEFILES - do if test -s $tool/$i - then print - " echo \"$(cat $tool/$i 2>/dev/null)\" > \$INSTALLROOT/ship/$tool/$i" - elif test -f $tool/$i - then print - " : > \$INSTALLROOT/ship/$tool/$i" - fi - done - if test "" != "$www" - then owner= - else if test "" = "$shipper" -a -s $tool/owner - then owner=$(<$tool/owner) - else owner=$SHIPPER - fi - case ${TOSYS##*!} in - ${owner%%!*}) owner=${TOSYS%!*}!$owner ;; - *) owner=$TOSYS!$owner ;; - esac - fi - print - " echo \"$owner\" > \$INSTALLROOT/ship/$tool/owner" - ;; - esac - case $# in - 1) print - " fi" - ;; - *) print - " ;; - esac" - ;; - esac - print - "fi" - } >> $TMP.u -} - -function instructions # first -{ - integer item=0 first=$1 - typeset tool pack packages omit main - - case $first in - 0) print " -As a repeat recipient:" - case $redo in - 1) print " -($((item=item+1))) This shipment includes an update to the installation support tools. - Any tools that failed to build previously will be attempted again." - ;; - esac - ;; - 1) print " -As a first time recipient:" - ;; - esac - - print " -($((item=item+1))) Wait for a \\\`copy succeeded' message from uucp for the file: - - \$user/$FROMSYS/$date.$SHIPPER/manifest" - - print " -($((item=item+1))) For safety do not run as root. If you are not running as \$user then: - - RECIPIENT=\$user - export RECIPIENT" - - packages=$(for tool in "${ship_list[@]}" - do tool=${tool%%/*} - if test -f $tool/Mamfile - then sed -e '/^setv PACKAGE/!d' -e 's/^setv / /' -e 's/ /=/' -e 's/\$/\\&/g' $tool/Mamfile - fi - done | sort -t= -u +0 -1) - case $packages in - ?*) omit= - for tool in "${ship_list[@]}" - do case $tool in - lib*) tool=${tool%%/*} - tool=${tool#lib} - case $omit in - "") omit="$tool" ;; - *) omit="$omit|$tool" ;; - esac - ;; - esac - done - case $omit in - ?*) main=$(echo "$packages" | egrep "PACKAGE_($omit)[=_]" | sed -e 's/^ PACKAGE_\([^_=]*\).*/\1/' | sort -u) - packages=$(echo "$packages" | egrep -v "PACKAGE_($omit)[=_]") - ;; - esac - esac - - case $first in - 0) print " -($((item=item+1))) Name the directory under which previous shipments were installed: - - INSTALLROOT=" - ;; - 1) case $main in - ""|*" -"*) main= ;; - *) main=" - A good final installation directory name would be /usr/add-on/$main." ;; - esac - print " -($((item=item+1))) Create a shipment root directory under which all source and binaries - will be generated. This should not be a final installation directory.$main - - INSTALLROOT= - test -d \\\$INSTALLROOT || mkdir \\\$INSTALLROOT - cd \\\$INSTALLROOT - test -d ship || mkdir ship" - ;; - esac - - print " -($((item=item+1))) If $uuspool/\$user/$FROMSYS was copied to \\\$SPOOLROOT then: - - SHIPSPOOL=\\\$SPOOLROOT - export SHIPSPOOL" - - print " -($((item=item+1))) If your system has att and bsd/ucb universes then in general the tools - will have more functionality when built in the bsd/ucb universe. The - exception is on solaris where /usr/ucb/cc is fubar. Set cc by: - - CC='hackcc -systype bsd43' CCFLAGS='-g' # just an example # - export CC CCFLAGS" - - case $packages in - ?*) print " -($((item=item+1))) This shipment refers to some installation dependent software packages. - Redefine and export any of the following definitions that are incorrect: - -$packages" - ;; - esac - - print " -($((item=item+1))) Execute the following commands to unpack and install the shipment: - - cd \\\$INSTALLROOT" - case $first in - 1) print "\ - cp \\\${SHIPSPOOL-$uuspool/\$user/$FROMSYS}/$date.$SHIPPER/shipin ship/shipin - chmod 0755 ship/shipin" - ;; - esac - print "\ - nohup ksh ship/shipin &" - - print " -($((item=item+1))) Use shipout within \\\$INSTALLROOT/ship to ship to other machines. - \\\$INSTALLROOT/ship/README contains more detailed information." - -} - -function buildscript # machine user -{ - # create mscript to execute as a . script - typeset tool format - integer delta=0 first=1 no_shipin - mscript=$TMP.s tfile=$TMP.f - case $message in - ?*) { - print "cat > $tfile </dev/null | egrep 'DELTA!!!|!PAX!D!' >/dev/null - then t="$format delta" delta=1 - else t="$format patch" - fi - ;; - *) errexit "$format: invalid format" - ;; - esac - print " $n$d$t" - done - print - if ((delta)) - then print "\ -Unpacking delta shipments requires the new pax command. -" - fi - for tool in "${ship_list[@]}" - do if test ! -r $tool - then continue - fi - format=${tool##*/} - tool=${tool%/$format} - if test -s "$tool/message" - then item=${tool%%/*} - eval x='$'_notes_$item - case $x in - 0) print "\ -$item notes: -" - eval _notes_$item=1 - ;; - 1) if cmp -s "$tool/message" "$item/$format/message" - then continue - fi - ;; - esac - cat "$tool/message" - print - fi - done - if test -f ship.tail - then cat ship.tail - elif test -f $HOME/.signature - then cat $HOME/.signature - fi - print '!EOF!' - case $noexec in - "") print 'mail $mail < $tfile' - ;; - *) print 'print "mail $mail < $mscript - ;; - esac -} - -function tosys # machine -{ - # construct return mail address - typeset i IFS=! - TOSYS= - for i in $@ - do case $i in - %*) ;; - *) TOSYS=$i!$TOSYS ;; - esac - done - case $TOSYS in - $FROMSYS!) TOSYS= ;; - esac - TOSYS=$TOSYS$FROMSYS -} - -function genshiplist # machine user mail -{ - typeset tool file x n v t need_pax= missing= - integer i=0 j=0 - - lclfiles= rmtfiles= - db_init $1 $2 - db_check - $1 $2 pax "*" base || need_pax=1 - machine=$1 - user=$2 - mail=$3 - unset ship_list redo - for file in $SHIPFILES - do v=$(shipstamp $file) - if db_check $machine $user $file $v base - then continue - fi - ship_list[i]=$file/$v/base - i=i+1 - case " $SHIPAUX " in - *" $file "*) redo=1 ;; - esac - done - j=i - for tool in "${tool_list[@]}" - do n=${tool%%/*} - case $need_pax in - "") eval t=\$type_$n - case $t in - pax) continue ;; - esac - ;; - esac - v=${tool#*/} - v=${v%/*} - t=${tool##*/} - case $tool in - */*/$SHIPMENT) - if db_check $machine $user $n $t "*" - then case $basetoo in - "") case $noexec in - "") db_note $machine $user $n $t base $name ;; - esac - ;; - ?*) if db_check $machine $user $n $v base - then : - elif test -f $n/$v/base - then ship_list[i]=$n/$v/base - i=i+1 - else print -u2 "$n/$v/base: missing base archive" - missing=1 - fi - ;; - esac - elif test -f "$n/$v/base" - then if db_check $machine $user $n $v base - then : - else ship_list[i]=$n/$v/base - i=i+1 - fi - case $basetoo in - "") continue ;; - esac - elif test -f $n/$t/base - then ship_list[i]=$n/$t/base - i=i+1 - else print -u2 "$n/$t/base: missing base archive" - missing=1 - fi - ;; - esac - if db_check $machine $user $n $v $t - then : - else ship_list[i]=$tool - eval clean_$n= - i=i+1 - fi - done - case $missing in - ?*) exit 1 ;; - esac - if ((j>=i)) - then case $redo in - "") case $total in - "") print -u2 "$mail is up to date" ;; - *) print -u2 "\\n$mail: up to date" ;; - esac - return 0 - ;; - esac - else case $mark in - ?*) case $user:$noexec in - ?*:) for tool in "${ship_list[@]}" - do x=${tool#*/} - x=${x%/*} - db_note $machine $user ${tool%%/*} $x ${tool##*/} $name - done - ;; - esac - return 0 - ;; - esac - fi - case $total in - ?*) print -u2 "\\n$mail:" - PS3='' - select i in ${ship_list[*]} - do : - done on given - case $transport in - uucp) typeset dest=$1!$uupublic/$2/$FROMSYS/$date.$SHIPPER - print "$rmtfiles -$date.$SHIPPER/unspool -$date.$SHIPPER/manifest" > $TMP.m - print uucp -r -C $TMP.u $dest/unspool - case $noexec in - "") uucp -r -C $TMP.u $dest/unspool ;; - esac - case $SHIPID in - ?*) print $date.$SHIPPER/id >> $TMP.m - id="$SHIPPER SEAL $(date) $1!$2" - print "$1!$SHIPID $id" > $TMP.i - print uucp -r -C $TMP.i $dest/id - case $noexec in - "") uucp -r -C $TMP.i $dest/id ;; - esac - case $noexec in - "") print "$id\\t$(shipop seal $lclfiles $TMP.u $TMP.m $TMP.i)" >> $SHIPSLOG/seals - ;; - esac - ;; - esac - print uucp -r -C -m -n"$2" $TMP.m $dest/manifest - case $noexec in - "") uucp -r -C -m -n"$2" $TMP.m $dest/manifest ;; - esac - ;; - uuto) print uuto -m $TMP.u $1!$2 - case $noexec in - "") uuto -m $TMP.u $1!$2 ;; - esac - ;; - esac - case $noexec in - ?*) case $SHIPID in - ?*) print "ID:" - cat $TMP.i - ;; - esac - print "MANIFEST:" - cat $TMP.m - print "UNSPOOL:" - cat $TMP.u - ;; - esac -} - -function doship # -{ - # ship the files - typeset i j tool file - integer d - case "$info" in - ?*) fixedname=${name%% *} - print "$fixedname $address $phone $mail $company $project $transport" - return - esac - user=${mail##*!} machine=${mail%!*} - user=${user%%@*} machine=${machine#*@} - target=$machine!~/$user/$FROMSYS - uuspool=$SHIPSPOOL - case $transport in - uucp) uupublic='~' - ;; - uuto) uuspool=$uuspoool/receive - uupublic=$uuspool - print -u2 $transport: transport not supported for $user - return - ;; - *) print -u2 $transport: unknown transport for $user - return - ;; - esac - if genshiplist $machine $user $mail - then return - fi - tosys $machine - > $TMP.u - for i in "${ship_list[@]}" - do gencontrol "$i" - done - case $redo in - ?*) for i in $tools - do print - "for i in \$INSTALLROOT/ship/${i%/*}/*" - print - "do if test -d \$i -a ! -f \$i/BUILT" - print - " then rm -f \$i/[BEU]*" - print - " fi" - print - "done" - done >> $TMP.u - ;; - esac - buildscript $machine $user - dtime=0 - for tool in "${ship_list[@]}" - do for i in $tool.??? - do case $i in - *.\?\?\?|*.000) - d=25 - if test -f $tool.001 - then j=$i - elif test -f $tool - then i=$tool j=$tool - else # here for $SHIPFILES - i=${tool%%/*}; j=$date.$SHIPPER/$i - fi;; - *) j=$i d=50;; - esac - dfile=$target/$j - if test -f "$i" - then lclfiles="$lclfiles $i" - case $rmtfiles in - "") rmtfiles=$j - ;; - *) rmtfiles="$rmtfiles -$j" - ;; - esac - print uucp -r $nocopy $PWD/"$i" "$dfile" - case $noexec in - "") uucp -r $nocopy $PWD/"$i" "$dfile" - dtime=dtime+d - ;; - esac - fi - done - i=${tool#*/} - i=${i%/*} - case $noexec in - "") db_note $machine $user ${tool%%/*} $i ${tool##*/} $name ;; - esac - done - if test -r $mscript - then . $mscript - fi - sendcontrol $machine $user -} - -function dosend # recipient open -{ - # lookup in database and transport software to them - # if is given, the database is re-opened - addr=$1 - db_disable= - case $addr in - *%beta.*|*%bin*|*%ftp|*%lib*|*%list|*%pull|*%push|*%src) - db_disable=1 - mail=$addr - transport=${addr##*'%'} - machine=%$transport - user=${addr%"$machine"} - case $transport in - beta.*) beta=$SHIPPER transport=${transport#beta.} ;; - *) beta= ;; - esac - case $transport in - bin*|lib*|src) - dir=ship - out=${user:-${transport%%.*}} - view= - case $transport in - bin) arch=${PWD%/ship} - case $arch in - */arch/*) - a=${arch##*/} - ;; - *) a=${HOSTTYPE:-$(hostinfo type)} - ;; - esac - out=$out.$a - type="$a binary" - type_H=".I $a -.B binary" - ;; - bin.*) arch=${transport#bin.} - out=$out.$arch - transport=bin - type="$arch binary" - type_H=".I $arch -.B binary" - view=1 - ;; - lib) arch=${PWD%/ship} - case $arch in - */arch/*) - a=${arch##*/} - ;; - *) a=${HOSTTYPE:-$(hostinfo type)} - ;; - esac - out=$out.$a - type="$a binary and library" - type_H=".I $a -.B binary -and -.B library" - ;; - lib.*) arch=${transport#lib.} - out=$out.$arch - transport=lib - type="$arch binary and library" - type_H=".I $arch -.B binary -and -.B library" - view=1 - ;; - *) arch=.. - type="source" - type_H=".B source" - ;; - esac - ccprobe= - case $view in - ?*) case $PWD in - */arch/*) - arch=${PWD%/arch/*}/arch/$arch - export INSTALLROOT=$arch - vpath $arch ${PWD%/arch/*} 2>/dev/null - export VPATH=$arch:${PWD%/arch/*} - for f in $arch/lib/probe/C/make/[!p]*bincc $arch/lib/probe/C/make/[!p]*cc $arch/lib/probe/C/make/[!p]* - do if test -f $f - then ccprobe=CC.PROBE=$f - break - fi - done - ;; - esac - ;; - esac - MAKE=$(whence nmake) - ;; - *) dir=. - ;; - esac - ;; - *:*) transport=rcp - mail=$1 - host=${addr%:*} - dir=${addr#*:} - case $host in - *@*) user=${host%@*} - host=${host#*@} - ;; - *) user=${dir%%/*} - case $user in - '~'*) user=${user#~} ;; - *) user=$SHIPPER ;; - esac - ;; - esac - machine=$host - ;; - *!*) name=${1##*!} transport=uucp - ;; - *@*) name=${1%%@*} transport=uucp - ;; - *) transport=db - ;; - esac - case $transport in - uucp) address= phone= mail=$1 project= - doship - return 1 - ;; - db) typeset -l given match - case $shipinfo_test in - "") if test ! -f "$SHIPINFO" - then errexit "$SHIPINFO: cannot find information file" - fi - shipinfo_test=1 - ;; - esac - case $2 in - ?*) exec 3< $SHIPINFO ;; - esac - given=$1 - while IFS=: read -ru3 name address phone mail company project unused transport comments - do match=$name - case $match in - \#*) ;; - $given*) doship - return 1 - ;; - esac - done - ;; - *) typeset d i p s - if genshiplist $machine $user $mail - then return 1 - fi - tosys $machine - case $transport in - ftp) ftp_address=$(cs -a addr $FROMSYS 2>/dev/null || print - $FROMSYS) ;; - esac - exec 9>&1 - case $transport in - bin|lib);; - *) case $transport in - list|push|src) - ;; - *) print - "umask 02" - ;; - esac - case $transport in - ftp) print - 'case $INSTALLROOT in' - print - '?*) if test -d $INSTALLROOT' - print - ' then cd $INSTALLROOT' - print - ' else echo "$0: $INSTALLROOT: invalid INSTALLROOT" >&2' - print - ' exit 1' - print - ' fi' - print - ' ;;' - print - 'esac' - print - 'if test ! -d ship' - print - 'then mkdir ship || exit 1' - print - 'fi' - print - 'cd ship' - print - 'if test -r "$HOME/.netrc" && grep -c "machine[ ]*'$ftp_address'[ ]*" "$HOME/.netrc"' - print - 'then :' - print - 'else echo "machine '$ftp_address' login anonymous password '$user'" >> "$HOME/.netrc"' - print - ' chmod 0600 "$HOME/.netrc"' - print - 'fi' - ;; - esac - for i in "${ship_list[@]}" - do if test -f $i - then d=$i/file - p=${d%%/*} - s=${d#${p}/} - t=$p - while test "$s" != file - do if test "" != "$p" - then case $transport in - list|src) - print - "$dir/$p" - ;; - push) ;; - *) print - "if test ! -d $dir/$p" - print - "then mkdir $dir/$p" - print - "fi" - ;; - esac - fi - p=${p}/${s%%/*} - s=${d#${p}/} - done - i=${i%/*} - for f in $CRATEFILES - do if test -s $i/$f - then case $transport in - list|push|src) - print - "$dir/$i/$f" - ;; - *) print - "echo \"$(cat $i/$f 2>/dev/null)\" > $dir/$i/$f" - ;; - esac - elif test -f $i/$f - then case $transport in - list|push|src) - print - "$dir/$i/$f" - ;; - - *) print - "> $dir/$i/$f" - ;; - esac - fi - done - case $transport in - list|push|src) - if test "" = "$www" -a -s $i/owner - then print - "$dir/$i/owner" - fi - ;; - *) if test "" != "$www" - then owner= - else if test "" = "$shipper" -a -s $i/owner - then owner=$(<$i/owner) - else owner=$SHIPPER - fi - case ${TOSYS##*!} in - ${owner%%!*}) owner=${TOSYS%!*}!$owner ;; - *) owner=$TOSYS!$owner ;; - esac - fi - print - "echo \"$owner\" > $dir/$i/owner" - ;; - esac - fi - done - case $transport in - list|push|src) - ;; - *) print - "rm -f $dir/ship.$date" - ;; - esac - case $transport in - ftp) print - '${FTP-ftp} $FTP_ADDRESS <$TMP.f - cat - test -d Z || mkdir Z - ;; - bin:*|lib:*|src:*) - print - "(cd $arch; pax -w $paxformat) > Z/$out.Z <&2; exit 1 ;;' - print - 'esac' - print - 'FTP_ADDRESS=${1-'$ftp_address'}' - print - 'FTP_INSTALLROOT=${2-.}' - cat - ;; - list:*) cat - ;; - pull:*) print - ': pull shipment from remote dk host' - print - 'case $# in' - print - '1|2) ;;' - print - '*) echo "Usage: $0 dk-address [remote-INSTALLROOT]" >&2; exit 1 ;;' - print - 'esac' - print - 'DK_ADDRESS=$1' - print - 'DK_INSTALLROOT=${2-.}' - cat - ;; - push:*) print - ': push shipment to remote dk host' - print - 'case $# in' - print - '1|2) ;;' - print - '*) echo "Usage: $0 dk-address [remote-INSTALLROOT]" >&2; exit 1 ;;' - print - 'esac' - print - 'push $1 - ${2:+$2/}ship <<"!!!"' - cat - ;; - *:) cat > $TMP.r - rcp $TMP.r $host:$dir/ship.$date || exit - rm -f $TMP.r - case $rsh in - "") for i in rcmd remsh - do if ($i $host date) >/dev/null 2>&1 - then rsh=$i - break - fi - done - case $rsh in - "") rsh=rsh ;; - esac - ;; - esac - $rsh $host sh $dir/ship.$date || exit - ;; - *) print - "cat '" - cat - print - "' > ship.$date" - print - "rcp ship.$date $host:$dir" - print - "rm ship.$date" - print - "rsh $host sh $dir/ship.$date" - ;; - esac - chmod= - items= - pwd=. - skip= - for tool in "${ship_list[@]}" - do if test ! -f $tool - then i=${tool%%/*} - else i=$tool - fi - dfile=$mail/$i - if test -f "$i" - then case $transport in - bin|lib)case $i in - */*) case $i in - $tool) i=${i%/*} - i=${i%/*} - case $i in - $skip) ;; - *) ( - cd $arch - r=$PWD - case $i in - lib*) cd src/lib/$i ;; - *) cd src/cmd/$i ;; - esac - list=list.ship - case $transport in - bin) list=$list.$transport ;; - esac - INSTALLROOT=$r $MAKE -o 'accept noexec mismatch reread silent' $list $ccprobe - ) - ;; - esac - ;; - esac - ;; - README|shipout) - print - "ship/$i" - skip=${tool%%/*} - ;; - *) skip=${tool%%/*} - ;; - esac - ;; - ftp) case $i in - */*) t=${i%/*} ;; - *) t=. ;; - esac - case $t in - $pwd) ;; - *) print - cd '$FTP_INSTALLROOT'/ship/${i%/*} - case $pwd in - .) print - lcd $t ;; - *) print - lcd ../../$t ;; - esac - pwd=$t - ;; - esac - print - get ${i##*/} - test -x $i && chmod="$chmod $i" - ;; - list|push) - print - "$i" - ;; - pull) case $i in - */*) t=${i%/*} ;; - *) t=. ;; - esac - print - echo pull '$DK_ADDRESS' '$DK_INSTALLROOT'/ship/$i $t - print - pull '$DK_ADDRESS' '$DK_INSTALLROOT'/ship/$i $t - ;; - rcp) print rcp "$i" "$dfile" - case $noexec in - "") rcp "$i" "$dfile" || exit ;; - esac - ;; - src) print - "ship/$i" - case $i in - */*) ;; - *) skip=${tool%%/*} ;; - esac - ;; - esac - fi - i=${tool#*/} - i=${i%/*} - case $user:$noexec in - ?*:) db_note $machine $user ${tool%%/*} $i ${tool##*/} $name ;; - esac - i=${tool%%/*} - case $i in - $skip) ;; - *) skip=$i - items="$items $i" - ;; - esac - done - exec 1>&9 9>&- - case $transport:$noexec in - bin:|lib:|src:) - test "" != "$www" && { - case $type in - [aehiouAEHIOU]*) - a=an - ;; - *) a=a - ;; - esac - print - ".TL - - \"$SHIPORG\" \"$SHIPLOGO\" -Software Shipment Contents -This is $a -$type_H -shipment of -.IR $out ." - if test -f ship.${out%%.*}.promo - then print - ".P" - cat ship.${out%%.*}.promo - print - ".P" - fi - print - "The shipment contains: -.EX" - case $transport in - bin) ls -Cd $(ls -d $items 2>/dev/null | grep -v '^lib') 2>/dev/null ;; - *) ls -Cd $items 2>/dev/null ;; - esac - print - ".EE" - hit=" " - for tool in "${ship_list[@]}" - do tool=${tool%/*} - case $hit in - *" $tool "*) - ;; - *) hit="$hit$tool " - if test -f $tool/promo - then promo=1 - cat $tool/promo - else promo= - fi - if test -f $tool/release - then case $promo in - "") print - ".H 1 ${tool%/*}" - ;; - esac - print - ".P" - print - ".DS" - cat $tool/release - print - ".DE" - fi - ;; - esac - done - print - ".H 1 -If you have problems send mail to -.I advsoft@attmail.att.com -with -.I $out -in the subject field." - } | $SHIPMM2HTML >Z/$out.H - { - print - "#" - print - "# the following ${beta:+beta }$type shipment" - print - "# of $out has been sent" - case $beta in - ?*) print - "# this beta shipment may only be interface compatible with itself" - print - "# other shipments will be reconciled after beta testing" - ;; - esac - print - "#" - case $transport in - bin) ls -Cd $(ls -d $items 2>/dev/null | grep -v '^lib') 2>/dev/null ;; - *) ls -Cd $items 2>/dev/null ;; - esac | sed 's/^/# /' - print - "#" - print - "# to install:" - print - "#" - print - "INSTALLROOT=${beta:+/beta.$beta}" - print - "SHIPMENT=" - print - "cd \$INSTALLROOT" - print - "$paxuncompress \$SHIPMENT | $paxunformat" - case $transport in - bin|lib)(cd $arch; ls -ld $(<$TMP.f) 2>/dev/null) > $TMP.s - for f in $(sed -e '/^-..s..s/!d' -e 's/.* //' $TMP.s) - do set x $(cd $arch; ls -ld $f 2>/dev/null) - n=$# - g=$5 - set x $(cd $arch; ls -ldg $f 2>/dev/null) - n1=$# - g1=$5 - if test $n -lt $n1 - then g=$g1 - fi - print - "chgrp $g $f || echo ship: $f would be more efficient if owned by group $g >&2" - done - sed -e '/^-..s/!d' -e 's/^-..s..s.* /chmod ug+s /' -e 's/^-..s.* /chmod u+s /' $TMP.s - rm $TMP.s - for f in $items - do test -f $f/binary && cat $f/binary - done - ;; - src) print - "nohup ksh ship/shipin &" - ;; - esac - print - "#" - print - "# to use:" - print - "#" - print - "export LD_LIBRARY_PATH=\$INSTALLROOT/lib\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}" - print - "export PATH=\$INSTALLROOT/bin:\$PATH" - print - "export FPATH=\$INSTALLROOT/fun\${FPATH:+:\$FPATH}" - } >Z/$out.M - case $transport in - bin) (cd $arch; sort -u $TMP.f | egrep -v '^(include/.*|lib/lib.*\.a)$' | pax -Lw $paxformat; rm $TMP.f) > Z/$out.Z ;; - *) (cd $arch; sort -u $TMP.f | pax -Lw $paxformat; rm $TMP.f) > Z/$out.Z ;; - esac - ;; - bin:*|ftp:*|lib:*|push:*|src:*) - case $transport in - ftp) print - 'quit' ;; - esac - print - '!!!' - case $chmod in - ?*) print - "chmod +x$chmod" ;; - esac - ;; - esac - return 1 - ;; - esac - print -u2 "$command: address for $1 not found" - return 1 -} - -function closure # tools -{ - tools= - for tool - do if test ! -d $tool - then case $original in - *" ${tool%/*} "*|*" $tool "*) warning "${tool%/*}: invalid tool" ;; - esac - else case $tool in - */?*) release=${tool#*/} - tool=${tool#*/} - ;; - *) eval items=\"\$items_$item\" - case $items in - "") release= ;; - *) eval release=\$release_$tool ;; - esac - ;; - esac - eval release_${tool%/*}=$release - tools="$tools $tool" - fi - done - set -- $tools - # - # now generate the closure of the top level tools and releases - # - tools= - for tool - do old= - new=$tool - while : - do case $new in - $old) break - esac - dup= - for item in $new - do # we assume items_* not in environment - eval items=\"\$items_$item\" - case $items in - "") eval release=\$release_$item - case $release in - "") set -- $item/$SHIPMENT - shift $#-1 - case $1 in - "$item/$SHIPMENT") continue ;; - esac - release=${1#*/} - eval release_$item=$release - esac - if test ! -f $item/$release/items - then if test ! -f $item/$release/delete - then continue - fi - items=$item - else case $closure in - "") items=$item ;; - *) items=$(<$item/$release/items)" $item" ;; - esac - fi - eval items_$item=\"$items\" - ;; - esac - dup="$dup $items" - done - old=$new - new= - for item in $dup - do eval seen_$item= - done - for item in $dup - do eval seen=\$seen_$item - case $seen in - "") eval seen_$item=1 - new="$new $item" - esac - done - done - tools="$tools $new" - done -} - -function undup # tools -{ - tools= - for item - do eval seen_$item= - done - for item - do eval seen=\$seen_$item - case $seen in - "") eval seen_$item=1 - tools="$tools $item" - esac - done -} - -command=$0 -integer dtime=0 i=0 nrecipient=0 first_time=1 delay=0 -info= mark= list= logfile= message=1 nocopy= noexec= format=$SHIPMENT -shipinfo_test= force= shipper= closure=1 undo= date= basetoo= www= -paxformat= paxunformat= paxcompress= paxuncompress= -while : -do case $1 in - -b) basetoo=1 ;; - +b) basetoo= ;; - -c) closure= ;; - +c) closure=1 ;; - -d) format=base ;; - +d) format=$SHIPMENT ;; - -i) info=1 delay=0 ;; - -k) mark=1 delay=0 ;; - -l) shift; list=$1 ;; - +l) list= ;; - -m) message= ;; - +m) message=1 ;; - -n) noexec=1 delay=0 ;; - +n) noexec= ;; - -o) shipper=1 ;; - +o) shipper= ;; - -p) shift; recipient_list[nrecipient]=$1; nrecipient=nrecipient+1 ;; - +p) recipient= ;; - -s) SHIPFILES= ;; - -t) total=1 noexec=1 delay=0 ;; - -u) shift; undo=$1 ;; - +u) undo= ;; - -v) shift; date=$1 ;; - -w) www=1 ;; - +w) www= ;; - -x) shift - case $1 in - compress|gzip) - paxcompress=$1 - ;; - *) paxformat=$1 - ;; - esac - ;; - -C) shift; CRATEFILES="$CRATEFILES $1" ;; - -D) shift; delay=$1 ;; - +D) delay=0 ;; - -F) force=1 ;; - +F) force= ;; - -L) shift; logfile=$1 ;; - -S) shift; SHIPFILES="$SHIPFILES $1" ;; - *[,:!%@]*)recipient_list[nrecipient]=$1;nrecipient=nrecipient+1 ;; - --) shift; break ;; - -*|+*) print -u2 "Usage: $command [-bcdikmnostfF] [-l recipient-list] [-p recipient] [-u [[yy]mm]dd] [-v yymmdd] [-x format] [-C crate-file] [-D delay] [-S support-file] [recipient ...] [tool ...]"; exit 2 ;; - *) break ;; - esac - shift -done -case $www in -?*) case $paxformat in - "") paxformat=tar ;; - esac - case $paxcompress in - "") paxcompress=gzip ;; - esac - ;; -esac -case $paxcompress in -""|compress) - paxcompress=compress - paxuncompress="zcat <" - ;; -gzip) paxuncompress="(gunzip || zcat) <" - ;; -esac -case $paxformat in -"") paxformat=cpio ;; -esac -case $paxformat in -cpio) paxunformat="cpio -icdvmu" ;; -tar) paxunformat="tar xvf -" ;; -*) paxunformat="pax -rv" ;; -esac -case $paxformat in -?*) paxformat="-x $paxformat" ;; -esac -case $paxcompress in -?*) paxformat="-x $paxcompress $paxformat" ;; -esac -case $date in -$SHIPMENT) ;; -*) date=$(shipstamp) ;; -esac -($SHIPMM2HTML) >/dev/null 2>&1 || SHIPMM2HTML=cat -case $info in -"") if test 0 = "$nrecipient" -a ! -f "$list" - then errexit "no recipient(s)" - fi - trap 'cleanup $?' EXIT INT TERM - # - # generate the tools list - # - original=" $* " - case $# in - 0) tools= - for tool in * - do set -- $tool/$SHIPMENT - case $1 in - "$tool/$SHIPMENT") ;; - *) tools="$tools $tool" ;; - esac - done - case $tools in - "") errexit "no tools" ;; - esac - set -- $tools - ;; - esac - closure $* - case $tools in - "") errexit "no 'items' file(s)" ;; - esac - tools_usr=$tools - tools_pax= - case $closure:$format:$SHIPFILES in - :*|*:|*:base:*|*:delete:*) - ;; - *) set -- pax/$SHIPMENT - case $1 in - "$tool/$SHIPMENT") - ;; - *) closure pax - tools_pax=$tools - ;; - esac - ;; - esac - undup $tools_pax $tools_usr - set -- $tools - for tool in $tools_pax - do eval type_$tool=pax - done - for tool in $tools_usr - do eval type_$tool=usr - done - set -- $tools - for tool - do eval tool=$tool/\$release_$tool - item= - for f in delete "$format" base - do set -- $tool/$f - if test -f "$1" - then item=${1##*/} - break - fi - done - case $item in - "") if test ! -d ${tool%/*} - then case $original in - *" ${tool%/*} "*|*" $tool "*) warning "${tool%/*}: invalid tool" ;; - esac - continue - fi - case $format in - base) set -- $tool/$SHIPMENT - if test -f "$1" - then eval release_${tool%/*}=${1##*/} - tool=${tool%/*}/${1##*/} - item=base - warning "${tool}: latest base not crated" - else warning "${tool}: base not crated" - continue - fi - ;; - *) continue - ;; - esac - ;; - esac - case $format in - "$SHIPMENT"|$item) - tool=$tool/$item - ;; - *) tool=${tool%/*}/$item/base - if test ! -f $tool - then errexit "${tool%/*}: $item base not crated" - fi - ;; - esac - tool_list[i]=$tool;i=i+1 - done - ;; -*) typeset -lL16 fixedname - typeset -L9 address project - typeset -R12 phone - typeset -L21 mail - typeset -L11 company - ;; -esac -if test ! -d $SHIPSLOG -then mkdir $SHIPSLOG || errexit "$SHIPSLOG: cannot create log directory" -fi - -SHIPID=$FROMSYS!$SHIPPER -case $SHIPFILES in -?*) SHIPFILES="$SHIPFILES $SHIPAUX" - for file in $SHIPFILES - do if test ! -r $file - then print -u2 "$file: cannot read"; exit 1 - fi - done - ;; -esac -while : -do case $undo in - ""|??????*) break ;; - *) undo="?$undo" ;; - esac -done -nocopy=${nocopy+-c} -flag=1 -case $list in -"") set -s -- "${recipient_list[@]}" - ;; -?*) if test ! -r "$list" - then errexit "$list: cannot read" - else set -s -- "${recipient_list[@]}" $(sed -e '/^#/d' -e 's/[: ].*//' $list) - fi - ;; -esac -for recipient -do if ((dtime)) - then sleep $dtime - fi - if dosend "$recipient" $flag - then flag= - case $noexec$info in - "") print "$name" >> ${tool%/*}/list ;; - esac - else flag=1 - fi - if ((delay > dtime)) - then dtime=delay - fi -done -exit 0 diff --git a/cde/programs/dtksh/ksh93/ship/shipproto.c b/cde/programs/dtksh/ksh93/ship/shipproto.c deleted file mode 100644 index c1fe1953a..000000000 --- a/cde/programs/dtksh/ksh93/ship/shipproto.c +++ /dev/null @@ -1,5024 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: shipproto.c /main/5 1995/11/01 16:03:47 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS PROPRIETARY SOURCE CODE LICENSED BY * -* AT&T CORP. * -* * -* Copyright (c) 1995 AT&T Corp. * -* All Rights Reserved * -* * -* This software is licensed by AT&T Corp. * -* under the terms and conditions of the license in * -* http://www.research.att.com/orgs/ssr/book/reuse * -* * -* This software was created by the * -* Software Engineering Research Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* gsf@research.att.com * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#line 1 "/home/gsf/src/cmd/proto/proto.c" - - - -#line 27 - - - - - -# define ctime _huh_ctime -# include -# include -# include -# include - -# undef ctime - -# define remove(x) unlink(x) -# define rename(x,y) ((link(x,y)||remove(x))?-1:0) - - - - - - - - -int -replace __PARAM__((const char* newfile, const char* oldfile, int preserve), (newfile, oldfile, preserve)) __OTORP__(const char* newfile; const char* oldfile; int preserve;){ - struct stat st; - time_t ut[2]; - - if (preserve && stat(oldfile, &st) || remove(oldfile) || rename(newfile, oldfile)) - return(-1); - if (preserve) - { - ut[0] = st.st_atime; - ut[1] = st.st_mtime; - preserve = utime(oldfile, ut); - } - return(preserve); -} - -#line 1 "../../lib/libpp/ppproto.c" - - - - - - - - - - - - -static const char id[] = "\n@(#)proto (AT&T Bell Laboratories) 05/09/95\000\n"; - - - -#line 1 "../../lib/libpp/ppfsm.c" - - - - - - - - - -#line 1 "../../lib/libpp/pplib.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -struct ppsymbol; -struct ppindex; - -typedef char* (*PPBUILTIN) __PROTO__((char*, const char*, const char*)); -typedef void (*PPCOMMENT) __PROTO__((const char*, const char*, const char*, int)); -typedef void (*PPINCREF) __PROTO__((const char*, const char*, int, int)); -typedef void (*PPLINESYNC) __PROTO__((int, const char*)); -typedef void (*PPMACREF) __PROTO__((struct ppsymbol*, const char*, int, int, unsigned long)); -typedef int (*PPOPTARG) __PROTO__((int, int, const char*)); -typedef void (*PPPRAGMA) __PROTO__((const char*, const char*, const char*, const char*, int)); - -struct ppinstk -{ - char* nextchr; - struct ppinstk* next; - struct ppinstk* prev; - long* control; - char* buffer; - char* file; - char* prefix; - struct ppsymbol* symbol; - - struct ppindex* index; - int buflen; - - int line; - short fd; - short hide; - short flags; - char type; -}; - - - - - - - - - -struct pplist -{ - char* value; - struct pplist* next; -}; - -struct oplist -{ - int op; - char* value; - struct oplist* next; -}; - -struct pphide -{ - struct ppmacro* macro; - unsigned long flags; - int level; -}; - -struct ppmacstk -{ - struct ppmacstk* next; - struct ppmacstk* prev; - int line; - char* arg[1]; -}; - -struct ppmember -{ - struct ppdirs* archive; - unsigned long offset; - unsigned long size; -}; - -struct counter -{ - int candidate; - int function; - int macro; - int pplex; - int push; - int terminal; - int token; -}; - - - -#line 228 - - -#line 273 - - - - -#line 287 - - - - - - - -#line 304 - - - - - - - - -#line 1 "../../lib/libpp/pp.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -struct ppdirs -{ - char* name; - struct ppdirs* next; - - - unsigned char c; unsigned char hosted; unsigned char index; unsigned char type; union { char* buffer; char* sp; struct ppdirs* subdir; } info; - - -}; - -struct ppkeyword -{ - char* name; - int value; -}; - -struct ppmacro -{ - int arity; - char* value; - - - int size; char* formals; - - -}; - -struct ppsymbol -{ - int hash_header; - unsigned long flags; - struct ppmacro* macro; - __V_* value; - - - struct pphide* hidden; - - -}; - - - - - - - - - -struct ppglobals -{ - const char* version; - char* lineid; - char* outfile; - char* pass; - char* token; - struct ppsymbol* symbol; - - - - char* outbuf; - char* outp; - unsigned long offset; - - - struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; - - - - struct ppcontext* context; long state; long mode; long option; long test; char* filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; char* cdir; char* hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; - - - - char* checkpoint; int constack; struct ppinstk* in; char* addp; char* args; char* addbuf; char* catbuf; char* path; char* tmpbuf; char* valbuf; char* include; char* prefix; struct ppmember* member; int hidden; int hiding; int level; struct { int input; int output; } pool; int truncate; struct ppmacstk* macp; char* maxmac; char* mactop; char* toknxt; long* control; long* maxcon; struct oplist* chop; struct ppfile* insert; struct ppfile* original; char* dirtab; char* strtab; PPBUILTIN builtin; PPCOMMENT comment; PPINCREF incref; PPLINESYNC linesync; PPLINESYNC olinesync; PPMACREF macref; PPOPTARG optarg; PPPRAGMA pragma; struct counter counter; - - -}; - - - - - - - -extern __MANGLE__ struct ppglobals pp; -extern __MANGLE__ char _pp_ctype[]; - -extern __MANGLE__ int ppargs __PROTO__((char**, int)); -extern __MANGLE__ void ppcpp __PROTO__((void)); -extern __MANGLE__ void ppcomment __PROTO__((char*, char*, char*, int)); -extern __MANGLE__ __V_* ppcontext __PROTO__((__V_*, int)); -extern __MANGLE__ void pperror __PROTO__((int, ...)); -extern __MANGLE__ void ppincref __PROTO__((char*, char*, int, int)); -extern __MANGLE__ void ppinput __PROTO__((char*, char*, int)); -extern __MANGLE__ int pplex __PROTO__((void)); -extern __MANGLE__ void ppline __PROTO__((int, char*)); -extern __MANGLE__ void ppmacref __PROTO__((struct ppsymbol*, char*, int, int)); -extern __MANGLE__ void ppop __PROTO__((int, ...)); -extern __MANGLE__ void pppragma __PROTO__((char*, char*, char*, char*, int)); -extern __MANGLE__ int ppprintf __PROTO__((char*, ...)); - - -#line 313 "../../lib/libpp/pplib.h" - -#line 1 "../../lib/libpp/ppdef.h" - - -#line 14 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 314 "../../lib/libpp/pplib.h" - -#line 1 "../../lib/libpp/ppkey.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -extern __MANGLE__ struct ppkeyword ppkey[]; - - -#line 315 "../../lib/libpp/pplib.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 367 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 481 - - - - - -#line 496 - - -#line 510 - - - - - - - - -#line 529 - - -#line 551 - - -#line 563 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -struct ppcontext -{ - struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; - struct ppcontext* context; long state; long mode; long option; long test; char* filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; char* cdir; char* hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; -}; - -struct ppfile -{ - int hash_header; - struct ppsymbol* guard; - struct ppfile* bound[3]; - int flags; -}; - - - -struct ppindex -{ - struct ppindex* next; - struct ppfile* file; - unsigned long begin; - unsigned long end; -}; - - - -struct ppsymkey -{ - struct ppsymbol sym; - int lex; -}; - - - - - - - - - - - - - - - -extern __MANGLE__ int access __PROTO__((const char*, int)); -extern __MANGLE__ __V_* calloc __PROTO__((size_t, size_t)); -extern __MANGLE__ int close __PROTO__((int)); -extern __MANGLE__ int creat __PROTO__((const char*, int)); -extern __MANGLE__ char* ctime __PROTO__((time_t*)); -extern __MANGLE__ void exit __PROTO__((int)); -extern __MANGLE__ void free __PROTO__((__V_*)); -extern __MANGLE__ int link __PROTO__((const char*, const char*)); -extern __MANGLE__ int open __PROTO__((const char*, int, ...)); -extern __MANGLE__ int read __PROTO__((int, __V_*, int)); -extern __MANGLE__ int strncmp __PROTO__((const char*, const char*, size_t)); -extern __MANGLE__ time_t time __PROTO__((time_t*)); -extern __MANGLE__ int unlink __PROTO__((const char*)); -extern __MANGLE__ int write __PROTO__((int, const __V_*, int)); - - - - - - - -#line 691 - - -extern __MANGLE__ void ppassert __PROTO__((int, char*, char*)); -extern __MANGLE__ void ppbuiltin __PROTO__((void)); -extern __MANGLE__ int ppcall __PROTO__((struct ppsymbol*, int)); -extern __MANGLE__ int ppcontrol __PROTO__((void)); -extern __MANGLE__ void ppdump __PROTO__((void)); -extern __MANGLE__ char* ppexpand __PROTO__((char*)); -extern __MANGLE__ long ppexpr __PROTO__((int*)); -extern __MANGLE__ void ppfsm __PROTO__((int, char*)); -extern __MANGLE__ char* ppinstr __PROTO__((struct ppinstk*)); -extern __MANGLE__ char* ppkeyname __PROTO__((int, int)); -extern __MANGLE__ char* pplexstr __PROTO__((int)); -extern __MANGLE__ void ppload __PROTO__((char*)); -extern __MANGLE__ char* ppmodestr __PROTO__((long)); -extern __MANGLE__ int ppmultiple __PROTO__((struct ppfile*, struct ppsymbol*)); -extern __MANGLE__ void ppnest __PROTO__((void)); -extern __MANGLE__ int ppoption __PROTO__((char*)); -extern __MANGLE__ char* ppoptionstr __PROTO__((long)); -extern __MANGLE__ void pppclose __PROTO__((char*)); -extern __MANGLE__ int pppdrop __PROTO__((char*)); -extern __MANGLE__ char* pppopen __PROTO__((char*, int, char*, int)); -extern __MANGLE__ int pppread __PROTO__((char*)); -extern __MANGLE__ int pppredargs __PROTO__((void)); -extern __MANGLE__ void pppush __PROTO__((int, char*, char*, int)); -extern __MANGLE__ struct ppsymbol* pprefmac __PROTO__((char*, int)); -extern __MANGLE__ int ppsearch __PROTO__((char*, int, int)); -extern __MANGLE__ char* ppstatestr __PROTO__((long)); -extern __MANGLE__ char* pptokstr __PROTO__((char*, int)); -extern __MANGLE__ void pptrace __PROTO__((int)); - - -#line 11 "../../lib/libpp/ppfsm.c" - -#line 1 "../../lib/libpp/ppfsm.h" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 106 - - - - -#line 143 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 220 - - - - - - - - - - - - - - - - - - - - -extern __MANGLE__ short _pp_fsmtab[(0+26)+1][255+1]; - - - - - -extern __MANGLE__ char _pp_trigraph[255+1]; - -extern __MANGLE__ void _pp_refill __PROTO__((int)); - - -#line 12 "../../lib/libpp/ppfsm.c" - - - -#line 49 - - - - - - - - - - - - - -struct fsminit -{ - int state; - unsigned char ch[4]; - int nextstate; -}; - -static struct fsminit fsminit[] = -{ - - { 0, { 6 }, ((0+26)+11), }, - { 0, { 5 }, (0), }, - { 0, { 2 }, (0+21), }, - { 0, { '.' }, (0+23), }, - { 0, { 1 }, (0+17), }, - { 0, { 'L' }, (0+18), }, - { 0, { 'd', 'e', 'f', 'i' }, (0+1), }, - { 0, { 'r', 't', 'v', 'w' }, (0+1), }, - { 0, { '"', '\'' }, ((0+26)+3), }, - { 0, { '/' }, (0+10), }, - { 0, { '\n' }, ((0+26)+7), }, - { 0, { ' ','\t','\f','\013' }, (0+25), }, - - - { (0+1), { 6 }, ((0+26)+6), }, - { (0+1), { 1, 2 }, (0+17), }, - { (0+1), { 'a' }, (0+2), }, - { (0+1), { 'e' }, (0+3), }, - { (0+1), { 'f' }, (0+4), }, - { (0+1), { 'h' }, (0+5), }, - { (0+1), { 'l' }, (0+6), }, - { (0+1), { 'o' }, (0+7), }, - { (0+1), { 'x' }, (0+8), }, - { (0+1), { 'y' }, (0+9), }, - - - { (0+2), { 6 }, (((0+26)+12)), }, - { (0+2), { 1, 2 }, (0+17), }, - { (0+2), { '_','s','t','a' }, (0+2), }, - { (0+2), { 'r' }, (0+2), }, - - - { (0+3), { 6 }, (((0+26)+12)), }, - { (0+3), { 1, 2 }, (0+17), }, - { (0+3), { 't','u','r','n' }, (0+3), }, - - - { (0+4), { 6 }, (((0+26)+12)), }, - { (0+4), { 1, 2 }, (0+17), }, - - - { (0+5), { 6 }, (((0+26)+12)), }, - { (0+5), { 1, 2 }, (0+17), }, - { (0+5), { 'i','l','e' }, (0+5), }, - - - { (0+6), { 6 }, (((0+26)+12)), }, - { (0+6), { 1, 2 }, (0+17), }, - { (0+6), { 's','e' }, (0+6), }, - - - { (0+7), { 6 }, (((0+26)+12)), }, - { (0+7), { 1, 2 }, (0+17), }, - { (0+7), { 'r', 'i','d' }, (0+7), }, - - - { (0+8), { 6 }, (((0+26)+12)), }, - { (0+8), { 1, 2 }, (0+17), }, - { (0+8), { 't','e','r','n' }, (0+8), }, - - - { (0+9), { 6 }, (((0+26)+12)), }, - { (0+9), { 1, 2 }, (0+17), }, - { (0+9), { 'p','e','d','f' }, (0+9), }, - - - { (0+10), { 6 }, ((0+26)+0), }, - { (0+10), { '*' }, (0+11), }, - - { (0+10), { '/' }, (0+14), }, - - - - { (0+11), { 6 }, (0+11), }, - { (0+11), { '\n', 5 }, ((0+26)+1), }, - { (0+11), { '/' }, (0+13), }, - { (0+11), { '*' }, (0+12), }, - { (0+11), { '#', ';', ')' }, ((( (0+11))<<(7+1))|(((0+26)+8))), }, - - - { (0+12), { 6 }, (0+11), }, - { (0+12), { '\n', 5 }, ((0+26)+1), }, - { (0+12), { '#', ';', ')' }, ((( (0+11))<<(7+1))|(((0+26)+8))), }, - { (0+12), { '*' }, (0+12), }, - { (0+12), { '/' }, ((0+26)+1), }, - - - { (0+13), { 6 }, (0+11), }, - { (0+13), { '*', '\n', 5 }, ((0+26)+1), }, - { (0+13), { '/' }, (0+13), }, - - - { (0+14), { 6 }, (0+14), }, - { (0+14), { '\n', 5 }, ((0+26)+1), }, - { (0+14), { '/' }, (0+15), }, - { (0+14), { '*' }, (0+16), }, - - - { (0+15), { 6 }, (0+14), }, - { (0+15), { '*', '\n', 5 }, ((0+26)+1), }, - { (0+15), { '/' }, (0+15), }, - - - { (0+16), { 6 }, (0+14), }, - { (0+16), { '\n', 5 }, ((0+26)+1), }, - { (0+16), { '*' }, (0+16), }, - { (0+16), { '/' }, ((0+26)+1), }, - - - { (0+17), { 6 }, ((0+26)+6), }, - { (0+17), { 1, 2 }, (0+17), }, - - - { (0+23), { 6 }, ((0+26)+0), }, - { (0+23), { '.' }, (0+24), }, - { (0+23), { 2 }, (0+21), }, - - - { (0+24), { 6 }, (((( (0401+1))-0401)<<(7+1))|( ((0+26)+14))), }, - { (0+24), { '.' }, (((( (0401+29))-0401)<<(7+1))|( ((0+26)+13))), }, - - - { (0+18), { 6 }, ((0+26)+6), }, - { (0+18), { 1, 2 }, (0+17), }, - { (0+18), { '"', '\'' }, ((( (0+19))<<(7+1))|(((0+26)+8))), }, - - - { (0+19), { 6 }, (0+19), }, - { (0+19), { '"', '\'' }, ((0+26)+4), }, - { (0+19), { '\n', 5 }, ((0+26)+4), }, - { (0+19), { '\\' }, (0+20), }, - - - { (0+20), { 6 }, ((0+26)+5), }, - { (0+20), { '\n', 5 }, ((0+26)+4), }, - - - { (0+21), { 6 }, (((( (0401+1))-0401)<<(7+1))|( ((0+26)+14))), }, - { (0+21), { 1, 2, '.' }, (0+21), }, - { (0+21), { 'e', 'E' }, (0+22), }, - - - { (0+22), { 6 }, (((( (0401+1))-0401)<<(7+1))|( ((0+26)+14))), }, - { (0+22), { 1, 2, '.' }, (0+21), }, - { (0+22), { '+', '-' }, (0+21), }, - - - { (0+25), { 6 }, ((0+26)+15), }, - { (0+25), { ' ', '\t' }, (0+25), }, - { (0+25), { '\f', '\013' }, ((0+26)+10), }, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { (-1), { 0 }, 0, } -}; - -short _pp_fsmtab[(0+26)+1][255+1]; - -char _pp_trigraph[255+1]; - - -static char spl[] = { '\\', '\r', 0 }; -static char aln[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$@"; - - - - -static char* let = &aln[10]; -static char hex[] = "fedcbaFEDCBA9876543210"; -static char* dec = &hex[12]; -static char* oct = &hex[14]; - - - - - - -void -ppfsm __PARAM__((int op, char* s), (op, s)) __OTORP__(int op; char* s;){ - int c; - int n; - int i; - short* rp; - struct fsminit* fp; - - - - - switch (op) - { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case 4: - for (fp = fsminit;; fp++) - { - if ((n = fp->nextstate) >= (0+26)) n = ~n; - if (fp->state == (-1)) - { - - - - - - - - - - - - - - break; - } - rp = _pp_fsmtab[fp->state]; - for (i = 0; i < sizeof(fp->ch) && (c = fp->ch[i]); i++) - { - switch (c) - { - case 6: - for (c = 0; c <= 255; c++) - rp[c] = n; - - - case 5: - _pp_fsmtab[(0+26)][fp->state+1] = n < 0 ? ~n : n; - continue; - - case 1: - s = let; - break; - - case 3: - s = hex; - break; - - case 2: - s = dec; - break; - - case 4: - s = oct; - break; - - default: - rp[c] = n; - continue; - } - while (c = *s++) - rp[c] = n; - } - } - - - - - - - for (i = 0; i < (0+26); i++) - { - rp = _pp_fsmtab[i]; - s = spl; - while (c = *s++) - if (c != '@' || !(( rp)>=_pp_fsmtab[(0+11)]&&( rp)<=_pp_fsmtab[(0+13)]||(( rp)>=_pp_fsmtab[(0+14)]&&( rp)<=_pp_fsmtab[(0+16)]))) - { - if (rp[c] >= 0) rp[c] = ~rp[c]; - rp[c] &= ~(1<<7); - } - rp[0] = ~((0+26)+2); - for (c = 0; c <= 255; c++) - if (rp[c] == i) - rp[c] = 0; - } - _pp_fsmtab[(0+26)][0] = ~((0+26)+2); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - break; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 18 "../../lib/libpp/ppproto.c" - - - - - - - - - - - - - - - -struct proto -{ - int brace; - int fd; - char* file; - long flags; - int line; - int test; - - char* tp; - - int iz; - char* ib; - char* ip; - - int oz; - char* ob; - char* op; - - char pushback[4]; - - char variadic[256]; - - - - -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -static int errors; - - - - - - - - - - - - - - -static int -sstrlen __PARAM__((char* s), (s)) __OTORP__(char* s;){ - char* b; - - for (b = s; *s; s++); - return(s - b); -} - - - - - -static int -sstrncmp __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){ - char* e = s + n; - - while (s < e) - { - if (*s != *t || !*s) return(*s - *t); - s++; - t++; - } - return(0); -} - - - - - -static char* -memcopy __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){ - char* e = t + n; - - while (t < e) *s++ = *t++; - return(s); -} - - - - - -static char* -strcopy __PARAM__((char* s, char* t), (s, t)) __OTORP__(char* s; char* t;){ - while (*s++ = *t++); - return(s - 1); -} - - - - - - - - - - -static char* -comment __PARAM__((char* p, char* s, int n, int u), (p, s, n, u)) __OTORP__(char* p; char* s; int n; int u;){ - char* e; - char* m; - - if (!s) - { - if (n) - { - *p++ = (n > 0) ? '/' : '*'; - e = p + 62; - while (p < e) *p++ = '*'; - *p++ = (n > 0) ? '*' : '/'; - } - else s = ""; - } - if (s) - { - if (n > 62) n = 62; - *p++ = '*'; - e = p + (62 - n) / 2; - m = p + 62; - while (p < e) *p++ = ' '; - e = p + n; - while (p < e) - { - n = *s++; - if (u && n >= 'a' && n <= 'z') n = n - 'a' + 'A'; - *p++ = n; - } - e = m; - while (p < e) *p++ = ' '; - *p++ = '*'; - } - *p++ = '\n'; - return(p); -} - - - -#line 285 - - - - - - - - - - -typedef struct -{ - char* data; - int size; -} Item_t; - -typedef struct -{ - int type; - Item_t item[5]; -} Notice_t; - -static char* -copyright __PARAM__((char* p, char* s), (p, s)) __OTORP__(char* p; char* s;){ - char* v; - char* x; - int c; - int i; - int n; - unsigned long h; - time_t clock; - char buf[(62+4)]; - Notice_t notice; - - notice.type = 2; - for (i = 0; i < 5; i++) - notice.item[i].data = 0; - i = 0; - while (c = *s) - { - while (c == ' ' || c == '\t' || c == '\n' || c == '\r') - c = *++s; - x = s; - n = 0; - h = 0; - while (c && c != '=' && c != ' ' && c != '\t' && c != '\n' && c != '\r') - { - if (n++ < 6) - h = (h << 5) + c - 'a'; - c = *++s; - } - if (c == '=') - { - n = (*++s == '"' || *s == '\'') ? *s++ : 0; - v = s; - while ((c = *s) && (n && c != n || !n && c != ' ' && c != '\t' && c != '\n' && c != '\r')) - s++; - switch (h) - { - case ((('c'-'a')<<25)|(('o'-'a')<<20)|(('m'-'a')<<15)|(('p'-'a')<<10)|(('a'-'a')<<5)|('n'-'a')): - c = 0; - break; - case ((('c'-'a')<<25)|(('o'-'a')<<20)|(('n'-'a')<<15)|(('t'-'a')<<10)|(('a'-'a')<<5)|('c'-'a')): - c = 2; - break; - case ((('c'-'a')<<25)|(('o'-'a')<<20)|(('r'-'a')<<15)|(('p'-'a')<<10)|(('o'-'a')<<5)|('r'-'a')): - c = 3; - break; - case ((('l'-'a')<<25)|(('i'-'a')<<20)|(('c'-'a')<<15)|(('e'-'a')<<10)|(('n'-'a')<<5)|('s'-'a')): - c = 4; - break; - case ((('o'-'a')<<25)|(('r'-'a')<<20)|(('g'-'a')<<15)|(('a'-'a')<<10)|(('n'-'a')<<5)|('i'-'a')): - c = 1; - break; - case ((('t'-'a')<<15)|(('y'-'a')<<10)|(('p'-'a')<<5)|('e'-'a')): - if (!sstrncmp( v, "proprietary", 11)) - notice.type = 2; - else if (!sstrncmp( v, "nonexclusive", 11)) - notice.type = 1; - - default: - c = -1; - break; - } - if (c >= 0 && (notice.item[c].size = s - v)) - notice.item[c].data = v; - } - else - { - while (c && c != '\n') - c = *++s; - if (notice.item[i].size = s - x) - { - notice.item[i].data = x; - if (i == 0) - { - notice.item[3].data = v = x; - while ((c = *x) && c != '\n' && c != ' ' && (c < 'a' || c > 'z')) - x++; - if ((c = (x - v)) >= 3) - { - notice.item[3].size = c++; - notice.item[0].data += c; - notice.item[0].size -= c; - } - else notice.item[3].data = 0; - } - } - if (i++ >= 2) - break; - } - if (*s) s++; - } - p = comment(p, ((char*)0), 1, 0); - p = comment(p, ((char*)0), 0, 0); - s = buf; - if (notice.type == 2) - { - if ((x = notice.item[i = 3].data) || (x = notice.item[i = 0].data)) - { - s = memcopy(s, x, notice.item[i].size); - *s++ = ' '; - *s++ = '-'; - *s++ = ' '; - } - s = strcopy(s, "Proprietary"); - p = comment(p, buf, s - buf, 1); - p = comment(p, ((char*)0), 0, 0); - if (notice.item[4].data) - { - s = strcopy(buf, "This is proprietary source code"); - if (notice.item[3].data || notice.item[0].data) - s = strcopy(s, " licensed by"); - p = comment(p, buf, s - buf, 1); - if (x = notice.item[3].data) - { - s = memcopy(buf, x, notice.item[3].size); - s = strcopy(s, " Corp."); - p = comment(p, buf, s - buf, 1); - } - else if (x = notice.item[0].data) - p = comment(p, x, notice.item[0].size, 1); - } - else - { - s = strcopy(buf, "This is unpublished proprietary source code"); - if (x) s = strcopy(s, " of"); - p = comment(p, buf, s - buf, 1); - s = buf; - if (x = notice.item[3].data) - s = memcopy(s, x, notice.item[3].size); - if (x = notice.item[0].data) - { - if (s > buf) - *s++ = ' '; - s = memcopy(s, x, notice.item[0].size); - } - if (s > buf) - p = comment(p, buf, s - buf, 1); - p = comment( p, "and is not to be disclosed or used except in",sizeof( "and is not to be disclosed or used except in")-1, 1); - p = comment( p, "accordance with applicable agreements",sizeof( "accordance with applicable agreements")-1, 1); - } - p = comment(p, ((char*)0), 0, 0); - } - else if (notice.type == 1) - { - p = comment( p, "For nonexclusive individual use",sizeof( "For nonexclusive individual use")-1, 1); - p = comment(p, ((char*)0), 0, 0); - } - s = strcopy(buf, "Copyright (c) "); - time(&clock); - s = memcopy(s, ctime(&clock) + 20, 4); - if (x = notice.item[3].data) - { - *s++ = ' '; - s = memcopy(s, x, notice.item[3].size); - *s++ = ' '; - s = strcopy(s, "Corp."); - } - else if (x = notice.item[0].data) - { - *s++ = ' '; - s = memcopy(s, x, notice.item[0].size); - } - p = comment(p, buf, s - buf, 0); - if (notice.type == 2) - { - if (!notice.item[4].data) - p = comment( p, "Unpublished & Not for Publication",sizeof( "Unpublished & Not for Publication")-1, 0); - p = comment( p, "All Rights Reserved",sizeof( "All Rights Reserved")-1, 0); - } - p = comment(p, ((char*)0), 0, 0); - if (notice.item[4].data) - { - s = strcopy(buf, "This software is licensed"); - if (x = notice.item[3].data) - { - s = strcopy(s, " by "); - s = memcopy(s, x, notice.item[3].size); - *s++ = ' '; - s = strcopy(s, "Corp."); - } - else if (x = notice.item[0].data) - { - s = strcopy(s, " by "); - s = memcopy(s, x, notice.item[0].size); - } - p = comment(p, buf, s - buf, 0); - p = comment( p, "under the terms and conditions of the license in",sizeof( "under the terms and conditions of the license in")-1, 0); - p = comment(p, notice.item[4].data, notice.item[4].size, 0); - p = comment(p, ((char*)0), 0, 0); - } - else if (notice.type == 2) - { - p = comment( p, "The copyright notice above does not evidence any",sizeof( "The copyright notice above does not evidence any")-1, 0); - p = comment( p, "actual or intended publication of such source code",sizeof( "actual or intended publication of such source code")-1, 0); - p = comment(p, ((char*)0), 0, 0); - } - if (x = notice.item[1].data) - { - p = comment( p, "This software was created by the",sizeof( "This software was created by the")-1, 0); - p = comment(p, x, notice.item[1].size, 0); - s = buf; - if (x = notice.item[3].data) - s = memcopy(s, x, notice.item[3].size); - if (x = notice.item[0].data) - { - if (s > buf) - *s++ = ' '; - s = memcopy(s, x, notice.item[0].size); - } - if (s > buf) - p = comment(p, buf, s - buf, 0); - p = comment(p, ((char*)0), 0, 0); - } - if (x = notice.item[2].data) - { - p = comment( p, "For further information contact",sizeof( "For further information contact")-1, 0); - p = comment(p, x, notice.item[2].size, 0); - p = comment(p, ((char*)0), 0, 0); - } - p = comment(p, ((char*)0), -1, 0); - return(p); -} - - - - - - - - - - - - -static char* -number __PARAM__((char* p, long n), (p, n)) __OTORP__(char* p; long n;){ - long d; - - for (d = 1000000; d > 1; d /= 10) - if (n >= d) *p++ = '0' + (n / d) % 10; - *p++ = '0' + n % 10; - return(p); -} - - - - - - -static void -proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){ - char* p; - char buf[1024]; - - p = strcopy(buf, "proto: "); - if (iob) - { - struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); - - if (proto->line) - { - if (proto->file) - { - *p++ = '"'; - p = strcopy(p, proto->file); - *p++ = '"'; - *p++ = ','; - *p++ = ' '; - } - p = strcopy(p, "line "); - p = number(p, proto->line); - } - else if (proto->file) p = strcopy(p, proto->file); - } - else - { - p = strcopy(p, msg); - msg = arg; - arg = 0; - } - *p++ = ':'; - *p++ = ' '; - if (level == 1) p = strcopy(p, "warning: "); - p = strcopy(p, msg); - if (arg) - { - *p++ = ' '; - p = strcopy(p, arg); - } - *p++ = '\n'; - write(2, buf, p - buf); - if (level >= 3) exit(level - 2); - if (level >= 2) errors++; -} - - - - - - - - -static char* -linesync __PARAM__((struct proto* proto, char* p, long n), (proto, p, n)) __OTORP__(struct proto* proto; char* p; long n;){ - - if (proto->flags & (1L<<12)) - - { - p = strcopy(p, "\n#line "); - - - - - p = number(p, n); - *p++ = '\n'; - } - return(p); -} - - - - - - -static char* -init __PARAM__((char* op, int flags), (op, flags)) __OTORP__(char* op; int flags;){ - if (flags & (1L<<9)) op = strcopy(op, "\ -\n\ -#if !defined(__PROTO__)\n\ -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)\n\ -#if defined(__cplusplus)\n\ -#define __MANGLE__ \"C\"\n\ -#else\n\ -#define __MANGLE__\n\ -#endif\n\ -#define __STDARG__\n\ -#define __PROTO__(x) x\n\ -#define __OTORP__(x)\n\ -#define __PARAM__(n,o) n\n\ -#if !defined(__STDC__) && !defined(__cplusplus)\n\ -#if !defined(c_plusplus)\n\ -#define const\n\ -#endif\n\ -#define signed\n\ -#define void int\n\ -#define volatile\n\ -#define __V_ char\n\ -#else\n\ -#define __V_ void\n\ -#endif\n\ -#else\n\ -#define __PROTO__(x) ()\n\ -#define __OTORP__(x) x\n\ -#define __PARAM__(n,o) o\n\ -#define __MANGLE__\n\ -#define __V_ char\n\ -#define const\n\ -#define signed\n\ -#define void int\n\ -#define volatile\n\ -#endif\n\ -#if defined(__cplusplus) || defined(c_plusplus)\n\ -#define __VARARG__ ...\n\ -#else\n\ -#define __VARARG__\n\ -#endif\n\ -#if defined(__STDARG__)\n\ -#define __VA_START__(p,a) va_start(p,a)\n\ -#else\n\ -#define __VA_START__(p,a) va_start(p)\n\ -#endif\n\ -#endif\n\ -"); - else op = strcopy(op, "\ -\n\ -#if !defined(__PROTO__)\n\ -#include \n\ -#endif\n\ -"); - return(op); -} - - - - - - - - - - - - - - - - - - - - - -static int -lex __PARAM__((struct proto* proto, long flags), (proto, flags)) __OTORP__(struct proto* proto; long flags;){ - char* ip; - char* op; - int c; - int state; - short* rp; - char* m; - char* e; - char* t; - char* bp; - char* v; - char* im; - char* ko; - char* aom; - int n; - int line; - int quot; - int x; - int vc; - - char* ie = 0; - char* om = 0; - char* aim = 0; - char* aie = 0; - int call = 0; - int group = 0; - int last = 0; - int paren = 0; - - char* qe = 0; - int qn = 0; - int args = 0; - - - ((ip=proto->ip),(op=proto->op)); - - if (flags & (1L<<5)) (ko=op); - - fsm_start: - proto->tp = ip; - state = 0; - bp = ip; - do - { - rp = _pp_fsmtab[state]; - fsm_get: - while (!(state = rp[c = (*(unsigned char*)ip++)])); - fsm_next: - ; - } while (state > 0); - if ((n = ip - bp - 1) > 0) - { - ip = bp; - do switch( n) { default : memcpy( op, ip, n); op += n; ip += n; break; case 7 : * op++ = * ip++; case 6 : * op++ = * ip++; case 5 : * op++ = * ip++; case 4 : * op++ = * ip++; case 3 : * op++ = * ip++; case 2 : * op++ = * ip++; case 1 : * op++ = * ip++; case 0 : break; } while (0); - ip++; - } - state = ~state; - fsm_terminal: - switch ((( state)&((1<<(7+1))-1))) - { - case ((0+26)+11): - if (op > proto->ob && *(op - 1) == '=' && (op == proto->ob + 1 || *(op - 2) != '=')) switch (c) - { - case '+': - case '-': - case '*': - case '&': - (*op++=( ' ')); - break; - } - (*op++=( c)); - break; - - case ((0+26)+0): - (ip--); - c = (*(op-1)); - break; - - case ((0+26)+1): - switch (c) - { - case '\n': - if ((( rp)>=_pp_fsmtab[(0+14)]&&( rp)<=_pp_fsmtab[(0+16)])) goto fsm_newline; - (*op++=( c)); - proto->line++; - rp = _pp_fsmtab[(0+11)]; - break; - case '/': - - if ((flags & ((1L<<5)|(1L<<14))) == (1L<<5)) (op=ko); - else - - (*op++=( c)); - if ((( rp)>=_pp_fsmtab[(0+14)]&&( rp)<=_pp_fsmtab[(0+16)])) - { - rp = _pp_fsmtab[(0+14)]; - break; - } - goto fsm_start; - case (255+1): - break; - default: - - if ((flags & ((1L<<5)|(1L<<14))) == (1L<<5)) (op=ko); - else - - (*op++=( c)); - rp = _pp_fsmtab[(( rp)>=_pp_fsmtab[(0+14)]&&( rp)<=_pp_fsmtab[(0+16)]) ? (0+14) : (0+12)]; - break; - } - bp = ip; - goto fsm_get; - - case ((0+26)+2): - if (c) - { - if (state = _pp_fsmtab[(0+26)][((( rp)-_pp_fsmtab[0])/(255+1))+1]) - goto fsm_terminal; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(0); - } - (ip--); - fsm_eob: - if ((flags & ((1L<<1)|((1L<<15))|(1L<<20))) == ((1L<<15)) && (proto->flags & (1L<<15))) - { - - if (!(flags & (1L<<5))) - - flags |= (1L<<24); - c = ip - proto->ib; - if (!(flags & (1L<<14))) im = proto->tp; - n = ip - im; - if (ip - n < proto->ib) - proto->flags |= (1L<<4); - memcopy(proto->ib - n, ip - n, n); - ip = proto->ib; - proto->tp -= c; - if (flags & (1L<<14)) - { - im -= c; - ie -= c; - } - if (aim) aim -= c; - if (aie) aie -= c; - if ((n = read(proto->fd, ip, proto->iz)) > 0) - { - if ((proto->flags & (1L<<21)) && n < proto->iz) - { - proto->flags &= ~(1L<<15); - close(proto->fd); - } - *(ip + n) = 0; - if (state & (1<<7)) goto fsm_splice; - bp = ip; - goto fsm_get; - } - *ip = 0; - proto->flags &= ~(1L<<15); - close(proto->fd); - } - if (state & (1<<7)) goto fsm_splice; - - if (!(flags & (1L<<20)) && (state = rp[c = (255+1)])) - { - bp = ip; - goto fsm_next; - } - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(0); - - case ((0+26)+3): - quot = c; - - if (c == '"' && qe) - { - for (n = 0, t = qe + 1; t < op && (*t == ' ' || *t == '\t' || *t == '\n' && ++n); t++); - if (t == op) - { - op = qe; - qe = 0; - qn = n; - } - else (*op++=( c)); - } - else - - (*op++=( c)); - rp = _pp_fsmtab[(0+19)]; - bp = ip; - goto fsm_get; - - case ((0+26)+4): - if (c == quot) - { - - if (!(flags & (1L<<3))) - qe = (c == '"') ? op : (char*)0; - - (*op++=( c)); - - while (qn > 0) - { - qn--; - (*op++=( '\n')); - } - - } - else if (c != '\n' && c != (255+1)) - { - (*op++=( c)); - bp = ip; - goto fsm_get; - } - else - { - - while (qn > 0) - { - qn--; - (*op++=( '\n')); - } - - (ip--); - } - c = (0401+1); - break; - - case ((0+26)+5): - - if (flags & (1L<<0)) (*op++=( c)); - else - - switch (c) - { - case 'a': - (*op++=( '0')); - (*op++=( '0')); - (*op++=( '7')); - break; - case 'v': - (*op++=( '0')); - (*op++=( '1')); - (*op++=( '3')); - break; - case 'x': - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - lex(proto, (flags & ((1L<<15))) | (1L<<20)); - for (n = x = 0; (c = (*(unsigned char*)ip++)), x < 3; x++) switch (c) - { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - n = (n << 4) + c - '0'; - break; - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': - n = (n << 4) + c - 'a' + 10; - break; - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': - n = (n << 4) + c - 'A' + 10; - break; - default: - goto fsm_hex; - } - fsm_hex: - (ip--); - (*op++=( ((n >> 6) & 07) + '0')); - (*op++=( ((n >> 3) & 07) + '0')); - (*op++=( (n & 07) + '0')); - break; - default: - (*op++=( c)); - break; - } - rp = _pp_fsmtab[(0+19)]; - bp = ip; - goto fsm_get; - - case ((0+26)+6): - (ip--); - - if ((flags & (1L<<5)) && *proto->tp == 's' && !sstrncmp( proto->tp, "static", 6)) - { - c = ((0500+4)+9); - break; - } - - if (*proto->tp == '_' && !sstrncmp( proto->tp, "__STDPP__directive", 6)) c = '#'; - else c = (0401+0); - - break; - - case ((0+26)+7): - fsm_newline: - proto->line++; - - if (flags & (1L<<5)) - { - if (op != proto->ob && (*(op-1)) != ' ' && (*(op-1)) != '\n') - (*op++=( ' ')); - } - else - - (*op++=( c)); - if (flags & (1L<<3)) - { - - if (flags & (1L<<0)) - { - if (flags & (1L<<5)) (op=ko); - if (flags & (1L<<11)) - { - *(ip - 1) = 0; - op = strcopy(om, "/* "); - op = strcopy(op, im); - op = strcopy(op, " */\n"); - } - flags &= ~((1L<<2)|(1L<<3)|(1L<<6)|(1L<<7)|(1L<<11)|(1L<<14)|(1L<<22)|(1L<<26)); - } - else - - { - if ((flags & ((1L<<2)|(1L<<22))) == ((1L<<2)|(1L<<22))) - { - *(ip - 1) = 0; - op = strcopy(om, "#if defined(__STDC__) || defined(__STDPP__)\n"); - op = strcopy(op, im); - op = strcopy(op, "\n#else\n"); - bp = ip; - ip = im; - *op++ = *ip++; - while (*op = *ip++) - if (*op++ == '#' && *ip != '(') - { - op--; - while (*--op == ' ' || *op == '\t'); - if (*ip == '#') - { - op = strcopy(op + 1, "/**/"); - while (*++ip == ' ' || *ip == '\t'); - } - else - { - if (*op != '"') *++op = '"'; - op++; - while (*ip == ' ' || *ip == '\t') ip++; - while ((c = *ip) >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_') *op++ = *ip++; - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip == '"') ip++; - else *op++ = '"'; - } - } - ip = bp; - op = strcopy(op, "\n#endif\n"); - op = linesync(proto, op, proto->line); - } - flags &= ~((1L<<2)|(1L<<3)|(1L<<6)|(1L<<7)|(1L<<14)|(1L<<16)|(1L<<22)|(1L<<23)|(1L<<26)); - } - call = 0; - group = 0; - paren = 0; - last = '\n'; - } - if (paren == 0 && (flags & ((1L<<14)|(1L<<20)|(1L<<23)|(1L<<24))) == (1L<<24)) - { - - if (flags & (1L<<5)) (op=ko); - - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(0); - } - goto fsm_start; - - case ((0+26)+8): - (*op++=( c)); - rp = _pp_fsmtab[((( state)>>(7+1))&((1<<7)-1))]; - bp = ip; - goto fsm_get; - - case ((0+26)+13): - (*op++=( c)); - c = (((( state)>>(7+1))&((1<<7)-1))+0401); - break; - - case ((0+26)+14): - (ip--); - c = (((( state)>>(7+1))&((1<<7)-1))+0401); - break; - - case (((0+26)+12)): - (ip--); - c = (0401+0); - if (!(flags & (1L<<1))) switch (((((long)( *proto->tp))<<16)|(((long)( *(ip - 1)))<<8)|((long)( ip - proto->tp)))) - { - case ((((long)( 'd'))<<16)|(((long)( 'o'))<<8)|((long)( 2))): - c = ((0500+4)+6); - break; - case ((((long)( 'e'))<<16)|(((long)( 'e'))<<8)|((long)( 4))): - if (!(flags & (1L<<20)) && !sstrncmp( proto->tp, "else", 4)) - { - c = ((0500+4)+8); - goto fsm_id; - } - break; - case ((((long)( 'e'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): - if (!sstrncmp( proto->tp, "extern", 6)) - c = ((0500+4)+9); - break; - case ((((long)( 'f'))<<16)|(((long)( 'r'))<<8)|((long)( 3))): - if (!(flags & (1L<<20)) && !sstrncmp( proto->tp, "for", 3)) - { - c = ((0500+4)+11); - goto fsm_id; - } - break; - case ((((long)( 'i'))<<16)|(((long)( 'f'))<<8)|((long)( 2))): - c = ((0500+4)+13); - break; - case ((((long)( 'r'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): - if (!(flags & (1L<<20)) && !sstrncmp( proto->tp, "return", 6)) - { - c = ((0500+4)+17); - goto fsm_id; - } - break; - case ((((long)( 't'))<<16)|(((long)( 'f'))<<8)|((long)( 7))): - if (!(flags & (1L<<20)) && !sstrncmp( proto->tp, "typedef", 7)) - { - flags |= (1L<<26); - c = ((0500+4)+9); - } - break; - case ((((long)( 'v'))<<16)|(((long)( 't'))<<8)|((long)( 8))): - if (*ip == '(' && !sstrncmp( proto->tp, "va_start", 8)) c = (0500+1); - break; - case ((((long)( 'v'))<<16)|(((long)( 'd'))<<8)|((long)( 4))): - if (!sstrncmp( proto->tp, "void", 4)) - { - if (flags & ((1L<<0)|(1L<<18)|(1L<<9)|(1L<<10))) c = ((0500+4)+30); - else - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - line = proto->line; - if (lex(proto, (flags & ((1L<<15))) | (1L<<20)) == '*') - { - memcopy(op - 4, "__V_", 4); - memcopy(ip - 4, "__V_", 4); - } - else c = ((0500+4)+30); - proto->line = line; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - bp = ip; - } - } - break; - case ((((long)( 'w'))<<16)|(((long)( 'e'))<<8)|((long)( 5))): - if (!(flags & (1L<<20)) && !sstrncmp( proto->tp, "while", 5)) - { - c = ((0500+4)+26); - goto fsm_id; - } - break; - } - - if ((flags & (1L<<0)) && c != ((0500+4)+9)) - c = (0401+0); - - break; - - case ((0+26)+10): - goto fsm_start; - - case ((0+26)+15): - (ip--); - - if ((flags & ((1L<<5)|(1L<<14))) == (1L<<5)) - { - while (op > proto->ob && (*(op - 1) == ' ' || *(op - 1) == '\t')) - op--; - if (op > proto->ob && *(op - 1) != '\n') *op++ = ' '; - } - - goto fsm_start; - - default: - if (c == '\\' && (state & (1<<7))) - { - if (!(n = (*(unsigned char*)ip++))) - { - goto fsm_eob; - fsm_splice: - c = '\\'; - n = (*(unsigned char*)ip++); - } - if (n == '\n') - { - proto->line++; - (*op++=( '\\')); - (*op++=( '\n')); - bp = ip; - goto fsm_get; - } - (ip--); - state &= ~(1<<7); - if (state >= (0+26)) goto fsm_terminal; - rp = _pp_fsmtab[state]; - } - (*op++=( c)); - bp = ip; - goto fsm_get; - } - if (!(flags & ((1L<<9)|(1L<<10)|(1L<<20)))) - { - if (!(flags & (1L<<3))) switch (c) - { - case '(': - - if (!(flags & (1L<<0)) || proto->brace == 0) - - { - if (paren++ == 0) - { - - if (!(flags & (1L<<0)) || group <= 1) - - { - - args = 0; - - if (group++ == 0) group++; - else if (flags & (1L<<7)) call++; - flags |= (1L<<14); - im = ip - 1; - om = op - 1; - } - } - else if (paren == 2 && !aim) - { - if (flags & (1L<<7)) - { - aim = ip - 1; - aom = op - 1; - } - else if ((flags & ((1L<<14)|(1L<<25))) == (1L<<14)) - { - for (m = ip - 2; m > im && (*m == ' ' || *m == '\t'); m--); - if (m == im) - { - flags &= ~(1L<<14); - om = 0; - } - } - } - flags &= ~(1L<<25); - } - break; - case ')': - - if (!(flags & (1L<<0)) || proto->brace == 0) - - if (--paren == 0) - { - - if (flags & (1L<<0)) - { - if (group != 2) - { - c = (0401+0); - break; - } - group++; - } - - ie = ip; - } - else if (paren == 1 && (flags & (1L<<7)) && !aie) - aie = ip; - break; - case '*': - if (last == '(' && group == 2) - { - group--; - if (paren == 1) - { - flags |= (1L<<7); - aim = aie = 0; - } - } - break; - case '#': - fsm_directive: - if (!(flags & ((1L<<1)|(1L<<3)))) - { - flags |= (1L<<3); - if (!(flags & (1L<<18))) - { - bp = ip; - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip == 'l' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e') - { - if (*++ip == ' ' || *ip == '\t') - { - proto->line = 0; - while (*++ip >= '0' && *ip <= '9') - proto->line = proto->line * 10 + *ip - '0'; - proto->line--; - } - } - - else if ((flags & ((1L<<0)|(1L<<5))) == (1L<<0)) - { - n = 0; - t = ip + 6; - while (ip < t && *ip >= 'a' && *ip <= 'z') n = (n << 5) | (*ip++ - 'a'); - switch (n) - { - case ((('e'-'a')<<15)|(('l'-'a')<<10)|(('s'-'a')<<5)|('e'-'a')): - case ((('e'-'a')<<20)|(('n'-'a')<<15)|(('d'-'a')<<10)|(('i'-'a')<<5)|('f'-'a')): - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip != '\n' && *ip != '/' && *(ip + 1) != '*') - { - flags |= (1L<<11)|(1L<<14); - im = ip; - om = op + (ip - bp); - } - break; - case ((('e'-'a')<<15)|(('l'-'a')<<10)|(('i'-'a')<<5)|('f'-'a')): - case ((('e'-'a')<<20)|(('r'-'a')<<15)|(('r'-'a')<<10)|(('o'-'a')<<5)|('r'-'a')): - case ((('i'-'a')<<5)|('f'-'a')): - case ((('i'-'a')<<20)|(('f'-'a')<<15)|(('d'-'a')<<10)|(('e'-'a')<<5)|('f'-'a')): - case ((('i'-'a')<<25)|(('f'-'a')<<20)|(('n'-'a')<<15)|(('d'-'a')<<10)|(('e'-'a')<<5)|('f'-'a')): - case ((('u'-'a')<<20)|(('n'-'a')<<15)|(('d'-'a')<<10)|(('e'-'a')<<5)|('f'-'a')): - break; - case ((('i'-'a')<<25)|(('n'-'a')<<20)|(('c'-'a')<<15)|(('l'-'a')<<10)|(('u'-'a')<<5)|('d'-'a')): - if (*ip == 'e') ip++; - - case ((('d'-'a')<<25)|(('e'-'a')<<20)|(('f'-'a')<<15)|(('i'-'a')<<10)|(('n'-'a')<<5)|('e'-'a')): - case ((('p'-'a')<<25)|(('r'-'a')<<20)|(('a'-'a')<<15)|(('g'-'a')<<10)|(('m'-'a')<<5)|('a'-'a')): - if (*ip < 'a' || *ip > 'z') break; - - default: - flags |= (1L<<11)|(1L<<14); - im = bp - 1; - om = op - 1; - break; - } - } - else - - { - if (*ip == 'i' && *++ip == 'n' && *++ip == 'c' && *++ip == 'l' && *++ip == 'u' && *++ip == 'd' && *++ip == 'e') - { - while (*++ip == ' ' || *ip == '\t'); - if (*ip++ == '<' && *ip++ == 's' && *ip++ == 't' && *ip++ == 'd' && *ip++ == 'a' && *ip++ == 'r' && *ip++ == 'g' && *ip++ == '.' && *ip++ == 'h' && *ip++ == '>') - { - op = strcopy(op, "\ -if !defined(va_start)\n\ -#if defined(__STDARG__)\n\ -#include \n\ -#else\n\ -#include \n\ -#endif\n\ -#endif\n\ -"); - op = linesync(proto, op, proto->line); - break; - } - } - else if (*ip == 'd' && *++ip == 'e' && *++ ip == 'f' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e' && (*++ip == ' ' || *ip == '\t')) - { - flags |= (1L<<2)|(1L<<14); - im = bp - 1; - om = op - 1; - } - } - ip = bp; - } - } - break; - case '{': - if (proto->brace++ == 0 && paren == 0) - { - if (last == '=') flags |= (1L<<8); - - else if (flags & (1L<<0)) - { - if ((flags & ((1L<<14)|(1L<<16)|(1L<<23))) == (1L<<14)) - { - if (args) - { - v = number(op, args < 0 ? -args : args); - v = strcopy(v, " argument actual/formal mismatch"); - *v++ = ' '; - v = memcopy(v, im, ie - im); - *v = 0; - proto_error((char*)proto + sizeof(struct proto), 2, op, ((char*)0)); - } - ip--; - - v = ie; - while (ie < ip) - if (*ie++ == '/' && *ie == '*') - { - e = ie - 1; - while (++ie < ip) - { - if (*ie == '*') - { - while (ie < ip && *ie == '*') ie++; - if (ie < ip && *ie == '/') - { - while (++ie < ip && (*ie == ' ' || *ie == '\t')); - while (e > v && (*(e - 1) == ' ' || *(e - 1) == '\t')) e--; - if (e > v && *e != '\n') *e++ = ' '; - t = ie; - while (--e >= v) - *--t = *e; - v = t; - break; - } - } - } - } - ie = v; - - op = om++; - if (flags & (1L<<5)) - { - v = op; - while (v > ko && *--v != ' '); - if (*v != ' ') - { - om = (v = (op += 4)) + 1; - while (v >= ko + 4) - { - *v = *(v - 4); - v--; - } - memcopy(ko, "int ", 4); - } - if (*v == ' ') - { - while (*(v + 1) == '*') - *v++ = '*'; - *v = '\t'; - if ((v - ko) <= 8) - { - om = (e = ++op) + 1; - while (e > v) - { - *e = *(e - 1); - e--; - } - } - } - om = (v = (op += 7)) + 1; - while (v >= ko + 7) - { - *v = *(v - 7); - v--; - } - memcopy(ko, "extern ", 7); - } - (*op++=( '(')); - t = op; - e = 0; - - while (ie < ip) - { - if ((c = *ie) == ' ' || c == '\t' || c == '\n') - { - while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); - if (ie >= ip) break; - if (c != '*' && op > om) (*op++=( ' ')); - } - if ((n = ((c = *ie) == ',')) || c == ';') - { - if (flags & (1L<<5)) - { - m = op; - while (op > om && ((c = *(op - 1)) == '(' || c == ')' || c == '[' || c == ']')) - op--; - v = op; - while (op > om && (c = *(op - 1)) != ' ' && c != '*') - op--; - while (*(op - 1) == ' ') - op--; - if (!e) - { - e = op; - while (e > om && *(e - 1) == '*') - e--; - } - - - - - if (op <= om) - op = strcopy(op, "int"); - else if (*(op - 1) == ',') - op = strcopy(op, " int"); - - while (v < m) - (*op++=( *v++)); - } - (*op++=( ',')); - if (n) - { - if (x = !e) e = op - 1; - (*op++=( ' ')); - m = t; - while (m < e) - (*op++=( *m++)); - if (x) - { - m = e; - while (*--e != ' '); - while (*(e - 1) == '*') e--; - op -= m - e; - } - } - while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); - if (ie >= ip) (op--); - else (*op++=( ' ')); - if (!n) - { - t = op; - e = 0; - } - } - else if (*ie == '*') - { - if (op > om && (c = *(op - 1)) == ' ') op--; - while (*ie == '*') (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - if (c != '(') (*op++=( ' ')); - } - else if (*ie == '(') - { - if (op > om && *(op - 1) == ' ') op--; - (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - } - else if (*ie == ')') - { - if (op > om && *(op - 1) == '(') - proto_error((char*)proto + sizeof(struct proto), 1, "function pointer argument prototype omitted", ((char*)0)); - (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - } - else if ((flags & (1L<<5)) && (op == om || *(op - 1) == ' ') && *ie == 'r' && !sstrncmp( ie, "register", 8) && (*(ie + 8) == ' ' || *(ie + 8) == '\t' || *(ie + 8) == '\n')) - { - ie += 8; - if (op > om) (op--); - } - else (*op++=( *ie++)); - } - - if (op <= om) op = strcopy(op, "void"); - (*op++=( ')')); - if (flags & (1L<<5)) - { - (*op++=( ';')); - (*op++=( '\n')); - (proto->op=op); - (ko=op); - } - else - { - (*op++=( '\n')); - (*op++=( *ip)); - } - ip++; - flags &= ~((1L<<14)|(1L<<23)); - } - } - - else if ((flags & ((1L<<14)|(1L<<18)|(1L<<23)|(1L<<25))) == ((1L<<14)|(1L<<25))) - { - line = proto->line; - op = strcopy(om, " __PARAM__("); - op = memcopy(op, im, ie - im); - (*op++=( ',')); - (*op++=( ' ')); - (*op++=( '(')); - flags &= ~((1L<<14)|(1L<<23)); - if (flags & (1L<<27)) - { - if ((vc = ie - im + 1) > sizeof(proto->variadic)) vc = sizeof(proto->variadic); - memcopy(proto->variadic, im, vc); - op = strcopy(op, "va_alist)) __OTORP__(va_dcl)\n{"); - } - else - { - flags |= (1L<<23); - proto->ip = im; - proto->op = op; - group = 0; - for (;;) - { - switch (lex(proto, (flags & ((1L<<15))) | (1L<<20))) - { - case '(': - if (paren++) group++; - continue; - case ')': - if (--paren == 0) - { - group = 0; - if (flags & (1L<<14)) - { - flags &= ~((1L<<14)|(1L<<23)); - op = memcopy(op, m, e - m); - } - break; - } - continue; - case ',': - if (paren == 1) - { - group = 0; - if (flags & (1L<<14)) - { - flags &= ~((1L<<14)|(1L<<23)); - op = memcopy(op, m, e - m); - } - (*op++=( ',')); - (*op++=( ' ')); - proto->op = op; - } - continue; - case (0401+0): - if (group <= 1) - { - flags |= (1L<<14); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - (*op++=( ')')); - (*op++=( ')')); - } - if (!(flags & (1L<<23))) - { - flags |= (1L<<23); - proto->op = strcopy(op, " __OTORP__("); - proto->ip = im + 1; - n = *(ie - 1); - *(ie - 1) = ';'; - c = *ie; - *ie = 0; - lex(proto, (flags & ((1L<<15))) | (1L<<1)); - *(ie - 1) = n; - *ie = c; - proto->ip = ie; - op = proto->op; - (*op++=( ')')); - } - op = linesync(proto, op, proto->line = line); - if (!(flags & (1L<<27))) (*op++=( '{')); - } - } - flags &= ~((1L<<6)|(1L<<7)|(1L<<14)|(1L<<16)|(1L<<23)); - call = 0; - group = 0; - break; - case '}': - flags &= ~((1L<<6)|(1L<<7)|(1L<<14)|(1L<<16)|(1L<<23)|(1L<<25)); - if (--proto->brace == 0) - { - flags &= ~((1L<<8)|(1L<<27)|(1L<<28)); - - if (flags & (1L<<5)) (op=ko); - - } - call = 0; - group = 0; - paren = 0; - break; - case '=': - if (last == '?') flags |= (1L<<3); - else if (paren == 0 && (flags & ((1L<<8)|(1L<<14)|(1L<<23))) == (1L<<14)) goto fsm_statement; - goto fsm_other; - case ',': - - if (flags & (1L<<0)) - { - if (paren == 1) args++; - else - { - args--; - flags &= ~(1L<<14); - } - break; - } - - if (paren == 0 && (flags & (1L<<1))) *(op - 1) = c = ';'; - - case ';': - fsm_statement: - if (flags & (1L<<8)) ; - - else if (flags & (1L<<0)) - { - if (paren == 0) - { - if ((flags & (1L<<14)) && last == ')') - flags &= ~(1L<<14); - if (!(flags & (1L<<14))) - { - call = 0; - group = 0; - flags &= ~(1L<<23); - if (flags & (1L<<5)) (op=ko); - if (flags & (1L<<24)) - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(0); - } - } - else - { - args--; - if ((flags & ((1L<<5)|(1L<<23))) == ((1L<<5)|(1L<<23))) - (op=ko); - } - } - } - - else if (paren == 0) - { - if ((flags & ((1L<<14)|(1L<<16)|(1L<<23))) == (1L<<14) && call > 1) - { - if ((flags & ((1L<<1)|(1L<<7))) == (1L<<7) && aim && aie < im) - { - while (aie < ip && (*aie == ' ' || *aie == '\t' || *aie == '\n')) aie++; - v = aim; - while (v < aie) - if (*v++ == ')') break; - while (v < aie && (*v == ' ' || *v == '\t' || *v == '\n')) v++; - if (v == aie || !(flags & (1L<<19))) - { - if (flags & (1L<<19)) n = 3; - else if (v == aie && *v == '(') n = 10; - else n = 11; - ko = op; - om += n; - v = op += n; - while (v >= ko + n) - { - *v = *(v - n); - v--; - } - if (flags & (1L<<19)) memcopy(aom, "(...))", 6); - else if (n == 10) memcopy(aom, "(__VARARG__))", 13); - else - { - ko = strcopy(aom, " __PROTO__("); - ko = memcopy(ko, aim, aie - aim); - *ko = ')'; - if (++ko >= om) - { - *ko++ = ')'; - om = ko; - } - } - } - } - else if (flags & (1L<<26)) - { - op = om; - while (*--op == ' ' || *op == '\t' || *op == '\n'); - if (*op != ')') - { - op = om += 14; - *--op = ')'; - while ((x = *(op - 14)) >= 'A' && x <= 'Z' || x >= 'a' && x <= 'z' || x >= '0' && x <= '9' || x == '_') - *--op = x; - memcopy(op - 13, "(__OTORP__(*)", 13); - } - } - if (flags & (1L<<19)) - { - if (!(flags & (1L<<25))) - { - op = strcopy(om, "(...)"); - (*op++=( c)); - } - } - else - { - if (flags & (1L<<1)) op = strcopy(om, "()"); - else if (!(flags & (1L<<25))) op = strcopy(om, "(__VARARG__)"); - else - { - op = strcopy(om, " __PROTO__("); - op = memcopy(op, im, ie - im); - (*op++=( ')')); - } - (*op++=( c)); - } - flags &= ~((1L<<14)|(1L<<27)|(1L<<28)); - if (c == ',' && !(flags & (1L<<7))) - { - call = 1; - group = 0; - break; - } - } - else if (flags & ((1L<<16)|(1L<<23))) call = 0; - if (c == ';') - { - flags &= ~((1L<<13)|(1L<<26)); - if (flags & (1L<<24)) - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(0); - } - call = 0; - } - else call = call > 1 && c == ','; - group = 0; - flags &= ~((1L<<6)|(1L<<7)|(1L<<14)|(1L<<16)|(1L<<23)); - } - else if (paren == 1 && group == 1 && !(flags & ((1L<<6)|(1L<<13)))) flags |= (1L<<25)|(1L<<16); - break; - case ((0500+4)+6): - case ((0500+4)+13): - flags |= (1L<<25)|(1L<<23); - break; - case ((0500+4)+9): - - if (flags & (1L<<0)) - { - if (proto->brace == 0) - flags |= (1L<<23); - } - else - - if (paren == 0 && !(flags & (1L<<26))) - { - flags |= (1L<<13); - if (!(flags & (1L<<18))) - op = strcopy(op, " __MANGLE__"); - } - break; - case (0401+29): - if (paren == 0 && (flags & ((1L<<1)|(1L<<27))) == (1L<<1)) - { - op -= 3; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(c); - } - if (paren == 1 && !(flags & (1L<<23))) - flags |= (1L<<27); - flags |= (1L<<25); - break; - case ((0500+4)+30): - goto fsm_id; - case (0500+1): - if ((flags & ((1L<<18)|(1L<<27))) == (1L<<27)) - { - flags &= ~(1L<<14); - line = proto->line; - op = strcopy(op - 8, "__VA_START__"); - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - for (;;) - { - switch (lex(proto, (flags & ((1L<<15))) | (1L<<20))) - { - case 0: - case ';': - break; - case (0401+0): - if (!(flags & (1L<<14))) - { - flags |= (1L<<14); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - ((ip=proto->ip),(op=proto->op)); - if (flags & (1L<<14)) - { - v = m; - n = e - m; - } - else - { - v = "ap"; - n = 2; - } - op = strcopy(op, " __OTORP__("); - proto->ip = proto->variadic; - proto->op = op; - flags &= ~(1L<<14); - group = 0; - bp = proto->ip + 1; - if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; - for (;;) - { - switch (lex(proto, (flags & ((1L<<15))) | (1L<<20))) - { - case '(': - if (paren++) group++; - continue; - case ')': - if (--paren == 0) - { - if (flags & (1L<<14)) - { - flags &= ~(1L<<14); - if (!(flags & (1L<<28))) - { - op = memcopy(op, m, e - m); - op = strcopy(op, " = "); - } - op = strcopy(op, "va_arg("); - op = memcopy(op, v, n); - (*op++=( ',')); - (*op++=( ' ')); - if (m > bp) op = memcopy(op, bp, m - bp); - else op = strcopy(op, "int "); - if (group > 1) op = strcopy(op, ")()"); - else op = memcopy(op, e, proto->ip - e - 1); - (*op++=( ')')); - (*op++=( ';')); - } - group = 0; - break; - } - continue; - case ',': - if (paren == 1) - { - if (flags & (1L<<14)) - { - flags &= ~(1L<<14); - if (!(flags & (1L<<28))) - { - op = memcopy(op, m, e - m); - op = strcopy(op, " = "); - } - op = strcopy(op, "va_arg("); - op = memcopy(op, v, n); - (*op++=( ',')); - (*op++=( ' ')); - if (m > bp) op = memcopy(op, bp, m - bp); - else op = strcopy(op, "int "); - if (group > 1) op = strcopy(op, ")()"); - else op = memcopy(op, e, proto->ip - e - 1); - (*op++=( ')')); - (*op++=( ';')); - bp = proto->ip + 1; - if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; - } - group = 0; - proto->op = op; - } - continue; - case (0401+0): - if (group <= 1) - { - flags |= (1L<<14); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - op = strcopy(op, ")"); - flags |= (1L<<28); - proto->line = line; - call = 0; - break; - } - - case (0401+0): - fsm_id: - - if (flags & (1L<<0)) - { - if (!args && paren == 1) args++; - break; - } - - if (paren == 0) - { - if (last == ')') - { - if (proto->brace == 0 && !(flags & (1L<<1))) flags |= (1L<<23); - call = !call; - } - else if ((flags & (1L<<23)) || c == (0401+0) || c == ((0500+4)+30)) call++; - else flags |= (1L<<23); - if (last == (0401+0)) flags |= (1L<<6); - } - c = (0401+0); - flags |= (1L<<25); - break; - case (0401+1): - if (*proto->tp >= '0' && *proto->tp <= '9') - switch (*(op - 1)) - { - case 'l': - case 'L': - switch (*(op - 2)) - { - case 'l': - case 'L': - case 'u': - case 'U': - *(op - 2) = *(op - 1); - op--; - break; - } - break; - case 'u': - case 'U': - op--; - break; - } - goto fsm_other; - - case '[': - if ((flags & (1L<<0)) && paren == 0 && group <= 2) flags |= (1L<<23); - - - default: - fsm_other: - - if (flags & (1L<<0)) break; - - flags |= (1L<<25); - if (paren == 0) flags |= (1L<<16); - break; - } - else if (c == '#' && *ip != '(') flags |= (1L<<22); - last = c; - - if ((flags & ((1L<<5)|(1L<<14))) == ((1L<<5)|(1L<<14)) && ((flags & ((1L<<3)|(1L<<23))) || proto->brace || c != '(' && c != ')' && c != '*' && c != (0401+0))) - (op=proto->op); - else - - (proto->op=op); - goto fsm_start; - } - else if (flags & ((1L<<9)|(1L<<10))) - { - - if ((flags & (1L<<29)) && c == '%' && *ip == '{') t = 0; - else - - { - if (c == '#') for (t = ip; *t == ' ' || *t == '\t'; t++); - else t = ""; - if (*t++ == 'i' && *t++ == 'f' && *t++ == 'n' && *t++ == 'd' && *t++ == 'e' && *t++ == 'f') - { - - - - - t = 0; - } - } - if (t) - { - ip = bp; - op = proto->op; - } - else while (*ip != '\n') *op++ = *ip++; - op = init(op, flags); - op = linesync(proto, op, proto->line); - flags &= ~((1L<<9)|(1L<<10)); - proto->flags &= ~((1L<<9)|(1L<<10)); - goto fsm_start; - } - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<8)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<8)|(1L<<27)|(1L<<28));}while(0); - return(c); -} - - - - - -void -pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ - struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); - - if (proto->flags & (1L<<15)) close(proto->fd); - free((char*)proto); -} - - - - - - - - - - - -char* -pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, notice, flags)) __OTORP__(char* file; int fd; char* notice; int flags;){ - struct proto* proto; - char* iob; - long n; - char* s; - int pragma; - char* b; - - int comlen; - char com[(62+4)]; - - int m = 0; - - static int retain; - - - - - - - if (flags & (1<<0)) flags &= ~(1<<4); - - if (flags & (1<<10)) flags &= ~retain; - else retain &= (1<<5); - if (file && (fd = open(file, 0)) < 0) return(0); - - - - - - - - - - - - - - - - - - - - - - - { - - - - - n = (4*1024); - if (!(proto = (( 0)?( struct proto*)realloc((char*)( 0),sizeof( struct proto)*( 1)+( 5 * n + 2)):( struct proto*)calloc(1,sizeof( struct proto)*( 1)+( 5 * n + 2))))) - return(0); - proto->iz = n; - proto->oz = 3 * n; - proto->flags |= (1L<<15); - } - proto->fd = fd; - iob = (char*)proto + sizeof(struct proto); - proto->op = proto->ob = iob; - proto->ip = proto->ib = iob + proto->oz + n; - if (m) proto->flags |= (1L<<21); - - - - - - n = read(fd, proto->ip, proto->iz); - if (!(proto->flags & (1L<<15))) - close(fd); - if (n < 0) - { - pppclose(iob); - return(0); - } - *(proto->ip + n) = 0; - - - - - - - - - - - - - - if (notice) - { - s = comment(com, ((char*)0), 0, 0); - comlen = s - com; - } - else *com = 0; - - pragma = -1; - s = proto->ip; - m = 64; - while (m-- > 0 && *s) - { - while (*s == ' ' || *s == '\t') s++; - if (*s == '#') - { - b = s++; - while (*s == ' ' || *s == '\t') s++; - if (!sstrncmp( s, "pragma", sizeof("pragma") - 1) && (*(s += sizeof("pragma") - 1) == ' ' || *s == '\t')) - { - while (*s == ' ' || *s == '\t') s++; - if (*s == 'n' && *(s + 1) == 'o') - { - s += 2; - pragma = -2; - } - if (!sstrncmp( s, "prototyped", sizeof("prototyped") - 1) && (*(s += sizeof("prototyped") - 1) == ' ' || *s == '\t' || *s == '\n' || *s == '\r')) - { - while (*s) - if (*s++ == '\n') - { - pragma += 2; - - if (!(flags & (1<<1)) || (flags & (1<<7))) - - for (s--; b < s; *b++ = ' '); - goto magic; - } - } - pragma = -1; - } - } - else if (*s == '/' && !sstrncmp( s, "/* : : generated by proto : : */\n", sizeof("/* : : generated by proto : : */\n") - 1)) - { - pragma = 0; - break; - } - - else if (*s == '%' && *(s + 1) == '{') proto->flags |= (1L<<29); - else if (notice) - { - if (*s == *com && !sstrncmp( s, com, comlen)) notice = 0; - else - { - while (*s) - { - if (*s == *"Copyright"&& !sstrncmp( s, "Copyright", sizeof("Copyright") - 1)) - { - s += sizeof("Copyright") - 1; - while (*s == ' ' || *s == '\t') s++; - if (*s == '(' && (*(s + 1) == 'c' || *(s + 1) == 'C') && *(s + 2) == ')') - notice = 0; - } - else if (*s++ == '\n') break; - } - continue; - } - } - - while (*s && *s++ != '\n'); - } - magic: - if (flags & (1<<9)) proto->flags |= (1L<<19); - if (flags & (1<<11)) proto->test = 1; - - if (flags & (1<<0)) pragma = -pragma; - if (flags & (1<<1)) pragma = 0; - if (flags & (1<<6)) proto->flags |= (1L<<12); - if (!(proto->flags & (1L<<29)) && file && (m = sstrlen( file)) > 2 && file[--m] == 'y' && file[--m] == '.') - proto->flags |= (1L<<29); - - if (pragma <= 0) - { - if (flags & (1<<9)) - { - flags &= ~((1<<3)|(1<<4)); - proto->flags |= (1L<<18); - } - else if (!(flags & ((1<<2)|(1<<8)))) - { - pppclose(iob); - return(0); - } - else if ((flags & (1<<8)) || !pragma) - { - proto->flags |= (1L<<17); - if (proto->flags & (1L<<15)) proto->oz += proto->iz; - proto->iz = n; - if (notice) - { - - proto->op = copyright(proto->op, notice); - if (!(flags & (1<<0)) && !(proto->flags & (1L<<29))) - - proto->op = linesync(proto, proto->op, 1); - proto->iz += proto->op - proto->ob; - } - memcopy(proto->op, proto->ip, n); - return(iob); - } - } - - if (!(retain & (1<<5))) - { - retain |= (1<<5); - ppfsm(4, ((char*)0)); - } - - proto->line = 1; - - if (notice || (flags & ((1<<3)|(1<<4)))) - { - - if (notice) proto->op = copyright(proto->op, notice); - - if (flags & (1<<4)) - { - proto->flags |= (1L<<10); - if (flags & (1<<10)) - retain |= (1<<4); - } - else if (flags & (1<<3)) - { - if (flags & (1<<10)) retain |= (1<<3); - - if (flags & (1<<0)) - { - *proto->op++ = '#'; - proto->op = strcopy(proto->op, "pragma"); - *proto->op++ = ' '; - proto->op = strcopy(proto->op, "prototyped"); - *proto->op++ = '\n'; - } - else - - proto->flags |= (1L<<9); - } - - if (!(flags & (1<<0))) - { - if (proto->flags & (1L<<29)) - { - proto->op = strcopy(proto->op, "\n%{\n"+ !notice); - proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); - proto->op = strcopy(proto->op, "%}\n"); - } - else - { - if (n || notice) *proto->op++ = '\n'; - proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); - if (n) proto->op = linesync(proto, proto->op, proto->line); - else if (proto->flags & ((1L<<9)|(1L<<10))) - proto->op = init(proto->op, proto->flags); - } - } - - } - - - proto->file = file; - if (flags & (1<<0)) - { - proto->flags |= (1L<<0); - if (!(flags & (1<<3))) proto->flags |= (1L<<5); - } - - return(iob); -} - - - - - - -int -pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ - struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); - int n; - - if (proto->flags & (1L<<17)) - { - if (proto->iz) - { - n = proto->iz; - proto->iz = 0; - } - else if (!(proto->flags & (1L<<15))) n = 0; - else if ((n = read(proto->fd, proto->ob, proto->oz)) <= 0 || (proto->flags & (1L<<21)) && n < proto->oz) - { - proto->flags &= ~(1L<<15); - close(proto->fd); - } - } - else - { - if (proto->op == proto->ob) - { - if (proto->flags & (1L<<4)) return(-1); - - if (proto->flags & (1L<<29)) - { - char* ip = proto->ip; - char* op = proto->ob; - char* ep = proto->ob + proto->oz - 2; - - if (!*ip) - { - ip = proto->ip = proto->ib; - if (!(proto->flags & (1L<<15))) n = 0; - else if ((n = read(proto->fd, ip, proto->iz)) <= 0 || (proto->flags & (1L<<21)) && n < proto->iz) - { - if (n < 0) n = 0; - proto->flags &= ~(1L<<15); - close(proto->fd); - } - ip[n] = 0; - } - if (proto->flags & (1L<<30)) - { - proto->flags &= ~(1L<<30); - if (*ip == '%') - { - *op++ = *ip++; - if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); - else proto->flags |= (1L<<31); - } - } - if (proto->flags & (1L<<29)) - while (op < ep && (n = *op++ = *ip)) - { - ip++; - if (n == '%') - { - if (*ip == '%' && (ip == proto->ip + 1 || *(ip - 2) == '\n')) - { - *op++ = *ip++; - if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); - else proto->flags |= (1L<<31); - break; - } - if (!*ip) - { - *op++ = '%'; - proto->flags |= (1L<<30); - break; - } - } - else if (n == '\n') proto->line++; - } - proto->op = memcopy(proto->ob, proto->ip, ip - proto->ip); - proto->ip = ip; - } - else - - lex(proto, proto->flags); - if ((proto->flags & ((1L<<4)|(1L<<15))) == (1L<<4)) - proto->op = strcopy(proto->op, "/* NOTE: some constructs may not have been converted */\n"); - } - n = proto->op - proto->ob; - proto->op = proto->ob; - } - return(n); -} - - - - - - - - - - - - - - - - - - - - - - - -#line 69 "/home/gsf/src/cmd/proto/proto.c" - - - - -static int -proto __PARAM__((char* file, char* notice, int flags), (file, notice, flags)) __OTORP__(char* file; char* notice; int flags;){ - char* b; - char* e; - int n; - int x; - int fd; - - if (file && access(file, 4)) proto_error(((char*)0), 2, file, "not found"); - else if (b = pppopen(file, 0, notice, flags)) - { - if (file) - { - e = file + sstrlen( file) - 1; - x = *e; - *e = '_'; - if ((fd = (flags & ((1<<13)<<1)) ? creat(file, 0666) : 1) < 0) - { - proto_error(b, 2, "cannot create temporary file", ((char*)0)); - return(flags); - } - *e = x; - } - else fd = 1; - while ((n = pppread(b)) > 0) - if (write(fd, b, n) != n) - { - proto_error(b, 2, "write error", ((char*)0)); - flags |= ((1<<13)<<0); - break; - } - if (file && (flags & ((1<<13)<<1))) - { - close(fd); - *e = '_'; - strcpy(b, file); - *e = x; - if (replace(b, file, !(flags & (1<<0)))) - proto_error(b, 2, "cannot rename to", file); - } - pppclose(b); - } - return(flags); -} - -int main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ - char* b; - char* file; - int fd; - char* list = 0; - char* notice = 0; - int flags = (1<<3); - char buf[1024]; - - ; - while ((file = *++argv) && *file == '-' && *(file + 1)) - { - for (;;) - { - switch (*++file) - { - case 0: - break; - case 'c': - if (!*(notice = ++file) && !(notice = *++argv)) - { - file = "??"; - continue; - } - break; - case 'd': - flags |= (1<<1); - continue; - case 'f': - flags |= (1<<2); - continue; - case 'h': - flags &= ~(1<<3); - continue; - case 'i': - flags |= (1<<0); - continue; - case 'l': - if (!*(list = ++file) && !(list = *++argv)) - { - file = "??"; - continue; - } - break; - case 'n': - flags |= (1<<6); - continue; - case 'p': - flags |= (1<<8); - continue; - case 'r': - flags |= ((1<<13)<<1); - continue; - case 's': - flags |= (1<<4); - continue; - case 't': - flags |= (1<<11); - continue; - case 'z': - flags |= (1<<1)|(1<<7); - continue; - case '+': - flags |= (1<<9); - continue; - default: - proto_error(((char*)0), 2, file, "unknown option"); - - case '?': - b = "Usage: proto [-dfhinprst+] [-c \"name='value' ...\"] [-l list] file ...\n"; - write(2, b, sstrlen( b)); - exit(2); - } - break; - } - } - if (list) - { - if (*list == '-' && !*(list + 1)) fd = 0; - else if ((fd = open(list, 0)) < 0) proto_error(((char*)0), 3, list, "not found"); - for (;;) - { - b = buf; - while (read(0, b, 1) == 1 && *b != '\n' && b < &buf[sizeof(buf) - 1]) b++; - if (b == buf) break; - *b = 0; - flags = proto(buf, notice, flags); - } - } - if (file) do flags = proto(file, notice, flags); while (file = *++argv); - else if (!list) flags = proto(file, notice, flags); - exit(errors ? 1 : (flags & ((1<<13)<<0)) ? 2 : 0); -} diff --git a/cde/programs/dtksh/ksh93/src/Makefile b/cde/programs/dtksh/ksh93/src/Makefile deleted file mode 100644 index 037825000..000000000 --- a/cde/programs/dtksh/ksh93/src/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -/* $XConsortium: Makefile /main/2 1996/05/10 17:17:41 drk $ */ -:MAKE: lib - cmd diff --git a/cde/programs/dtksh/ksh93/src/cmd/Makefile b/cde/programs/dtksh/ksh93/src/cmd/Makefile deleted file mode 100644 index 1e04b7ecc..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/Makefile +++ /dev/null @@ -1,2 +0,0 @@ -/* $XConsortium: Makefile /main/3 1996/05/10 17:18:02 drk $ */ -:MAKE: probe - cpp - * diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY b/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY deleted file mode 100644 index 66ff06c7e..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY +++ /dev/null @@ -1,95 +0,0 @@ - - KSH-93 VS. KSH-88 - - -The following is a list of known incompatibilities between ksh-93 and ksh-88. -I have not include cases that are clearly bugs in ksh-88. I also have -omitted features that are completely upward compatible. - -1. Functions, defined with name() with ksh-93 are compatible with - the POSIX standard, not with ksh-88. No local variables are - permitted, and there is no separate scope. Functions defined - with the function name syntax, maintain compatibility. - This also affects function traces. - -2. ! is now a reserved word. As a result, any command by that - name will no longer work with ksh-93. - -3. The -x attribute of alias and typeset -f, is no longer - effective and the ENV file is only read for interactive - shells. You need to use FPATH to make function definitions - visible to scripts. -4. A built-in command named command has been added which is - always found before the PATH search. Any script which uses - this name as the name of a command (or function) will not - be compatible. - -5. The output format for some built-ins has changed. In particular - the output format for set, typeset and alias now have single - quotes around values that have special characters. The output - for trap without arguments has a format that can be used as input. - -6. With ksh-88, a dollar sign ($') followed by a single quote was - interpreted literally. Now it is an ANSI-C string. You - must quote the dollar sign to get the previous behavior. - Also, a $ in front of a " indicates that the string needs - to be translated for locales other than C or POSIX. The $ - is ignored in the C and POSIX locale. - -7. With ksh-88, tilde expansion did not take place inside ${...}. - with ksh-93, ${foo-~} will cause tilde expansion if foo is - not set. You need to escape the ~ for the previous behavior. - -8. Some changes in the tokenizing rules where made that might - cause some scripts with previously ambiguous use of quoting - to produce syntax errors. - -9. Programs that rely on specific exit values for the shell, - (rather than 0 or non-zero) may not be compatible. The - exit status for many shell failures has been changed. - -10. Built-ins in ksh-88 were always executed before looking for - the command in the PATH variable. This is no longer true. - Thus, with ksh-93, if you have the current directory first - in your PATH, and you have a program named test in your - directory, it will be executed when you type test; the - built-in version will be run at the point /bin is found - in your PATH. - -11. Some undocumented combinations of argument passing to ksh - builtins no longer works since ksh-93 is getopts conforming - with respect to its built-ins. For example, typeset -8i - previously would work as a synonym for typeset -i8. - -12. Command substitution and arithmetic expansion are now performed - on PS1, PS3, and ENV when they are expanded. Thus, ` and $( - as part of the value of these variables must be preceded by a \ - to preserve their previous behavior. - -13. The ERRNO variable has been dropped. - -14. If the file name following a redirection symbol contain pattern - characters they will only be expanded for interactive shells. - -15. The arguments to a dot script will be restored when it completes. - -16. The list of tracked aliases is not displayed with alias unless - the -t option is specified. - -17. The POSIX standard requires that test "$arg" have exit status - of 0, if and only if $arg is null. However, since this breaks - programs that use test -t, ksh93 treats an explicit test -t - as if the user had entered test -t 1. - -18. The ^T directive of emacs mode has been changed to work the - way it does in gnu-emacs. - -19. ksh-88 allowed unbalanced parenthes within ${name op val} whereas - ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(} - which works with both versions. - -20. kill -l in ksh-93 lists only the signal names, not their numerical - values. - -I am interested in expanding this list so please let me know if you -uncover any others. diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Makefile b/cde/programs/dtksh/ksh93/src/cmd/ksh93/Makefile deleted file mode 100644 index af7b38b06..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Makefile +++ /dev/null @@ -1,85 +0,0 @@ -/* $XConsortium: Makefile /main/3 1996/05/10 17:18:25 drk $ */ -/* - * ksh makefile - * This makefile should work with nmake 2.3 and higher - */ - -:PACKAGE: ast - -.SOURCE : edit sh bltins data tests -.SOURCE.h : include - -clobber = !(ksh) /* move ksh to ksh.old on clobber */ - -SH = ksh /* name of the shell program */ -VERSION = 1.1 - -/* documentation files */ -DOCFILES = sh.memo grep.mm builtins.mm README RELEASE COMPATIBILITY PROMO \ - OBSOLETE RELEASEa - -KSHELL == 1 /* this is ksh */ - -/* set these variables to 1 to enable, null to disable */ -DEBUG == /* debugging purposes only */ -MTRACE == /* on for malloc tracing */ -SHOPT_ESH == 1 /* emacs/gmacs edit mode */ -SHOPT_VSH == 1 /* vi edit mode */ -SHOPT_SPAWN == /* use spawnve for fork/exec */ -SHOPT_SUID_EXEC == 1 /* allow (safe) suid/sgid shell scripts */ - -/* use the following libraries only if they exist */ -LIBS_opt := +lm +ljobs +li -if ! "$(-mam:N=static*)" && ! "$(HOSTTYPE:N=sgi.mips*)" - LIBS_opt += +lsocket +lnsl -end -LIBS_opt += -ldl -ldld +lintl -$(LIBS_opt) : .DONTCARE - -LDLIBRARIES = $(LIBS_opt) - -FILES_opt = /* optional file list enabled by vars above */ -FILES_opt += $(SHOPT_ESH:T=V?emacs.c) -FILES_opt += $(SHOPT_VSH:T=V?vi.c) -/* -LDFLAGS += -u _XtAppInitialize -L/usr/add-on/X11/lib -*/ - -.ALL : $(SH) shcomp ksh.msg $(SHOPT_SUID_EXEC:T=V?suid_exec.c) - -$(SH) :: sh.1 main.c -lshell +lcmd /* -lXaw -lXmu -lXt -lXtext -lX11 */ +last - -DATAFILES = limits.c msg.c strdata.c testops.c keywords.c options.c \ - signals.c aliases.c builtins.c variables.c lexstates.c - -shell $(VERSION) :LIBRARY: nval.3 alarm.c cd_pwd.c cflow.c deparse.c \ - getopts.c hist.c misc.c print.c read.c sleep.c trap.c test.c \ - typeset.c ulimit.c umask.c whence.c \ - arith.c args.c array.c completion.c dlopen.c defs.c edit.c expand.c \ - fault.c fcin.c history.c init.c io.c jobs.c lex.c macro.c name.c \ - parse.c path.c string.c streval.c subshell.c tdump.c timers.c \ - trestore.c userinit.c waitevent.c xec.c $(DATAFILES) $(FILES_opt) - -:READONLY: $(DATAFILES) - -$(INCLUDEDIR) :INSTALLPROTO: nval.h shell.h - -suid_exec :: suid_exec.c - -shcomp :: shcomp.c -lshell -lcmd -last - -ksh.msg : $(DATAFILES) /* build error message dictionary */ - grep '[ ]e_[a-z].*".*[^\][a-z].*"' $(*) | grep -v /bin/ | grep -v /usr/ | grep -v /dev/ | grep -v /etc/ | grep -v A__z | sed 's/.*=[ ]*\(".*"\);.*/\1/' | sort | uniq > $(<) - grep '[ ]sh_opt.*".*[^\][a-z].*"' $(*) | sed 's/.*=[ ]*\(".*"\);.*/\1/' >> $(<) - grep '[ ]is_[a-z].*".*[^\][a-z].*"' $(*) | sed 's/.*=[ ]*\(".*"\);.*/\1/' >> $(<) - grep '[ ]e_notset' $(*) | sed 's/.*"....\(.*"\).*/"\1/' >> $(<) - grep '[ ]e_subst' $(*) | sed 's/.*"....\(.*"\).*/"\1/' >> $(<) - grep '[ ]e_file' $(*) | sed 's/.*"....\(.*"\).*/"\1/' >> $(<) - grep ',$' $(*:N=*signals.c) | sed 's/.*\(".*"\),/\1/' | sort | uniq >> $(<) - -:: syscall.s mamexec mamstate.c apollo.c deparse.c ksh.mk OPTIONS $(DOCFILES) - -$(TESTS):: alias.sh arith.sh arrays.sh attributes.sh basic.sh bracket.sh \ - builtins.sh case.sh comvar.sh coprocess.sh exit.sh functions.sh \ - grep.sh heredoc.sh io.sh options.sh quoting.sh return.sh select.sh \ - substring.sh tilde.sh variables.sh nameref.sh shtests diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile b/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile deleted file mode 100644 index 6fa6a414c..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile +++ /dev/null @@ -1,1113 +0,0 @@ -note : : make abstract machine file generated from Makefile : : note -info mam static 00000 07/17/94 make (AT&T Bell Laboratories) 3.2 research 05/09/95 -setv INSTALLROOT ../../.. -setv PACKAGE_ast ${INSTALLROOT} -setv PACKAGE_ast_INCLUDE ${PACKAGE_ast}/include -setv PACKAGE_ast_LIB ${PACKAGE_ast}/lib -setv AR ar -setv ARFLAGS cr -setv AS as -setv ASFLAGS -setv CC cc -setv CCFLAGS "-O" -setv COTEMP $$ -setv CPIO cpio -setv CPIOFLAGS -setv CPP "${CC} -E" -setv F77 f77 -setv HOSTCC ${CC} -setv IGNORE -setv LD ld -setv LDFLAGS -setv LEX lex -setv LEXFLAGS -setv LPR lpr -setv LPRFLAGS -setv M4FLAGS -setv MAKE nmake -setv MAKEFLAGS -setv PR pr -setv PRFLAGS -setv SHELL /bin/sh -setv SILENT -setv TAR tar -setv YACC yacc -setv YACCFLAGS -d -make install -make all -make ksh -make main.o -make sh/main.c -make FEATURE/externs implicit -make features/externs -done features/externs -setv mam_libm `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -lm >/dev/null 2>&1 && echo ' -lm'; rm -f x.${!-$$}.[cox])` -setv mam_libjobs `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -ljobs >/dev/null 2>&1 && echo ' -ljobs'; rm -f x.${!-$$}.[cox])` -setv mam_libi `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -li >/dev/null 2>&1 && echo ' -li'; rm -f x.${!-$$}.[cox])` -setv mam_libdl `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -ldl >/dev/null 2>&1 && echo ' -ldl'; rm -f x.${!-$$}.[cox])` -setv mam_libdld `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -ldld >/dev/null 2>&1 && echo ' -ldld'; rm -f x.${!-$$}.[cox])` -setv mam_libintl `(set -; cd /tmp; echo 'int main(){return(0);}' > x.${!-$$}.c; ${CC} ${CCFLAGS} -o x.${!-$$}.x x.${!-$$}.c -lintl >/dev/null 2>&1 && echo ' -lintl'; rm -f x.${!-$$}.[cox])` -setv mam_libast ${mam_cc_L+-last}${mam_cc_L-${INSTALLROOT}/lib/libast.a} -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/externs -done FEATURE/externs generated -make FEATURE/execargs implicit -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : def execargs -done FEATURE/execargs generated -make FEATURE/pstat implicit -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : def pstat -done FEATURE/pstat generated -make FEATURE/time implicit -make features/time -done features/time -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/time -done FEATURE/time generated -make include/timeout.h implicit -done include/timeout.h -make include/history.h implicit -done include/history.h -make include/shnodes.h implicit -done include/shnodes.h -make include/jobs.h implicit -make FEATURE/ttys implicit -make features/ttys -done features/ttys -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/ttys -done FEATURE/ttys dontcare generated -make FEATURE/options implicit -make features/options.sh -make OPTIONS implicit -done OPTIONS -done features/options.sh -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/options.sh OPTIONS -done FEATURE/options dontcare generated -done include/jobs.h -make include/io.h implicit -make ${PACKAGE_ast_INCLUDE}/ast/sfio.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/sfio.h -make ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/ast.h -done include/io.h -make include/path.h implicit -make FEATURE/acct implicit -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : def acct -done FEATURE/acct dontcare generated -make FEATURE/options implicit -done FEATURE/options dontcare generated -done include/path.h -make include/variables.h implicit -make FEATURE/dynamic implicit -make features/dynamic -done features/dynamic -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/dynamic -done FEATURE/dynamic dontcare generated -prev FEATURE/options implicit -done include/variables.h -make include/defs.h implicit -make include/shell.h implicit -done include/shell.h -make include/argnod.h implicit -done include/argnod.h -make include/fault.h implicit -make FEATURE/sigfeatures implicit -make features/sigfeatures -done features/sigfeatures -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/sigfeatures -done FEATURE/sigfeatures dontcare generated -make FEATURE/setjmp implicit -make features/setjmp -done features/setjmp -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/setjmp -done FEATURE/setjmp dontcare generated -done include/fault.h -prev include/history.h implicit -prev FEATURE/options implicit -done include/defs.h -make ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/ls.h -done sh/main.c -prev sh/main.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -DKSHELL -c sh/main.c -done main.o generated -make libshell.a archive -make alarm.o -make bltins/alarm.c -prev FEATURE/time implicit -make include/builtins.h implicit -make FEATURE/dynamic implicit -done FEATURE/dynamic dontcare generated -prev FEATURE/options implicit -done include/builtins.h -make ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/stak.h -make ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/error.h -prev include/defs.h implicit -done bltins/alarm.c -prev bltins/alarm.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/alarm.c -done alarm.o generated -make cd_pwd.o -make bltins/cd_pwd.c -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev include/builtins.h implicit -make include/name.h implicit -done include/name.h -prev include/path.h implicit -prev include/variables.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev include/defs.h implicit -done bltins/cd_pwd.c -prev bltins/cd_pwd.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/cd_pwd.c -done cd_pwd.o generated -make cflow.o -make bltins/cflow.c -prev include/builtins.h implicit -prev include/shnodes.h implicit -make /usr/include/ctype.h implicit -done /usr/include/ctype.h -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -prev include/defs.h implicit -done bltins/cflow.c -prev bltins/cflow.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/cflow.c -done cflow.o generated -make deparse.o -make sh/deparse.c -make include/test.h implicit -done include/test.h -prev include/shnodes.h implicit -prev include/defs.h implicit -done sh/deparse.c -prev sh/deparse.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/deparse.c -done deparse.o generated -make getopts.o -make bltins/getopts.c -prev include/builtins.h implicit -make include/nval.h implicit -done include/nval.h -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/variables.h implicit -prev include/defs.h implicit -done bltins/getopts.c -prev bltins/getopts.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/getopts.c -done getopts.o generated -make hist.o -make bltins/hist.c -prev include/builtins.h implicit -prev include/history.h implicit -prev include/name.h implicit -prev include/io.h implicit -prev include/variables.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev include/defs.h implicit -done bltins/hist.c -prev bltins/hist.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c bltins/hist.c -done hist.o generated -make misc.o -make bltins/misc.c -prev include/jobs.h implicit -prev include/builtins.h implicit -prev include/history.h implicit -prev include/name.h implicit -prev include/io.h implicit -prev include/path.h implicit -prev include/shnodes.h implicit -prev include/variables.h implicit -prev include/defs.h implicit -done bltins/misc.c -prev bltins/misc.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c bltins/misc.c -done misc.o generated -make print.o -make bltins/print.c -prev include/builtins.h implicit -prev include/history.h implicit -prev include/name.h implicit -prev include/io.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/defs.h implicit -done bltins/print.c -prev bltins/print.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c bltins/print.c -done print.o generated -make read.o -make bltins/read.c -make include/national.h implicit -done include/national.h -make include/terminal.h implicit -done include/terminal.h -prev include/history.h implicit -prev include/builtins.h implicit -prev include/name.h implicit -prev include/io.h implicit -make include/lexstates.h implicit -done include/lexstates.h -prev include/variables.h implicit -prev include/defs.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done bltins/read.c -prev bltins/read.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -DKSHELL -c bltins/read.c -done read.o generated -make sleep.o -make bltins/sleep.c -make FEATURE/poll implicit -make features/poll -done features/poll -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/poll -done FEATURE/poll generated -prev FEATURE/time implicit -prev include/builtins.h implicit -make /usr/include/errno.h implicit -done /usr/include/errno.h -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/defs.h implicit -done bltins/sleep.c -prev bltins/sleep.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/sleep.c -done sleep.o generated -make trap.o -make bltins/trap.c -prev include/builtins.h implicit -prev include/jobs.h implicit -prev /usr/include/ctype.h implicit -prev include/defs.h implicit -done bltins/trap.c -prev bltins/trap.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/trap.c -done trap.o generated -make test.o -make bltins/test.c -prev FEATURE/externs implicit -prev include/builtins.h implicit -prev include/test.h implicit -prev include/terminal.h implicit -prev include/io.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev /usr/include/ctype.h implicit -prev include/defs.h implicit -done bltins/test.c -prev bltins/test.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c bltins/test.c -done test.o generated -make typeset.o -make bltins/typeset.c -prev include/argnod.h implicit -make include/fcin.h implicit -done include/fcin.h -prev include/variables.h implicit -prev include/builtins.h implicit -prev include/history.h implicit -prev include/name.h implicit -prev include/path.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/defs.h implicit -done bltins/typeset.c -prev bltins/typeset.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/typeset.c -done typeset.o generated -make ulimit.o -make bltins/ulimit.c -make include/ulimit.h implicit -prev FEATURE/time implicit -make FEATURE/rlimits implicit -make features/rlimits -done features/rlimits -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/rlimits -done FEATURE/rlimits dontcare generated -done include/ulimit.h -prev include/builtins.h implicit -prev include/shell.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/sfio.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done bltins/ulimit.c -prev bltins/ulimit.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/ulimit.c -done ulimit.o generated -make umask.o -make bltins/umask.c -prev include/builtins.h implicit -prev include/shell.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/sfio.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done bltins/umask.c -prev bltins/umask.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/umask.c -done umask.o generated -make whence.o -make bltins/whence.c -prev include/builtins.h implicit -make include/shlex.h implicit -prev FEATURE/options implicit -done include/shlex.h -prev include/path.h implicit -prev include/name.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/defs.h implicit -done bltins/whence.c -prev bltins/whence.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c bltins/whence.c -done whence.o generated -make arith.o -make sh/arith.c -make FEATURE/locale implicit -make features/locale -done features/locale -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/locale -done FEATURE/locale generated -make include/streval.h implicit -done include/streval.h -prev include/name.h implicit -prev include/lexstates.h implicit -prev /usr/include/ctype.h implicit -prev include/defs.h implicit -done sh/arith.c -prev sh/arith.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/arith.c -done arith.o generated -make args.o -make sh/args.c -prev include/terminal.h implicit -prev include/builtins.h implicit -prev include/path.h implicit -prev include/defs.h implicit -done sh/args.c -prev sh/args.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c sh/args.c -done args.o generated -make array.o -make sh/array.c -prev include/name.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev include/defs.h implicit -done sh/array.c -prev sh/array.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/array.c -done array.o generated -make completion.o -make edit/completion.c -prev include/history.h implicit -make include/edit.h implicit -make FEATURE/setjmp implicit -done FEATURE/setjmp dontcare generated -prev FEATURE/options implicit -done include/edit.h -prev include/io.h implicit -prev include/path.h implicit -prev include/lexstates.h implicit -prev include/defs.h implicit -done edit/completion.c -prev edit/completion.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DKSHELL -DSHOPT_VSH -DSHOPT_SUID_EXEC -c edit/completion.c -done completion.o generated -make dlopen.o -make sh/dlopen.c -prev FEATURE/dynamic implicit -prev include/nval.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/dlopen.c -prev sh/dlopen.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c sh/dlopen.c -done dlopen.o generated -make defs.o -make sh/defs.c -prev include/timeout.h implicit -prev include/edit.h implicit -prev include/shlex.h implicit -prev include/jobs.h implicit -prev include/defs.h implicit -done sh/defs.c -prev sh/defs.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DKSHELL -DSHOPT_SUID_EXEC -c sh/defs.c -done defs.o generated -make edit.o -make edit/edit.c -prev include/edit.h implicit -prev include/history.h implicit -prev include/terminal.h implicit -prev include/io.h implicit -prev FEATURE/time implicit -prev include/path.h implicit -prev FEATURE/options implicit -prev /usr/include/ctype.h implicit -prev /usr/include/errno.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done edit/edit.c -prev edit/edit.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DKSHELL -DSHOPT_SUID_EXEC -c edit/edit.c -done edit.o generated -make expand.o -make sh/expand.c -prev include/path.h implicit -prev include/io.h implicit -make ${PACKAGE_ast_INCLUDE}/ast/ast_dir.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/ast_dir.h -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -done sh/expand.c -prev sh/expand.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -DKSHELL -c sh/expand.c -done expand.o generated -make fault.o -make sh/fault.c -prev include/path.h implicit -prev include/jobs.h implicit -prev include/shnodes.h implicit -prev include/history.h implicit -prev include/io.h implicit -prev include/fcin.h implicit -prev include/defs.h implicit -done sh/fault.c -prev sh/fault.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -DKSHELL -c sh/fault.c -done fault.o generated -make fcin.o -make sh/fcin.c -prev include/fcin.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/sfio.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/fcin.c -prev sh/fcin.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c sh/fcin.c -done fcin.o generated -make history.o -make edit/history.c -prev include/national.h implicit -prev include/history.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev FEATURE/time implicit -prev ${PACKAGE_ast_INCLUDE}/ast/sfio.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done edit/history.c -prev edit/history.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_ESH -DKSHELL -DSHOPT_SUID_EXEC -c edit/history.c -done history.o generated -make init.o -make sh/init.c -prev include/national.h implicit -prev FEATURE/locale implicit -prev include/lexstates.h implicit -prev FEATURE/dynamic implicit -prev FEATURE/time implicit -prev include/io.h implicit -prev include/jobs.h implicit -prev include/name.h implicit -prev include/fault.h implicit -prev include/path.h implicit -prev include/variables.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev include/defs.h implicit -done sh/init.c -prev sh/init.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/init.c -done init.o generated -make io.o -make sh/io.c -prev FEATURE/poll implicit -prev FEATURE/dynamic implicit -prev FEATURE/externs implicit -prev include/timeout.h implicit -prev include/edit.h implicit -prev include/history.h implicit -prev include/shnodes.h implicit -prev include/jobs.h implicit -prev include/io.h implicit -prev include/variables.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev include/fcin.h implicit -prev include/defs.h implicit -done sh/io.c -prev sh/io.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_ESH -DKSHELL -DSHOPT_SUID_EXEC -c sh/io.c -done io.o generated -make jobs.o -make sh/jobs.c -prev include/history.h implicit -prev include/jobs.h implicit -prev include/io.h implicit -make ${PACKAGE_ast_INCLUDE}/ast/wait.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/wait.h -prev /usr/include/ctype.h implicit -prev include/defs.h implicit -done sh/jobs.c -prev sh/jobs.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_ESH -DSHOPT_SUID_EXEC -DKSHELL -c sh/jobs.c -done jobs.o generated -make lex.o -make sh/lex.c -prev include/lexstates.h implicit -prev include/test.h implicit -prev include/shlex.h implicit -prev include/argnod.h implicit -prev FEATURE/options implicit -prev include/nval.h implicit -prev include/fcin.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/lex.c -prev sh/lex.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -DKSHELL -c sh/lex.c -done lex.o generated -make macro.o -make sh/macro.c -prev include/national.h implicit -prev include/path.h implicit -prev include/shnodes.h implicit -prev include/io.h implicit -prev include/shlex.h implicit -prev include/variables.h implicit -prev include/name.h implicit -make /usr/include/pwd.h implicit -done /usr/include/pwd.h -prev include/fcin.h implicit -prev include/defs.h implicit -done sh/macro.c -prev sh/macro.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -c sh/macro.c -done macro.o generated -make name.o -make sh/name.c -prev include/builtins.h implicit -prev include/shnodes.h implicit -prev include/national.h implicit -prev FEATURE/locale implicit -prev include/timeout.h implicit -prev include/lexstates.h implicit -prev include/path.h implicit -prev include/variables.h implicit -prev /usr/include/ctype.h implicit -prev include/defs.h implicit -done sh/name.c -prev sh/name.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c sh/name.c -done name.o generated -make parse.o -make sh/parse.c -prev include/test.h implicit -prev include/builtins.h implicit -prev include/history.h implicit -prev include/shlex.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev include/fcin.h implicit -prev /usr/include/ctype.h implicit -done sh/parse.c -prev sh/parse.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c sh/parse.c -done parse.o generated -make path.o -make sh/path.c -prev FEATURE/time implicit -prev FEATURE/externs implicit -prev include/test.h implicit -prev include/history.h implicit -prev include/jobs.h implicit -prev include/io.h implicit -prev include/path.h implicit -prev include/variables.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev include/fcin.h implicit -prev include/defs.h implicit -done sh/path.c -prev sh/path.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_SUID_EXEC -DSHOPT_ESH -DSHOPT_VSH -DKSHELL -c sh/path.c -done path.o generated -make string.o -make sh/string.c -prev include/national.h implicit -prev include/lexstates.h implicit -make include/shtable.h implicit -done include/shtable.h -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/stak.h implicit -prev include/defs.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/string.c -prev sh/string.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/string.c -done string.o generated -make streval.o -make sh/streval.c -prev FEATURE/externs implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev /usr/include/ctype.h implicit -prev include/streval.h implicit -done sh/streval.c -prev sh/streval.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c sh/streval.c -done streval.o generated -make subshell.o -make sh/subshell.c -prev include/path.h implicit -prev include/variables.h implicit -prev include/jobs.h implicit -prev include/shlex.h implicit -prev include/shnodes.h implicit -prev include/fault.h implicit -prev include/io.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev include/defs.h implicit -done sh/subshell.c -prev sh/subshell.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -DKSHELL -c sh/subshell.c -done subshell.o generated -make tdump.o -make sh/tdump.c -prev include/io.h implicit -prev include/path.h implicit -prev include/shnodes.h implicit -prev include/defs.h implicit -done sh/tdump.c -prev sh/tdump.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -c sh/tdump.c -done tdump.o generated -make timers.o -make sh/timers.c -prev FEATURE/time implicit -make FEATURE/sigfeatures implicit -done FEATURE/sigfeatures generated -prev include/fault.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -make ${PACKAGE_ast_INCLUDE}/ast/sig.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/sig.h -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/timers.c -prev sh/timers.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c sh/timers.c -done timers.o generated -make trestore.o -make sh/trestore.c -prev include/io.h implicit -prev include/path.h implicit -prev include/shnodes.h implicit -prev include/defs.h implicit -done sh/trestore.c -prev sh/trestore.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -c sh/trestore.c -done trestore.o generated -make userinit.o -make sh/userinit.c -prev include/defs.h implicit -done sh/userinit.c -prev sh/userinit.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/userinit.c -done userinit.o generated -make waitevent.o -make sh/waitevent.c -prev include/defs.h implicit -done sh/waitevent.c -prev sh/waitevent.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c sh/waitevent.c -done waitevent.o generated -make xec.o -make sh/xec.c -prev FEATURE/locale implicit -prev FEATURE/externs implicit -prev FEATURE/time implicit -prev include/builtins.h implicit -prev include/test.h implicit -prev include/jobs.h implicit -prev include/shnodes.h implicit -prev include/io.h implicit -prev include/path.h implicit -prev include/variables.h implicit -prev include/fcin.h implicit -prev include/defs.h implicit -done sh/xec.c -prev sh/xec.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c sh/xec.c -done xec.o generated -make limits.o -make data/limits.c -prev include/ulimit.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done data/limits.c -prev data/limits.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c data/limits.c -done limits.o generated -make msg.o -make data/msg.c -prev include/national.h implicit -prev include/edit.h implicit -prev include/jobs.h implicit -prev include/builtins.h implicit -prev include/history.h implicit -prev include/timeout.h implicit -prev include/shlex.h implicit -prev include/io.h implicit -prev include/path.h implicit -prev include/defs.h implicit -prev /usr/include/errno.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done data/msg.c -prev data/msg.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_SUID_EXEC -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -c data/msg.c -done msg.o generated -make strdata.o -make data/strdata.c -prev include/streval.h implicit -prev FEATURE/options implicit -done data/strdata.c -prev data/strdata.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/strdata.c -done strdata.o generated -make testops.o -make data/testops.c -prev include/test.h implicit -prev include/shtable.h implicit -done data/testops.c -prev data/testops.c -exec - ${CC} ${CCFLAGS} -Iinclude -c data/testops.c -done testops.o generated -make keywords.o -make data/keywords.c -prev FEATURE/options implicit -prev include/shlex.h implicit -prev include/shtable.h implicit -make ${PACKAGE_ast_INCLUDE}/ast/hash.h implicit -done ${PACKAGE_ast_INCLUDE}/ast/hash.h -done data/keywords.c -prev data/keywords.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/keywords.c -done keywords.o generated -make options.o -make data/options.c -prev include/shtable.h implicit -prev include/name.h implicit -prev FEATURE/options implicit -prev include/shell.h implicit -done data/options.c -prev data/options.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/options.c -done options.o generated -make signals.o -make data/signals.c -prev include/fault.h implicit -prev include/shtable.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done data/signals.c -prev data/signals.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -c data/signals.c -done signals.o generated -make aliases.o -make data/aliases.c -prev include/name.h implicit -prev include/shtable.h implicit -prev FEATURE/dynamic implicit -prev FEATURE/options implicit -make /usr/include/signal.h implicit -done /usr/include/signal.h -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done data/aliases.c -prev data/aliases.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/aliases.c -done aliases.o generated -make builtins.o -make data/builtins.c -make FEATURE/cmds implicit -make features/cmds -done features/cmds -exec - iffe set cc ${CC} ${ICCFLAGS} ${LDFLAGS} : ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} : run features/cmds -done FEATURE/cmds dontcare generated -prev include/name.h implicit -prev include/shtable.h implicit -prev /usr/include/signal.h implicit -prev include/shell.h implicit -done data/builtins.c -prev data/builtins.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -DKSHELL -c data/builtins.c -done builtins.o generated -make variables.o -make data/variables.c -prev include/name.h implicit -prev include/shtable.h implicit -prev include/shell.h implicit -prev FEATURE/dynamic implicit -prev FEATURE/options implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done data/variables.c -prev data/variables.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/variables.c -done variables.o generated -make lexstates.o -make data/lexstates.c -prev include/lexstates.h implicit -prev FEATURE/options implicit -done data/lexstates.c -prev data/lexstates.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -DSHOPT_VSH -DSHOPT_SUID_EXEC -DSHOPT_ESH -c data/lexstates.c -done lexstates.o generated -make emacs.o -make edit/emacs.c -prev include/terminal.h implicit -prev include/edit.h implicit -prev include/history.h implicit -prev include/io.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done edit/emacs.c -prev edit/emacs.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c edit/emacs.c -done emacs.o generated -make vi.o -make edit/vi.c -prev FEATURE/time implicit -prev include/terminal.h implicit -prev include/edit.h implicit -prev include/history.h implicit -prev include/io.h implicit -prev /usr/include/ctype.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev FEATURE/options implicit -done edit/vi.c -prev edit/vi.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_ESH -DSHOPT_VSH -DSHOPT_SUID_EXEC -c edit/vi.c -done vi.o generated -exec - ${AR} cr libshell.a alarm.o cd_pwd.o cflow.o deparse.o getopts.o hist.o misc.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o arith.o args.o array.o completion.o dlopen.o defs.o edit.o expand.o fault.o fcin.o history.o init.o io.o jobs.o -exec - ${AR} cr libshell.a lex.o macro.o name.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o userinit.o waitevent.o xec.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o aliases.o builtins.o variables.o lexstates.o emacs.o vi.o -exec - (ranlib libshell.a) >/dev/null 2>&1 || true -done libshell.a generated -setv mam_libcmd ${mam_cc_L+-lcmd}${mam_cc_L-${INSTALLROOT}/lib/libcmd.a} -setv mam_libcmd `${mam_cc_L+cat} ${mam_cc_L-sed} ${mam_cc_L-s,-lcmd,${INSTALLROOT}/lib/libcmd.a,} ${PACKAGE_ast_LIB}/lib/cmd` -exec - ${CC} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o ksh main.o libshell.a ${mam_libcmd} ${mam_cc_static} ${mam_libast} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} -done ksh generated -make shcomp -make shcomp.o -make sh/shcomp.c -prev include/io.h implicit -prev include/path.h implicit -prev include/shnodes.h implicit -prev include/defs.h implicit -done sh/shcomp.c -prev sh/shcomp.c -exec - ${CC} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE}/ast -DKSHELL -DSHOPT_SUID_EXEC -DSHOPT_VSH -DSHOPT_ESH -c sh/shcomp.c -done shcomp.o virtual -prev libshell.a archive -setv mam_libcmd `${mam_cc_L+cat} ${mam_cc_L-sed} ${mam_cc_L-s,-lcmd,${INSTALLROOT}/lib/libcmd.a,} ${PACKAGE_ast_LIB}/lib/cmd` -exec - ${CC} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o libshell.a ${mam_libcmd} ${mam_libast} ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} -done shcomp virtual -make ksh.msg -prev data/limits.c -prev data/msg.c -prev data/strdata.c -prev data/testops.c -prev data/keywords.c -prev data/options.c -prev data/signals.c -prev data/aliases.c -prev data/builtins.c -prev data/variables.c -prev data/lexstates.c -exec - grep '[ ]e_[a-z].*".*[^\][a-z].*"' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | grep -v /bin/ | grep -v /usr/ | grep -v /dev/ | grep -v /etc/ | grep -v A__z | sed 's/.*=[ ]*\(".*"\);.*/\1/' | sort | uniq > ksh.msg -exec - grep '[ ]sh_opt.*".*[^\][a-z].*"' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | sed 's/.*=[ ]*\(".*"\);.*/\1/' >> ksh.msg -exec - grep '[ ]is_[a-z].*".*[^\][a-z].*"' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | sed 's/.*=[ ]*\(".*"\);.*/\1/' >> ksh.msg -exec - grep '[ ]e_notset' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | sed 's/.*"....\(.*"\).*/"\1/' >> ksh.msg -exec - grep '[ ]e_subst' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | sed 's/.*"....\(.*"\).*/"\1/' >> ksh.msg -exec - grep '[ ]e_file' data/limits.c data/msg.c data/strdata.c data/testops.c data/keywords.c data/options.c data/signals.c data/aliases.c data/builtins.c data/variables.c data/lexstates.c | sed 's/.*"....\(.*"\).*/"\1/' >> ksh.msg -exec - grep ',$' data/signals.c | sed 's/.*\(".*"\),/\1/' | sort | uniq >> ksh.msg -done ksh.msg virtual -make sh/suid_exec.c -prev ${PACKAGE_ast_INCLUDE}/ast/error.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/sig.h implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ls.h implicit -prev FEATURE/externs implicit -prev ${PACKAGE_ast_INCLUDE}/ast/ast.h implicit -done sh/suid_exec.c -make shell -prev libshell.a archive -done shell virtual -prev libshell.a archive -make suid_exec -make suid_exec.o -prev sh/suid_exec.c -prev sh/suid_exec.c -exec - ${CC} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE}/ast -c sh/suid_exec.c -done suid_exec.o virtual -exec - ${CC} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_cc_static} ${mam_libm} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libjobs} ${mam_cc_dynamic} ${mam_cc_static} ${mam_libi} ${mam_cc_dynamic} ${mam_libdl} ${mam_libdld} ${mam_cc_static} ${mam_libintl} ${mam_cc_dynamic} ${mam_libast} -done suid_exec virtual -done all virtual -make ${INSTALLROOT}/bin -exec - set - -exec - if test ! -d ${INSTALLROOT}/bin -exec - then set -x && mkdir -p ${INSTALLROOT}/bin 2>/dev/null && set - || -exec - { -exec - test -d ./-p && rm -rf ./-p -exec - p= -exec - for d in `echo ${INSTALLROOT}/bin | sed -e 's%\\(.\\)/%\\1 %g'` -exec - do case $p in -exec - "") p=$d ;; -exec - *) p=$p/$d ;; -exec - esac -exec - case $d in -exec - .|..) ;; -exec - *) if test ! -d $p -exec - then rm -f $p -exec - set -x && mkdir $p && set - -exec - fi -exec - ;; -exec - esac -exec - done -exec - } && set -x -exec - fi -done ${INSTALLROOT}/bin generated -make ${INSTALLROOT}/bin/ksh -prev ksh -exec - { mv ${INSTALLROOT}/bin/ksh ${INSTALLROOT}/bin/ksh.old 2>/dev/null; cp ksh ${INSTALLROOT}/bin/ksh 2>/dev/null ;} || true -done ${INSTALLROOT}/bin/ksh virtual -make ${INSTALLROOT}/man/man1 -exec - set - -exec - if test ! -d ${INSTALLROOT}/man/man1 -exec - then set -x && mkdir -p ${INSTALLROOT}/man/man1 2>/dev/null && set - || -exec - { -exec - test -d ./-p && rm -rf ./-p -exec - p= -exec - for d in `echo ${INSTALLROOT}/man/man1 | sed -e 's%\\(.\\)/%\\1 %g'` -exec - do case $p in -exec - "") p=$d ;; -exec - *) p=$p/$d ;; -exec - esac -exec - case $d in -exec - .|..) ;; -exec - *) if test ! -d $p -exec - then rm -f $p -exec - set -x && mkdir $p && set - -exec - fi -exec - ;; -exec - esac -exec - done -exec - } && set -x -exec - fi -done ${INSTALLROOT}/man/man1 generated -make ${INSTALLROOT}/man/man1/sh.1 -make sh.1 -done sh.1 -exec - { mv ${INSTALLROOT}/man/man1/sh.1 ${INSTALLROOT}/man/man1/sh.1.old 2>/dev/null; cp sh.1 ${INSTALLROOT}/man/man1/sh.1 2>/dev/null ;} || true -done ${INSTALLROOT}/man/man1/sh.1 generated -make ${INSTALLROOT}/lib -exec - set - -exec - if test ! -d ${INSTALLROOT}/lib -exec - then set -x && mkdir -p ${INSTALLROOT}/lib 2>/dev/null && set - || -exec - { -exec - test -d ./-p && rm -rf ./-p -exec - p= -exec - for d in `echo ${INSTALLROOT}/lib | sed -e 's%\\(.\\)/%\\1 %g'` -exec - do case $p in -exec - "") p=$d ;; -exec - *) p=$p/$d ;; -exec - esac -exec - case $d in -exec - .|..) ;; -exec - *) if test ! -d $p -exec - then rm -f $p -exec - set -x && mkdir $p && set - -exec - fi -exec - ;; -exec - esac -exec - done -exec - } && set -x -exec - fi -done ${INSTALLROOT}/lib generated -make ${INSTALLROOT}/lib/libshell.a archive -prev libshell.a archive -exec - { mv ${INSTALLROOT}/lib/libshell.a ${INSTALLROOT}/lib/libshell.a.old 2>/dev/null; cp libshell.a ${INSTALLROOT}/lib/libshell.a 2>/dev/null ;} || true -exec - (ranlib ${INSTALLROOT}/lib/libshell.a) >/dev/null 2>&1 || true -done ${INSTALLROOT}/lib/libshell.a generated -make ${INSTALLROOT}/man/man3 -exec - set - -exec - if test ! -d ${INSTALLROOT}/man/man3 -exec - then set -x && mkdir -p ${INSTALLROOT}/man/man3 2>/dev/null && set - || -exec - { -exec - test -d ./-p && rm -rf ./-p -exec - p= -exec - for d in `echo ${INSTALLROOT}/man/man3 | sed -e 's%\\(.\\)/%\\1 %g'` -exec - do case $p in -exec - "") p=$d ;; -exec - *) p=$p/$d ;; -exec - esac -exec - case $d in -exec - .|..) ;; -exec - *) if test ! -d $p -exec - then rm -f $p -exec - set -x && mkdir $p && set - -exec - fi -exec - ;; -exec - esac -exec - done -exec - } && set -x -exec - fi -done ${INSTALLROOT}/man/man3 generated -make ${INSTALLROOT}/man/man3/nval.3 -make nval.3 -done nval.3 -exec - { mv ${INSTALLROOT}/man/man3/nval.3 ${INSTALLROOT}/man/man3/nval.3.old 2>/dev/null; cp nval.3 ${INSTALLROOT}/man/man3/nval.3 2>/dev/null ;} || true -done ${INSTALLROOT}/man/man3/nval.3 generated -make ${INSTALLROOT}/include/ast -exec - set - -exec - if test ! -d ${INSTALLROOT}/include/ast -exec - then set -x && mkdir -p ${INSTALLROOT}/include/ast 2>/dev/null && set - || -exec - { -exec - test -d ./-p && rm -rf ./-p -exec - p= -exec - for d in `echo ${INSTALLROOT}/include/ast | sed -e 's%\\(.\\)/%\\1 %g'` -exec - do case $p in -exec - "") p=$d ;; -exec - *) p=$p/$d ;; -exec - esac -exec - case $d in -exec - .|..) ;; -exec - *) if test ! -d $p -exec - then rm -f $p -exec - set -x && mkdir $p && set - -exec - fi -exec - ;; -exec - esac -exec - done -exec - } && set -x -exec - fi -done ${INSTALLROOT}/include/ast virtual -make ${INSTALLROOT}/include/ast/nval.h -prev include/nval.h -exec - proto -p -s -c AT\&T\ Bell\ Laboratories include/nval.h > 1.${COTEMP}.x -exec - if cmp -s ${INSTALLROOT}/include/ast/nval.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/nval.h -exec - fi -done ${INSTALLROOT}/include/ast/nval.h virtual -make ${INSTALLROOT}/include/ast/shell.h -prev include/shell.h -exec - proto -p -s -c AT\&T\ Bell\ Laboratories include/shell.h > 1.${COTEMP}.x -exec - if cmp -s ${INSTALLROOT}/include/ast/shell.h 1.${COTEMP}.x -exec - then rm -f 1.${COTEMP}.x -exec - else mv 1.${COTEMP}.x ${INSTALLROOT}/include/ast/shell.h -exec - fi -done ${INSTALLROOT}/include/ast/shell.h virtual -make ${INSTALLROOT}/bin/suid_exec -prev suid_exec -exec - { mv ${INSTALLROOT}/bin/suid_exec ${INSTALLROOT}/bin/suid_exec.old 2>/dev/null; cp suid_exec ${INSTALLROOT}/bin/suid_exec 2>/dev/null ;} || true -done ${INSTALLROOT}/bin/suid_exec generated -make ${INSTALLROOT}/bin/shcomp -prev shcomp -exec - { mv ${INSTALLROOT}/bin/shcomp ${INSTALLROOT}/bin/shcomp.old 2>/dev/null; cp shcomp ${INSTALLROOT}/bin/shcomp 2>/dev/null ;} || true -done ${INSTALLROOT}/bin/shcomp virtual -done install virtual diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE b/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE deleted file mode 100644 index c29cb8bb6..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE +++ /dev/null @@ -1,152 +0,0 @@ -.sp 3 -.tl ''Ksh Features That Are Obsolete in Ksh93'' -.sp 2 -.AL 1 -.LI -Using a pair of grave accents \^\fB\(ga\fR ... \fB\(ga\fR\^ -for command substition. Use \fB$(\fR ... \fB)\fR instead. -.LI -.B FCEDIT -is an obsolete name for -the default editor name for the -.B hist -command. -.B FCEDIT -is not used when -.B HISTEDIT -is set. Use -.B HISTEDIT -instead. -.LI -The newtest (\fB[[\fR ... \fB]]\fR) operator -\fB\-a\fP \fIfile\fP -is obsolete. Use -\fB\-e\fP instead. -.LI -The newtest (\fB[[\fR ... \fB]]\fR) operator -.BR = , -as used in -\fIstring\fP \fB=\fP \fIpattern\fP -is obsolete. Use -\fB==\fP instead. -.LI -The following obsolete arithmetic comparisons are also permitted: -.in +5 -.VL 20 -.LI "\fIexp1\fP \fB\-eq\fP \fIexp2\fP" -True, if -.I exp1 -is equal to -.IR exp2 . -.LI "\fIexp1\fP \fB\-ne\fP \fIexp2\fP" -True, if -.I exp1 -is not equal to -.IR exp2 . -.LI "\fIexp1\fP \fB\-lt\fP \fIexp2\fP" -True, if -.I exp1 -is less than -.IR exp2 . -.LI "\fIexp1\fP \fB\-gt\fP \fIexp2\fP" -True, if -.I exp1 -is greater than -.IR exp2 . -.LI "\fIexp1\fP \fB\-le\fP \fIexp2\fP" -True, if -.I exp1 -is less than or equal to -.IR exp2 . -.LI "\fIexp1\fP \fB\-ge\fP \fIexp2\fP" -True, if -.I exp1 -is greater than or equal to -.IR exp2 . -.LE \" End .VL -.in -5 -.LI -Using test -t or [ -t ] without specifying the file unit number. -.LI -The -.B \-k -option to the \fBset\fR builtin is obsolete. It causes -.I all\^ -variable assignment arguments are placed in the environment, -even if they occur after the command name. -The following -first prints -.B "a=b c" -and then -.BR c : -There is no alternative. -.LI -The obsolete -.B \-xf -option of the -.B typeset -command allows a function to be exported -to scripts that are executed without a separate -invocation of the shell. -Functions that need to be defined across separate -invocations of the shell should -be placed in a directory and the -.B FPATH -variable should contains the name of this directory. -They may also -be specified in the -.B ENV -file with the -.B \-xf -option of -.BR typeset . -.LI -The shell environment variable -.B FCEDIT -is obsolete. Use -.B HISTEDIT -instead. -.LI -In the -.B \-s -option -(to \fBfc\fR or \fBhist\fR command???) -( -and in obsolete versions, the editor name -.B \- -) -is used to skip the editing phase and -to re-execute the command. -.LI -The -.B \-t -option to \fBalias\fR builtin is is obsolete. It -is used to set and list tracked aliases. -There is no replacement. -.LI -The shell command line option -.B \-t -is obsolete. This option cause the shell to exit after reading -and executing one command. The is no replacement (although ending -\&"command" with the exit builtin should have the same effect). -.LI -As an obsolete feature of the "set" builtin, -if the first -.I arg\^ -is -.B \- -then the -.B \-x -and -.B \-v -options are turned off and the next -.I arg -is treated as the first argument. -Using -.B \+ -rather than -.B \- -causes these options to be turned off. -These options can also be used upon invocation of the shell. -.LE - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OPTIONS b/cde/programs/dtksh/ksh93/src/cmd/ksh93/OPTIONS deleted file mode 100644 index bbaa60808..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OPTIONS +++ /dev/null @@ -1,19 +0,0 @@ -ACCT= # accounting -ACCTFILE= # enable per user accounting info -BRACEPAT=1 # C-shell {...,...} expansions (note , required) -CRNL=0 # accept for -DYNAMIC=1 # dynamic loading for builtins, requires dlopen() -ECHOPRINT=0 # make echo equivalent to print, overrides ECHO_N -ESH=1 # emacs edit option -FS_3D= # 3d file system -KIA=1 # shell information database generation -MULTIBYTE=1 # multibyte character handling -OLDTERMIO=0 # for systems that must support both TCGETA and TCGETS -OO=1 # partial object oriented extension, not complete -P_SUID=0 # real uid's that require -p flag for setuid/setgid -RAWONLY=0 # make viraw the only vi mode. Sometimes set automatically -SEVENBIT=0 # strip the eigth bit from characters -SPAWN=0 # use libast spawnve() in place of fork/exec when possible -SUID_EXEC=1 # execute /etc/suid_exec for suid, sgid script -TIMEOUT=0 # number of seconds for shell timeout, 0 disables feature -VSH=1 # vi edit option diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO b/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO deleted file mode 100644 index 9361a30e9..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO +++ /dev/null @@ -1,147 +0,0 @@ -.SA 1 -.sp 2 -.ce -KSH-93 - The KornShell Command and Programming Language -.sp 2 -.al -.P -KSH-93 is the most recent version of the KornShell Language -described in -"The KornShell Command and Programming Language," -by Morris Bolsky and David Korn of AT&T Bell Laboratories, ISBN 0-13-182700-6. -The KornShell is a shell programming language, -which is upward compatible with "sh" (the Bourne Shell), -and is intended to conform to the IEEE P1003.2/ISO 9945.2 Shell and -Utilities standard. -KSH-93 provides an enhanced programming environment in -addition to the major command-entry features of the BSD -shell "csh". With KSH-93, medium-sized programming tasks can be -performed at shell-level without a significant loss in performance. -In addition, "sh" scripts can be run on KSH-93 without modification. -.P -The code should conform to the IEEE POSIX 1003.1 standard and to the -proposed ANSI-C standard so that it should be portable to all -such systems. Like the previous version, KSH-88, -it is designed to accept eight bit character sets -transparently, thereby making it internationally compatible. -It can support multi-byte characters sets with some characteristics -of the character set given at run time. -.P -KSH-93 provides the following features, many of which were also inherent -in KSH-88: -.BL -.LI -Enhanced Command Re-entry Capability: The KSH-93 history -function records commands entered at any shell level and stores -them, up to a user-specified limit, even after you log off. -This allows you to re-enter long commands with a few keystrokes -- even those commands you entered yesterday. -The history file allows for eight bit characters in -commands and supports essentially unlimited size histories. -.LI -In-line Editing: In "sh", the only way to fix mistyped -commands is to backspace or retype the line. KSH-93 allows you -to edit a command line using a choice of EMACS-TC or "vi" -functions. -You can use the in-line editors to complete filenames as -you type them. -You may also use this editing feature when entering -command lines from your history file. -A user can capture keystrokes and rebind keys to customize the -editing interface. -.LI -Extended I/O Capabilities: KSH-93 provides several I/O -capabilities not available in "sh", including the ability to: -.BL -.LI -specify a file descriptor for input and output -.LI -start up and run co-processes -.LI -produce a prompt at the terminal before a read -.LI -easily format and interpret responses to a menu -.LI -echo lines exactly as output without escape processing -.LI -format output using printf formats. -.LI -read and echo lines ending in "\e". -.LE -.LI -Improved performance: KSH-93 executes many scripts faster -than the System V Bourne shell. A major reason for this is -that many of the standard utilities are built-in. -To reduce the time to initiate a command, KSH-93 allows -commands to be added as built-ins at run time -on systems that support dynamic loading such as System V Release 4. -.LI -Arithmetic: KSH-93 allows you to do integer arithmetic in any -base from two to sixty-four. You can also do double -precision floating point arithmetic. -Almost the complete set of C language operators are available -with the same syntax and precedence. -Arithmetic expressions can be used to as an argument expansion -or as a separate command. -In addition there is an arithmetic for command that works -like the for statement in C. -.LI -Arrays: KSH-93 supports both indexed and associative arrays. -The subscript for an indexed array is an arithmetic expression, -whereas, the subscript for an associative array is a string. -.LI -Shell Functions and Aliases: Two mechanisms - functions and -aliases - can be used to assign a user-selected identifier to -an existing command or shell script. -Functions allow local variables and provide scoping -for exception handling. -Functions can be searched for and loaded on first reference the -way scripts are. -.LI -Substring Capabilities: KSH-93 allows you to create a -substring of any given string either by specifying the starting -offset and length, or by stripping off leading -or trailing substrings during parameter substitution. -You can also specify attributes, such as upper and lower case, -field width, and justification to shell variables. -.LI -More pattern matching capabilities: KSH-93 allows you to specify -extended regular expressions for file and string matches. -.LI -KSH-93 uses a hierarchal name space for variables. -Compound variables can be defined and variables can -be passed by reference. In addition, each variable -can have one or more disciplines associated with -it to intercept assignments and references. -.LI -Improved debugging: KSH-93 can generate line numbers on execution -traces. Also, I/O redirections are now traced. -There is a DEBUG trap that gets evaluated after each command -so that errors can be localized. -.LI -Job Control: On systems that support job control, including -System V Release 4, KSH-93 -provides a job-control mechanism almost identical to that of -the BSD "csh", version 4.1. -This feature allows you -to stop and restart programs, and to move programs between the -foreground and the background. -.LI -Added security: -KSH-93 can execute scripts which do not have read permission -and scripts which have the setuid and/or setgid set when -invoked by name, rather than as an argument to the shell. -It is possible to log or control the execution of setuid and/or -setgid scripts. -The noclobber option prevents you from accidentally erasing -a file by redirecting to an existing file. -.LI -KSH-93 can be extended by adding built-in commands at run time. -In addition, KSH-93 can be used as a library that can -be embedded into an application to allow scripting. -.LE -Documentation for KSH-93 consists of an "Introduction to KSH-93", -"Compatibility with the Bourne Shell" and a manual page and a -README file. In addition, the "New KornShell Command and Programming -Language," book is available from Prentice Hall. - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/README b/cde/programs/dtksh/ksh93/src/cmd/ksh93/README deleted file mode 100644 index db7f15afd..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/README +++ /dev/null @@ -1,178 +0,0 @@ -/* $XConsortium: README /main/3 1996/07/15 14:14:10 drk $ */ -This directory, and its subdirectories contain the source code -for ksh-93; the language described in the second addition of -the book, "The KornShell Command and Programming Language," by -Morris Bolsky and David Korn which is published by Prentice Hall. -ksh-93 has been compiled and run on several machines with several -operating systems. The end of this file contains a partial list of -operating systems and machines that ksh-93 has been known to run on. - -The layout of files for ksh-93 has changed somewhat since ksh-88, -the last major release. Most of the source code for ksh remains in -the sh directory. However, the shell editing and history routines -are in the edit sub-directory. The code for shell built-ins is -in the bltins directory. The data directory contains read-only -data tables and messages that are used by the shell. The include -files remain in the include directory and the shlib directory -is gone. The feature directory replaces the older install -directory. The method for generating systems specific feature -information has changed substantially. - -The OPTIONS file contains several options that can be set before -compiling ksh. This file is used to generate the FEATURE/options -include file. The OPTIONS are set to their recommended value. -A value of 0 represents off, 1 represents on. -The options have the following defaults and meanings: - ACCT off Shell accounting. - ACCTFILE off Enable per user accounting info - BRACEPAT on C-shell type abc{d,e}f style file generation - CRNL off treated as in shell grammar. - DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.) - ECHOPRINT off Make echo equivalent to print. - ESH on Compile with emacs command line editing. The original - emacs line editor code was provided by Mike Veach at IH. - FS_3D off For use with 3-D file system. Enabled automatically for - sytems with dynamic linking. - JOBS on Job notification, job control if possible. - KIA off Allow generation of shell cross reference database with -I. - MULTIBYTE on Multibyte character handling. Requires mblen() and mbctowc(). - OLDTERMIO off Use either termios or termio at runtime. - P_SUID off If set, all real uids, greater than or equal to this - value will require the -p flag to run suid/sgid scripts. - RAWONLY off Turn on if the vi line mode doesn't work right unless - you do a set -o viraw. - SEVENBIT off Strip the eigth bit from characters. - SPAWN off Use spawn as combined fork/exec. May improve speed. - SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script. - TIMEOUT off Set this to the number of seconds for timing out and - exiting the shell when you don't enter a command. If - non-zero, TMOUT can not be set larger than this value. - VSH on Compile with vi command line editing. The original vi - line editor code was provided by Pat Sullivan at CB. - -The following compile options are set automatically by the feature testing: - DEVFD Set when /dev/fd is a directory that names open files. - SHELLMAGIC - Set on systems that recognize script beginning with #! specially. - VPIX Set on systems the have /usr/bin/vpix program for running MS-DOS. - - -In most instances, you will generate ksh from a higher level directory -which also generates libcmd and libast libraries on which ksh depends. -However, it is possible to generate ksh, with by running make -f ksh.mk -in this directory. The ksh.mk file was generated from the nmake Makefile. -If you do not have make or nmake, but do have a Version 7 UNIX compatible -shell, then you can run the script mamexec < Mamfile to build ksh. -If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk. -In either case, ksh relies on libraries libast and libcmd which must be -built first. The binary for ksh becomes the file named ./ksh which can -be copied to where ever you install it. - -If you use old make or the Mamfile, and you system has dynamic shared -libraries, then you should define the variables mam_cc_static and -mam_cc_dynanamic as the compiler options that request static linking -and dynamic linking respectively. This will decrease the number of -shared libraries that ksh need and cut startup time substantially. - -The makefile should also generate shcomp, a program that will precompile -a script. ksh93 is able to recognize files in this format and process -them as scripts. You can use shcomp to send out scripts when you -don't want to give away the original script source. - -It is advisable that you put the line PWD=$HOME;export PWD into the -/etc/profile file to reduce initialization time for ksh. - -To be able to run setuid/setgid shell scripts, or scripts without read -permission, the SUID_EXEC compile option must be on, and ksh must be installed -in the /bin directory, the /usr/bin directory, the /usr/lbin directory, -or the /usr/local/bin directory and the name must end in sh. The program -suid_exec must be installed in the /etc directory, must be owned by root, -and must be a suid program. If you must install ksh in some other directory -and want to be able to run setuid/setgid and execute only scripts, then -you will have to change the source code file sh/suid_exec.c explicitly. -If you do not have ksh in one of these secure locations, /bin/sh will -be invoked with the -p options and will fail when you execute a setuid/setgid -and/or execute only script. Note, that ksh does not read the .profile -or $ENV file when it the real and effective user/group id's are not -equal. - -The tests sub-directory contains a number of regression tests for ksh. -To run all these tests with the shell you just built, go to the tests -directory and run the command - SHELL=../ksh shtests - -The file PROMO is an advertisement that extolls the virtues of ksh. -The file sh.1 contains the troff (man) description of this Shell. -The file nval.3 contains the troff (man) description of the name-value -pair library that is needed for writing built-ins that need to -access shell variables. - -The file sh.memo contains a draft troff (mm) memo describing ksh. The -file RELEASE contains the changes made in this release since ksh-88. -The file COMPATIBILITY contains a list of incompatibilities with ksh-88. -The file bltins.mm is a draft troff (mm) memo describing how to write -built-in commands that can be loaded at run time. - -Most of the work for internationalization has been done with ksh93. -The file ksh.msg is a generated file that contains error messages -that need to be translated. In addition, the function translate() -in sh/init.c has to be completed to interface with the dictionary -lookup. The translate function takes two argument, the string -that is to be translated and a type which is - 0 when a library string needs translation. - 1 when one of the error messages in ksh.msg needs translation. - 2 when a string in a script needs translation. You use a $ in front - of a double quoted string in a script to indicate that it - needs translation. The -D option for ksh builds the dictionary. -The translate routine needs to return the translated message. -For dictionaries that need to use a numeric key, it should be -possible to use the strhash() function to generate numbers to -go along with each of the messages and to use this number both -when generating the dictionary and when converting strings. -If you encounter error messages of type 1 that are not be translated via -this translate() function send mail to the address below. - -Please report any problems or suggestions to: - -ksh@mozart.att.com - - -ksh93 has been compiled and alpha tested on the following. An asterisk -signifies that ksh has been installed as /bin/sh on this machine. - -* Sun OS 4.1.[123] on sparc[12]. - Sun OS 4.1.1 on sun3. - Solaris 2.[1234] on sparc2. - Solaris 2.4 on Intel 486.. - HP/UX 8.05 on HP-9000/730. - HP/UX 9.01 on HP-9000/730. - HP/UX 9.00 on HP-9000/857. - System V Release 3 on Counterpoint C19 - System V Release 4 on AT&T Intel 486. - System V Release 4 on NCR 4850 Intel 486. - IRIX Release 4.0.? System V on SGI-MIPS. - IRIX Release 5.1 System V on SGI-MIPS. - System V Release 3.2 on 3B2. - UTS 5.2.6 on Amdahl 3090,5990,580. - System V Release 3.2 on i386. - SMP_DC.OSx olivetti dcosx MIServer-S 2/128. - SMP_DC.OSx Pyramid dcosx MIServer-S 2/160 r3000. - 4.3BSD on Vax 8650. - AIX release 2 on RS6000. - AIX 3.2 on RS6000. - Linux 1.1.59 on Intel 486 - OSF1 on DEC alpha. - UMIPS 4.52 on mips. - BSD-i 2.0 on Intel 486. - NeXT on Intel 486. - NeXT on HP. - Windows NT with NutCracker libraries. - Windows NT with Portage libraries. - Windows NT using custom C library. - Windows 3.1 using custom C library. - -Good luck!! - -David Korn -dgk@research.att.com - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE deleted file mode 100644 index 2466e3978..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE +++ /dev/null @@ -1,422 +0,0 @@ -This is a list of changes that have been made since the 11/16/88 version -of ksh. - -1. New features in 12/28/93 - a. Associative arrays. The new version of ksh supports both - associate arrays and the older indexed arrays with the same - array syntax. A new -A option of typeset is used to declare - an array to be associative. As with indexed arrays, $name is - equivalent to ${name[0]}. The prefix operator ! was added - to the parameter expansion syntax to expand to the list of - indices. For example, ${!name[@]} expands to the list of array - indices for variable name. - - b. Several additions have been made to shell arithmetic: - 1. The shell now performs floating point arithmetic. The - typeset options -F and -E have been added for floating - point and scientific notation respectively. - 2. The prefix and postfix ++ and -- operators. - 3. The comma and ?: operators. - 4. The math library functions. - 5. An arithmetic for statement of the form - for ((expr1; expr2; expr3)) - do ... - done - 6. Integer arithmetic extended up to base 64. - - c. Some additions to the macro expansion syntax have been made - to specify substrings and sub-arrays: - 1. ${name:expr} expands to the substring of ${name} starting at - the character position defined by arithmetic expression expr. - 2. ${name:expr1:expr2} expands to the substring of ${name} starting - at expr1 and consisting of at most expr2 characters. - 3. ${name[@]:expr} expands to the values of ${name[@]} starting at - the element defined by arithmetic expression expr. - 4. ${name[@]:expr1:expr2} expands to at most expr2 values of - ${name} starting at expr1. - 5. ${@:expr} expands the positional parameters starting at expr. - 6. ${@:expr1:expr2} expands to at most expr2 positional parameters - starting at expr1. - 7. ${!name} expands to the name of the variable named by name. - It will expand to name unless name is reference variable. - 8. ${!name[sub]} expands to the name of the subscript of the - given variable. If sub is @ or * the list of subscripts - is generated. - 9. ${!prefix*} and ${!prefix@} expand to the list of variable - names beginning with prefix. - 10. The substring operators, # and % can be now be applied - with aggregates (@ or *) and are applied to each. - 11. ${name/pattern/string} expands to the value of name with - the first occurrence of pattern replaced by string. - With aggregates (@ or *) this operation is applied to each. - 12. ${name/#pattern/string} Same as above but the pattern - to be replaced must match at the beginning. - 13. ${name/%pattern/string} Same as above but the pattern - to be replaced must match at the end. - 14. ${name//pattern/string} expands to the value of name with - the each occurrence of pattern replaced by string. - With aggregates (@ or *) this operation is applied to each. - - d. The name space for variables has been extended. The character '.' - can be used at the beginning of a name, and to separate identifiers - within a name. However, to create a name of the form, foo.bar, - the variable foo must exist. The namespace starting with .sh - is reserved for shell implementation variables. Exported - variable cannot contain a '.'. - - e. Compound assignments. The assignment syntax, varname=value, - has been extended to allow assignments of the form - varname=(assignment_list). As elsewhere in the shell - spaces or tabs are optional around the parentheses, and - no space is permitted between the varname and the =. The - assignment_list can be one of the following: - 1. A list of words. In this case each word is expanded as - in a for list and the resulting items become elements - of the indexed array varname. - 2. A list of subscript assignments in the form - [subscript]=value. In this, these elements become - elements of the associative array varname. - 3. A list of assignments; simple or compound. In this - case, each assignment is made to varname.name, where - name is the name of the enclosed assignment. - 4. Assignments in the form of readonly or typeset - statements. In this case each assignment is made as - in 3 above, and the attributes are given to the - corresponding variable. - In case 3 and 4 above, the value of "$varname" after - the above assignment is (assignment_list), where the - assignment_list produced would reproduce all of the - variables under varname.*. - - f. Function names of the form variable.action (called discipline - functions) can be defined where variable is any valid variable - name and action is get, set, or unset. The function variable.get - is invoked each time the variable is referenced. The set - discipline is invoked each time the variable is assigned to. - The unset discipline is invoked when a variable is unset. - The new variables .sh.name, .sh.subscript, and .sh.value are - defined inside the function body. Other shell extensions - may have their own set of discipline functions. - - g. The compound command !, which negates the return value of the - following pipeline, has been added. - - h. On systems that support dynamic loading with dlopen(), it is - now possible to add built-in commands at runtime with the - a builtin command named builtin. - - i. The following builtins have been added: - 1. command name [ ... ] - 2. sleep [decimal-seconds] - 3. builtin [-ds] [-f file] [name...] - 4. getconf name [pathname] - 5. disown [job...] - - j. An addition format for literal strings, $'....' can - be used where ever literal strings are valid. The string - inside the single quotes will be converted using the ANSI-C - escape conventions. Additionally, the escape sequence \E - expands to the escape character (default \033) whenever ANSI-C - escape sequences are recognized. - - k. A typeset -n option has been added which causes the value of a - variable to be treated as a reference to another variable so that - variables can be indirectly named. For example, if $1 contains - the name of a variable, then typeset -n foo=$1 causes the variable - foo to be synonymous with the variable whose name is $1. A builtin - alias, nameref='typeset -n' has been added to aid mnemonics. - Reference names cannot contain a '.'. Whenever that portion of - a variable up to the first '.' matches a reference name, the - reference value is substituted. For example, with nameref foo=.top, - then ${foo.bar} is equivalent to ${.top.bar}. When used as the - index of a for or select loop, each assignment causes a - new name reference to occur. - - l. The KEYBD trap has been added which is triggered when a key - or escape sequence is typed while reading from the keyboard - in an edit mode. This, combined with some new variables - makes it possible to program your key bindings in ksh. - - m. New variables have been added: - 1. FIGNORE defines a set of file names to be ignored in each - directory when performing pathname expansion, replacing - the rule that requires that a leading . be matched explicitly. - 2. Variable sh.edchar contains the value of the keyboard character - that has been entered when processing a KEYBD trap. If the value - is changed as part of the trap action, then the new value replaces - the key or keys that caused the trap. - 3. Variable sh.edcol is set to the character position of the cursor - within the input buffer during a KEYBD trap. - 4. Variable sh.edmode is set to the escape character when in vi - insert mode. - 5. Variable sh.edtext is set to the contents of the input buffer - during a KEYBD trap. - 6. HISTEDIT is checked before FCEDIT. FCEDIT is obsolete. - 7. HISTCMD is the number of the current command in the history - file. - 8. Variable .sh.version is set to the version string for - this shell. - 9. Variable .sh.name is set to the name of the variable - that that was referenced or assigned to when executing a get - or set discipline function. - 10. Variable .sh.subscript is set to the subscript for the variable - that was referenced or assign to when executing a get or - set discipline function. - 11. Variable .sh.value is set to the new value for the variable - that was assigned to when executing the set discipline function. - - n. New invocation and set -o options have been added: - 1. set -o notify (or set -b) causes background completion messages - to be displayed as soon as the job completes. - 2. There is a compile time option named KIA which enables - creation of a relational database for commands, variables - and functions defined and referenced by a script. The - option -I , causes the database to be generated - in . The database format can be queried via - the cql command. - o. ksh93 can read and evaluate pre-compiled scripts generated by - a separate program called shcomp. - p. More work on internationalization has been added: - 1. The decimal point character is processed per locale - 2. A $ can be placed in front of each string to indicate - that the string needs translation but is otherwise ignored. - This means that if a message catalog of all $"..." strings - is generated, then a program such as print $"hello world" - could display "bonjour monde" in the french locale. - q. Backreferences have been added to pattern matching. The sequence - \d, where d is a digit from 1-9, matches the same string as - the d-th previous parenthesis group. Backreferences - can be used within patterns, and within replacement strings - with any of the ${name/...} operators. - -2. Changes made in 12/28/93 - a. The output format of many commands has changed as follows: - 1. System error messages are displayed whenever a failure - is caused by a system call. - 2. The exit status has changed in many cases: - a. USAGE messages cause an exit status of 2. - b. Commands not found cause exit - 127. - c. Command found, but not executable - 126. - d. Terminated because of signal - 256+sig - 3. The output of values from built-ins that contain special - characters are quoted in a manner that then can be re-input. - 4. The trace output puts quotes around the output so that it - can be reused as input. - 5. The output for trap is in a format that can be reinput the - the shell to restore the traps. - 6. kill -l lists the signal names without numbers as - required by the POSIX standard. - - b. The following changes have been made to shell functions: - 1. The semantics of functions declared with name() has changed - to conform with the IEEE-POSIX 1003.2 standard. In particular, - these functions are executed in a dot script environment rather - than a separated function environment so that there are no - local variables and no scoping for traps. - 2. Functions declared as function name, preserve the old ksh - semantics can be also used as the first argument to the dot (.) - command to have them executed in a dot script environment. - - c. The command search rules have changed as follows: - 1. Special built-ins (those with a dagger in front of them) are - executed first. - 2. Functions are executed next. - 3. Other built-ins that do not require an executable version - (for example cd and read) come next. - 4. If the command name contains a slash, the pathname corresponding - to the command name is executed. - 5. If name corresponds to a previously encountered pathname - on the PATH variable, the corresponding command is executed. - 6. If the command name does not contain a slash, then the PATH - variable is used to find an executable by that name. If - the directory that the command is found is also contained in - the FPATH variable, then the command treated as a function. - If the shell has a built-in version of the command corresponding - to this command, then the built-in version of this command - is executed. Otherwise, the shell remembers that pathname - corresponding to this command name and executes this pathname. - 7. If the name is not found on PATH, then the directories in - FPATH are searched. If found, then the command is executed - as a function. - - d. Built-in commands options now conform to the IEEE-POSIX 1003.2 - conventions with some additions. In particular, - name -? - will now print a Usage line for name, except for true, false, - colon, login, newgrp, echo, [, and command. - - e. Tilde expansion is now performed as part of the word expansions. - The effect of this is that if word begins with ~ in ${name op word}, - it will be expanded unless escaped. - - f. Pathname expansion is no longer performed on redirection words - unless the shell is interactive. - - g. Changes to shell and options: - 1. The -n option has been enhanced to produce more warning and - portability messages. - 2. The -C option is equivalent to -o noclobber. Files are - created with O_EXCL when -C is on. - - h. The following changes have been made to [[...]]: - 1. A string by itself is equivalent to -n string. - 2. -e has been added as equivalent to -a. - 3. == has been added as equivalent =. - 4. -a and = are now considered obsolete. - 5. Arithmetic comparisons are now considered obsolete. - - i. kill has been changed as follows: - 1. Signal names can be upper case or lower case. - 2. Numerical arguments to kill -l cause the given signal names to - be displayed. - 3. String arguments to kill -l cause the given signal numbers to - be displayed. - 4. Synopsis changed for getopts conformance. - - j. print has a -f format option which is equivalent to - the IEEE POSIX printf. Both print -f format, and - printf have the following extensions from IEEE POSIX: - 1. Floating point formats are supported. - 2. Size and precision specifications can be *. - 3. The %d option can take an argument after precision to - specify the base that the number will be displayed. - 4. A %q format can be used to output a string quoted so - that it can be re-input to the shell. - 5. A %P format can be used to output the shell pattern which - corresponds to the give extended regular expression. - 6. For numerical fields, the arguments can be arithmetic - expressions which will be evaluated. - 7. The %n format works as described in ANSI-C. - - k. The following changes have been made to fc: - 1. It has been renamed hist. fc is now a predefined alias. - 2. hist uses ${HISTEDIT:-$FCEDIT}. FCEDIT is obsolete. - 3. A new -s option is equivalent to the obsolete -e -. - 4. If the first argument refers to a command earlier than the - first accessible command, it now implies the first accessible - command, so that hist -l 1 lists all accessible history commands. - - l. The dot command (.) has changed as follows: - 1. The argument can be the name of a function declared as - function name. The function will execute without creating a - new scope. - 2. If there are arguments to the given script or function, - the positional parameters are restored to their original - value when . completes. - - m. The read built-in has been changed as follows: - 1. A -A option to read has been added to allow the fields to be - read into an indexed array. - 2. A -t n option has been added which causes read to - timeout after n seconds when reading from a slow device. - 3. A -d char option has been added which causes the read - to terminate at char rather than at new-line. - - n. The trap command has been changed as follows: - 1. Trap names can be either upper case or lower case. - 2. Trap -p cause only the specified trap values to be displayed. - 3. The value of trap in a subshell will be the value in the parent - shell until a call to trap which changes the trap settings has - been made. Thus, savetraps=$(trap) works as required by the - POSIX standard. - - o. The exec command has been extended as follows: - 1. The -c option clears the environment first. - 2. The -a name option sets argv[0] to name for the program. - - p. true and false are built-ins, not aliases to built-ins. - - q. test has been modified to conform to the IEEE-POSIX 1003.2 - standard when there are three or less arguments. - - r. umask -S option displays the mask in a symbolic format. - - s. wait now returns the correct exit status of any previous - background job that has not been waited for, not just - the most recent one. - - t. The whence built-in has an option -a which causes all - uses for the given command name to be reported. - - u. unalias has -a option to clear all the aliases. - - v. The times built-in command has been removed. The time - reserved word, without a command, gives time cumulative - time for the shell and its children. A built-in alias - for times should enable scripts using times to continue - to run. - - w. Command substitution and arithmetic substitution will now be - performed for PS1, ENV, and PS4 evaluation in addition to - parameter expansion. - - x. The SECONDS variable now displays elapsed time in floating - point seconds with 3 places after the decimal point by - default. - - y. The getopts built-in now handles the complete libast optget - functionality. If any errors have occurred with getopts - when it has reached the end of arguments, then the Usage - message will be generated from the option string and the - exit status from getopts will be 2 rather than 1. The - usage message will be stored in the OPTARG variable if - the option string contains a leading colon; otherwise - it will be printed on standard error automatically. - - z. THE ENV file is only processed for interactive shell - invocations. In addition, the -x attributes for - aliases and functions is ignored. - - aa. The built-in edit modes have been changed as follows: - 1. The pathname completion and pathname listing options - now perform command completion and command listing - when applied to a word in the command position. - 2. In emacs mode ^N as the first related command after - the prompt will move to the next command relative to the - last known history position. - 3. In emacs mode, successive kill and delete commands will - accumulate their data in the kill buffer, by appending or - prepending as appropriate. This mode will be reset by any - command not adding something to the kill buffer. - 4. The control-T of emacs mode has been changed to behave like - control-T in gnu-emacs. - bb. The TMOUT variable also sets a limit for select timeouts - and default timeouts for read. - - -4. The source code has undergone significant modification. - a. Much of the code has been rewritten, In many cases this has - resulted in significant performance improvement. - - b. The code is organized differently. See the README files - for more details. - - c. Most configuration parameters now get generated using - the FEATURE mechanism of nmake. Other options are set - in the OPTIONS file. - - c. The are several new compile time options. See the README - file for details. Some of the old ones have been removed. - - d. The install script is a Mamfile that is generated by - nmake and processed by a script that comes with the - distribution. - - e. There are far fewer global names. This should make it - must easier to add built-in commands without worrying - about conflicts. - - f. The code uses the sfio library which makes it possible - to mix with stdio. - - g. The code is written in ANSI C with full prototypes. - The code is based on the IEEE POSIX 1003.1 standard. - The code can be compiled with K&R C and with C++ by - using the ANSI cpp that comes with nmake or running - the code through the proto filter before pre-processing. - This happens automatically with our shipping system. - - h. There is a programming interface for capturing references - and assignment to shell variables. It is also possible - to intercept variable creation and supply the array processing - function for that variable. See nval.3 for a description. diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASEa b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASEa deleted file mode 100644 index 4a5c4710c..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASEa +++ /dev/null @@ -1,214 +0,0 @@ -This is a list of changes that have been made since the 12/28/93 version -of ksh. - -1. New features in 12/28/93[b] - a. If IFS contains two consecutive identical characters belonging - to the [:space:] class, then this character is treated as - a non-space delimiter so that each instance will delimit - a field. For example, IFS=$'\t\t' will cause two consecutive - tabs to delimit a null field. - b. The getopts command has a -a name option that specifies a - name that will be used for usage messages. - -2. Bugs fixed in 12/28/93a for default OPTIONS - a. An expansion bug which causes portions of a word after - a $((...)) expansion that contains a nested $var expansion - to be lost has been fixed. - b. A bug that caused a core dump when a script that did not - have PWD set and did a cd inside command substitution - has been fixed. - c. A bug which caused a core dump on some machines when - the LANG variable was assigned to has been fixed. - d. A bug which incorrectly handled set disciplines that - performed arithmetic evaluation when the discipline - was called from the arithmetic evaluator has been fixed. - e. A bug caused by an EXIT trap inside a function that - was executed in a subshell was fixed. - f. If foo is a function, and not a program, then command foo - now reports that foo isn't found rather than invoking foo. - g. The previous version incorrectly listed -A as an - invocation option. The -A option is only for set. - h. A bug was fixed which caused ksh to loop when execution trace - was enabled and the PS4 prompt required command substitution. - i. A bug which could cause the job control switch character - to be disabled when a script that enabled monitor mode - terminated was fixed. - j. A bug in the macro expansion global replacement operator //, - when the pattern began with a [ or +( has been fixed. - k. A bug which prevented ~ expansion from occurring when - it was terminated with a colon inside an assignment - has been fixed. - l. A bug in the dot command which prevented autoload functions - from working has been fixed. - m. A bug which caused a variable to be unset if the - its value were expanded inside a set discipline has - been fixed. - n. Whence -a now longer reports that a defined function - is undefined. - o. A bug on some systems in which $0 would be incorrect - in scripts invoked by name has been fixed. - p. Here documents with an empty body now work. - 1. A bug which disabled argument passing and resetting - of options for a script invoked by name inside a - function has been fixed. - r. A bug in which an EXIT trap set the caller of a function - would be executed if a command called inside a function - was not found has been fixed. - s. A bug which allowed a script to trap signals that are - ignored at the time that the shell was invoked has - been fixed. - t. A bug which caused 2<&1- when applied to a shell built-in - to leave standard input closed has been fixed. - u. A bug which caused the shell to incorrectly parse - $() command substitutions with nested case statements - has been fixed. - -3. Bugs fixed in 12/28/93b for default OPTIONS - a. A bug which caused unset RANDOM to dump core has been - fixed. - b. A bug which prevented return for terminating a profile - or ENV file has been fixed. - c. A bug which prevented standard input from being - directed to /dev/null for background jobs when - monitor mode was turned off has been fixed. - d. Statements of the form typeset -options var[expr]=value - did not perform substitutions on expr as expected. - e. A bug which prevented the shell from sending a HUP - signal to some background jobs that were not disowned - has been fixed. - f. A bug which allowed a script to trap signals that are - ignored at the time that the shell was invoked by exec - has been fixed. - g. A bug which could cause a core dump when a discipline - function was unset within a discipline was fixed. - h. The typeset builtin now accepts a first argument of - + or - for compatibility with ksh88. - i. For compatibility with ksh88, the results of expansions - of command arguments will treat the extended character - match characters ()|& as ordinary characters. - j. A bug which caused read to fail on a file that was - open for read/write with <> when the first operation - was print or printf has been fixed. - k. When a job is suspended, it is put on the top of - the job list as required by the POSIX standard. - l. The value of OPTARG when an option that required - an argument but didn't have one was incorrect in the - case the the option string began with a :. - m. A bug which caused the terminal to get into a bad - state with some KEYBD traps in vi-mode has been fixed. - n. A bug which caused an invalid trap to cause a script - to terminate, rather than just return an error, has - been fixed. - o. Backreferencing sub-expressions in patterns and replacement - strings now works. - p. A bug in chmod which caused the -R option to fail has - been fixed. - -4. Bugs fixed in 12/28/93c for default OPTIONS - a. The expansion of "$@" was incorrect when $1 was the null - string. - b. A bug which could incorrectly report a syntax error in - a backquoted expression when a $ was preceded by \\ - has been fixed. - c. A bug which prevented the shell from exiting after - reporting an error when failing to open a script - has been fixed. - d. A bug that could lead to memory corruption when a - large here document that required parameter or command - substitution was expanded has been fixed. - e. A bug that could cause a core dump on some systems - after ksh detected an error when reading a function - has been fixed. - f. A bug which could cause a coprocess to hang when - reading from a process that has terminated has been fixed. - g. A bug which caused a script to terminate when set -e - was on and the first command of and && or || list - failed has been fixed. - h. A bug with here documents inside $(...) when the delimiter - word is an identifier has been fixed. - i. A bug which caused $0 to display the wrong value when - a script was invoked as an argument to the . command - and the eval command has been fixed. - j. A bug that could cause the built-in sleep to hang - has been fixed. - k. A bug introduces in 12/28/93b which caused the backslash - to be removed when it was followed by digit inside double - quotes in some instances has been fixed. - l. A bug which could cause a core dump if ksh was invoked with - standard input closed has been fixed. - m. A bug which could cause a core dump if typeset -A was - specified for an existing variable has been fixed. - n. Variables that were unset but had attributes such as readonly - and export were not listed with readonly, export and typeset. - o. Several problems with signals have been fixed. - p. A bug which prevented ulimit -t from working has been fixed. - Also, a bug in which failed ulimits could cause a core dump - has also been fixed. - q. A bug in expansion of the form ${name/#pattern/string} and - ${name/%pattern/string} has been fixed. - r. A bug which caused read -r on a line that contained only - blanks to get a non-null value has been fixed. - s. A bug introduced in the 'a' point release in which - ${x='\\'} expanded to \ when x was unset has been fixed. - t. A bug which prevented a trap on EXIT from being executed - when the last command in a script was a function invocation - has been fixed. - u. A bug which caused an interactive shell ignore input when - standard error was redirected to a file with exec, - and then restored with exec 2>&1 has been fixed. - v. An interactive shell turns on monitor mode even when - standard error has been redirected to a file. - w. A bug which could cause standard input to be incorrectly - positioned for the last command of a script has been fixed. - y. A bug in the edit modes which allowed walking back in - the history file for more than HISTSIZE commands has - beed fixed. - z. A bug which could cause a core dump if variable TMPDIR was - changed between two command substitutions has been fixed. - aa. A bug which prevented a trap on EXIT from being cleared - has been fixed. - -5. Bugs fixed in 12/28/93d for default OPTIONS - a. The \ character was not handled correctly in replacement - patterns with ${x/pattern/replace}. - b. A bug with read in which the line did not end with - a new-line has been fixed. - c. A bug in file name generation which sometimes - appended a . for filenames that ended in / has - been fixed. - d. If a process is waited for after a status has - been returned by a previous wait, wait now - returns 127. - e. A bug with hist (fc) -e which prevented a command - to re-executed after it had been edited has been fixed. - f. A bug which prevented quoting from removint the meaning - of unary test operators has been fixed. - -6. Bug fixes for specific non-default option combinations. - a. More signal names have been added for Solaris - b. A bug fixed for the v directive in vi MULTIBYTE has been - fixed. - c. Code to for IFS handling of multibyte characters has - been added. - d. The displaying of multibyte strings in export, readonly, - typeset, and execution traces has been fixed. - e. A bug with typeahead and KEYBOARD traps with the - MULTIBYTE option set has been fixed. - -7. Other changes to 12/28/93[abcd] - a. A couple of minor changes to make adding built-ins easier. - b. Variables inside functions are now statically scoped. - The previous behavior was never documented. - c. A few changes have been made to the name-value library - that affect built-ins that use disciplines. The - changes allow disciplines to be shared by variables - and should make it possible to add new disciplines - without recompilation. - d. The name-value library interface has undergone significant - change for this revision. See the new nval.3 man page. - e. Builtin functions can take a third argument which is - a void*. - -8. Incompatibilities with 12/28/93 version. - None intentional. - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/alarm.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/alarm.c deleted file mode 100644 index ae102ab24..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/alarm.c +++ /dev/null @@ -1,333 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: alarm.c /main/3 1995/11/01 16:27:14 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include "builtins.h" -#include "FEATURE/time" - -#define R_FLAG 1 -#define L_FLAG 2 - -struct tevent -{ - Namfun_t fun; - Namval_t *node; - Namval_t *action; - struct tevent *next; - long milli; - int flags; - __V_ *timeout; -}; - -static const char ALARM[] = "alarm"; - -static void trap_timeout __PROTO__((__V_*)); - -/* - * insert timeout item on current given list in sorted order - */ -static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){ - struct tevent *tp = (struct tevent*)list; - if(!tp || item->milli < tp->milli) - { - item->next = tp; - list = (__V_*)item; - } - else - { - while(tp->next && item->milli > tp->next->milli) - tp = tp->next; - item->next = tp->next; - tp->next = item; - } - tp = item; - tp->timeout = (__V_*)kshtimeradd(tp->milli,tp->flags&R_FLAG,trap_timeout,(__V_*)tp); - return(list); -} - -/* - * delete timeout item from current given list, delete timer - */ -static __V_ *time_delete __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){ - struct tevent *tp = (struct tevent*)list; - if(item==tp) - list = (__V_*)tp->next; - else - { - while(tp && tp->next != item) - tp = tp->next; - if(tp) - tp->next = item->next; - } - if(item->timeout) - timerdel((__V_*)item->timeout); - return(list); -} - -static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){ - struct tevent *tp = (struct tevent*)list; - while(tp) - { - if(tp->timeout) - { - char *name = nv_name(tp->node); - if(tp->flags&R_FLAG) - { - double d = tp->milli; - sfprintf(sfstdout,e_alrm1,name,d/1000.); - } - else - sfprintf(sfstdout,e_alrm2,name,nv_getnum(tp->node)); - } - tp = tp->next; - } -} - -static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* handle;){ - struct tevent *tp = (struct tevent*)handle; - sh.trapnote |= SH_SIGTRAP; - if(!(tp->flags&R_FLAG)) - tp->timeout = 0; - tp->flags |= L_FLAG; - sh.sigflag[SIGALRM] |= SH_SIGTRAP; - if(sh_isstate(SH_TTYWAIT)) - sh_timetraps(); -} - -void sh_timetraps __PARAM__((void), ()){ - struct tevent *tp, *tpnext; - struct tevent *tptop; - while(1) - { - sh.sigflag[SIGALRM] &= ~SH_SIGTRAP; - tptop= (struct tevent*)sh.st.timetrap; - for(tp=tptop;tp;tp=tpnext) - { - tpnext = tp->next; - if(tp->flags&L_FLAG) - { - tp->flags &= ~L_FLAG; - if(tp->action) - sh_fun(tp->action,tp->node); - tp->flags &= ~L_FLAG; - if(!tp->flags) - { - nv_unset(tp->node); - nv_close(tp->node); - } - } - } - if(!(sh.sigflag[SIGALRM]&SH_SIGTRAP)) - break; - } -} - - -/* - * This trap function catches "alarm" actions only - */ -static char *setdisc __PARAM__((Namval_t *np, const char *event, Namval_t* action, Namfun_t - *fp), (np, event, action, fp)) __OTORP__(Namval_t *np; const char *event; Namval_t* action; Namfun_t - *fp;){ - struct tevent *tp = (struct tevent*)fp; - if(!event) - return(action?"":(char*)ALARM); - if(strcmp(event,ALARM)!=0) - { - /* try the next level */ - return(nv_setdisc(np, event, action, fp)); - } - if(action==np) - action = tp->action; - else - tp->action = action; - return(action?(char*)action:""); -} - -/* - * catch assignments and set alarm traps - */ -static void putval __PARAM__((Namval_t* np, const char* val, int flag, Namfun_t* fp), (np, val, flag, fp)) __OTORP__(Namval_t* np; const char* val; int flag; Namfun_t* fp;){ - struct tevent *tp; - double d; - if(val) - { - double now; -#ifdef _lib_gettimeofday - struct timeval tmp; - gettimeofday(&tmp,NIL(void *)); - now = tmp.tv_sec + 1.e-6*tmp.tv_usec; -#else - now = (double)time(NIL(time_t*)); -#endif /*_lib_gettimeofday */ - nv_putv(np,val,flag,fp); - d = nv_getnum(np); - tp = (struct tevent*)fp; - if(*val=='+') - { - double x = d + now; - nv_putv(np,(char*)&x,NV_INTEGER,fp); - } - else - d -= now; - tp->milli = 1000*(d+.0005); - if(tp->timeout) - sh.st.timetrap = time_delete(tp,sh.st.timetrap); - if(tp->milli > 0) - sh.st.timetrap = time_add(tp,sh.st.timetrap); - } - else - { - tp = (struct tevent*)nv_stack(np, (Namfun_t*)0); - sh.st.timetrap = time_delete(tp,sh.st.timetrap); - if(tp->action) - nv_close(tp->action); - nv_unset(np); - free((__V_*)fp); - } -} - -static const Namdisc_t alarmdisc = -{ - sizeof(struct tevent), - putval, - 0, - 0, - setdisc, -}; - -int b_alarm __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - int n,rflag=0; - Namval_t *np; - struct tevent *tp; - NOT_USED(extra); - while (n = optget(argv, sh_optalarm)) switch (n) - { - case 'r': - rflag = R_FLAG; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argc -= opt_index; - argv += opt_index; - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - if(argc==0) - { - print_alarms(sh.st.timetrap); - return(0); - } - if(argc!=2) - error(ERROR_usage(2),optusage((char*)0)); - np = nv_open(argv[0],sh.var_tree,NV_ARRAY|NV_VARNAME|NV_NOASSIGN); - if(!nv_isnull(np)) - nv_unset(np); - nv_setattr(np, NV_INTEGER|NV_DOUBLE); - if(!(tp = newof(NIL(struct tevent*),struct tevent,1,0))) - error(ERROR_exit(1),e_nospace); - tp->fun.disc = &alarmdisc; - tp->flags = rflag; - tp->node = np; - nv_stack(np,(Namfun_t*)tp); - nv_putval(np, argv[1], 0); - return(0); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cd_pwd.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cd_pwd.c deleted file mode 100644 index da85d2802..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cd_pwd.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: cd_pwd.c /main/3 1995/11/01 16:27:31 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include "variables.h" -#include "path.h" -#include "name.h" -#include "builtins.h" -#include - -int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ - char *dir, *cdpath=""; - const char *dp; - int saverrno=0; - int rval,flag = (sh_isoption(SH_PHYSICAL)!=0); - char *oldpwd; - Namval_t *opwdnod, *pwdnod; - NOT_USED(extra); - if(sh_isoption(SH_RESTRICTED)) - error(ERROR_exit(1),e_restricted+4); - while((rval = optget(argv,sh_optcd))) switch(rval) - { - case 'L': - flag = 0; - break; - case 'P': - flag = 1; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - argc -= opt_index; - dir = argv[0]; - if(error_info.errors>0 || argc >2) - error(ERROR_usage(2),optusage((char*)0)); - oldpwd = (char*)sh.pwd; - opwdnod = (sh.subshell?sh_assignok(OLDPWDNOD,1):OLDPWDNOD); - pwdnod = (sh.subshell?sh_assignok(PWDNOD,1):PWDNOD); - if(argc==2) - dir = sh_substitute(oldpwd,dir,argv[1]); - else if(!dir || *dir==0) - dir = nv_getval(HOME); - else if(*dir == '-' && dir[1]==0) - dir = nv_getval(opwdnod); - if(!dir || *dir==0) - error(ERROR_exit(1),argc==2?e_subst+4:e_direct); - if(*dir != '/') - { - cdpath = nv_getval(nv_scoped(CDPNOD)); - if(!oldpwd) - oldpwd = path_pwd(1); - } - if(!cdpath) - cdpath = ""; - if(*dir=='.') - { - /* test for pathname . ./ .. or ../ */ - if(*(dp=dir+1) == '.') - dp++; - if(*dp==0 || *dp=='/') - cdpath = ""; - } - rval = -1; - do - { - dp = cdpath; - cdpath=path_join(cdpath,dir); - if(*stakptr(PATH_OFFSET)!='/') - { - char *last=(char*)stakfreeze(1); - stakseek(PATH_OFFSET); - stakputs(oldpwd); - stakputc('/'); - stakputs(last+PATH_OFFSET); - stakputc(0); - } - if(!flag) - { - char *cp; - stakseek(PATH_MAX+PATH_OFFSET); -#ifdef SHOPT_FS_3D - if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT))) - continue; - /* eliminate trailing '/' */ - while(*--cp == '/' && cp>stakptr(PATH_OFFSET)) - *cp = 0; -#else - if(*(cp=stakptr(PATH_OFFSET))=='/') - if(!pathcanon(cp,PATH_DOTDOT)) - continue; -#endif /* SHOPT_FS_3D */ - } - if((rval=chdir(path_relative(stakptr(PATH_OFFSET)))) >= 0) - goto success; - if(errno!=ENOENT && saverrno==0) - saverrno=errno; - } - while(cdpath); - if(rval<0 && *dir=='/' && *(path_relative(stakptr(PATH_OFFSET)))!='/') - rval = chdir(dir); - /* use absolute chdir() if relative chdir() fails */ - if(rval<0) - { - if(saverrno) - errno = saverrno; - error(ERROR_system(1),"%s:",dir); - } -success: - if(dir == nv_getval(opwdnod) || argc==2) - dp = dir; /* print out directory for cd - */ - if(flag) - { - dir = stakptr(PATH_OFFSET); - if (!(dir=pathcanon(dir,PATH_PHYSICAL))) - { - dir = stakptr(PATH_OFFSET); - error(ERROR_system(1),"%s:",dir); - } - stakseek(dir-stakptr(0)); - } - dir = (char*)stakfreeze(1)+PATH_OFFSET; - if(*dp && *dp!= ':' && strchr(dir,'/')) - sfputr(sfstdout,dir,'\n'); - if(*dir != '/') - return(0); - nv_putval(opwdnod,oldpwd,NV_RDONLY); - if(oldpwd) - free(oldpwd); - flag = strlen(dir); - /* delete trailing '/' */ - while(--flag>0 && dir[flag]=='/') - dir[flag] = 0; - nv_putval(pwdnod,dir,NV_RDONLY); - nv_onattr(pwdnod,NV_NOFREE|NV_EXPORT); - sh.pwd = pwdnod->nvalue.cp; - return(0); -} - -int b_pwd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ - int n, flag = (sh_isoption(SH_PHYSICAL)!=0); - char *cp; - NOT_USED(extra); - NOT_USED(argc); - while((n = optget(argv,sh_optpwd))) switch(n) - { - case 'L': - flag = 0; - break; - case 'P': - flag = 1; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - if(*(cp = path_pwd(0)) != '/') - error(ERROR_system(1), e_pwd); - if(flag) - { -#ifdef SHOPT_FS_3D - if((flag = mount(e_dot,NIL(char*),FS3D_GET|FS3D_VIEW,0))>=0) - { - cp = (char*)stakseek(++flag+PATH_MAX); - mount(e_dot,cp,FS3D_GET|FS3D_VIEW|FS3D_SIZE(flag),0); - } - else -#endif /* SHOPT_FS_3D */ - cp = strcpy(stakseek(strlen(cp)+PATH_MAX),cp); - pathcanon(cp,PATH_PHYSICAL); - } - sfputr(sfstdout,cp,'\n'); - return(0); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cflow.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cflow.c deleted file mode 100644 index ccbd2da09..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/cflow.c +++ /dev/null @@ -1,169 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: cflow.c /main/3 1995/11/01 16:27:48 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include -#include "shnodes.h" -#include "builtins.h" - -/* - * return and exit - */ -int b_ret_exit __PARAM__((int n, char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[];__V_ *extra;){ - struct checkpt *pp = (struct checkpt*)sh.jmplist; - char *arg; - NOT_USED(extra); - while((n = optget(argv,sh_optcflow))) switch(n) - { - case ':': - if(!strmatch(argv[opt_index],"[+-]+([0-9])")) - error(2, opt_arg); - goto done; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } -done: - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - pp->mode = (**argv=='e'?SH_JMPEXIT:SH_JMPFUN); - argv += opt_index; - n = (((arg= *argv)?atoi(arg):sh.oldexit)&SH_EXITMASK); - /* return outside of function, dotscript and profile is exit */ - if(sh.fn_depth==0 && sh.dot_depth==0 && !sh_isstate(SH_PROFILE)) - pp->mode = SH_JMPEXIT; - sh_exit(n); - return(1); -} - - -/* - * break and continue - */ -int b_brk_cont __PARAM__((int n, char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[];__V_ *extra;){ - char *arg; - int cont= **argv=='c'; - NOT_USED(extra); - while((n = optget(argv,sh_optcflow))) switch(n) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - argv += opt_index; - n=1; - if(arg= *argv) - { - n = strtol(arg,&arg,10); - if(n<=0 || *arg) - error(ERROR_exit(1),e_nolabels,*argv); - } - if(sh.st.loopcnt) - { - sh.st.execbrk = sh.st.breakcnt = n; - if(sh.st.breakcnt > sh.st.loopcnt) - sh.st.breakcnt = sh.st.loopcnt; - if(cont) - sh.st.breakcnt = -sh.st.breakcnt; - } - return(0); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getconf.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getconf.c deleted file mode 100644 index 0bf7ddb29..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getconf.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: getconf.c /main/3 1995/11/01 16:28:05 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include -#include -#include -#include -#include "shtable.h" -#include "builtins.h" -#include "FEATURE/externs" - -#define next_config(p) ((Shtable_t*)((char*)(p) + sizeof(*shtab_config))) -#define MIN_LEN 20 - -int b_getconf __PARAM__((int argc, char *argv[]), (argc, argv)) __OTORP__(int argc; char *argv[];){ - int m,n; - long val; - const char *name, *path=""; - int offset = staktell(); - const Shtable_t *tp = shtab_config; - error_info.id = argv[0]; - while (n = optget(argv, sh_optgetconf)) switch (n) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - argc -= opt_index; - if(argc >2) - error(ERROR_usage(2),optusage((char*)0)); - while(1) - { - if(argc) - { - name = *argv; - n = sh_lookup(name,shtab_config); - } - else - { - name = tp->sh_name; - n = tp->sh_number; - if(*name==0) - break; - } - m = n>>2; - errno = 0; - val = -1; - switch(n&03) - { - case 0: - if(m==0) - errno = EINVAL; - break; - case 1: -#ifdef _lib_confstr - stakseek(offset+MIN_LEN); - if((n=confstr(m,stakptr(offset),MIN_LEN)) > MIN_LEN) - { - stakseek(offset+n); - confstr(m,stakptr(offset),n); - } -#else - if(strcmp(name,"PATH")) - errno = EINVAL; - else - stakputs(e_defpath); -#endif /* _lib_confstr */ - val = 0; - break; - case 2: - val = sysconf(m); - break; - case 3: - if(argc==0) - path = "/"; - else if(argc!=2) - error(ERROR_exit(1),e_needspath,name); - else - path=argv[1]; - val = pathconf(path,m); - break; - } - if(errno) - error(ERROR_system(0),e_badconf,name,path); - path= ""; - if(argc==0) - sfputr(sfstdout,name,'='); - if(val==-1) - sfputr(sfstdout,"undefined",'\n'); - else if((n&03)==1) - sfputr(sfstdout,stakptr(offset),'\n'); - else - sfprintf(sfstdout,"%ld\n",val); - if(argc) - break; - tp= next_config(tp); - val = -1; - } - stakseek(offset); - return(error_info.errors); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getopts.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getopts.c deleted file mode 100644 index c6abdbccd..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/getopts.c +++ /dev/null @@ -1,200 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: getopts.c /main/3 1995/11/01 16:28:23 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include "variables.h" -#include -#include -#include "builtins.h" - -int b_getopts __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - char *options=error_info.context->id; - Namval_t *np; - int flag, mode, r=0; - static char value[2], key[2]; - NOT_USED(extra); - while((flag = optget(argv,sh_optgetopts))) switch(flag) - { - case 'a': - options = opt_arg; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - argc -= opt_index; - if(error_info.errors || argc<2) - error(ERROR_usage(2),optusage((char*)0)); - error_info.context->flags |= ERROR_SILENT; - error_info.id = options; - options = argv[0]; - np = nv_open(argv[1],sh.var_tree,NV_NOASSIGN|NV_VARNAME); - if(argc>2) - { - argv +=1; - argc -=1; - } - else - { - argv = sh.st.dolv; - argc = sh.st.dolc; - } - opt_index = sh.st.optindex; - opt_char = sh.st.optchar; - if(mode= (*options==':')) - options++; - switch(opt_index<=argc?(opt_num= LONG_MIN,flag=optget(argv,options)):0) - { - case '?': - error(ERROR_usage(0),opt_arg); - r = 2; - *(options = value) = flag; - break; - case ':': - key[0] = opt_option[1]; - if(strmatch(opt_arg,"*unknown*")) - flag = '?'; - if(mode) - opt_arg = key; - else - { - error(2, opt_arg); - opt_arg = 0; - flag = '?'; - } - *(options = value) = flag; - sh.st.opterror = 1; - break; - case 0: - if(sh.st.opterror) - { - char *com[2]; - com[0] = "-?"; - com[1] = 0; - flag = opt_index; - opt_index = 0; - optget(com,options); - opt_index = flag; - if(!mode && strchr(options,' ')) - error(ERROR_usage(0),optusage((char*)0)); - } - opt_arg = 0; - options = value; - *options = '?'; - r=1; - opt_char = 0; - break; - default: - options = opt_option + (*opt_option!='+'); - } - error_info.context->flags &= ~ERROR_SILENT; - sh.st.optindex = opt_index; - sh.st.optchar = opt_char; - nv_putval(np, options, 0); - nv_close(np); - np = nv_search((char*)OPTARGNOD,sh.var_tree,NV_ADD|HASH_BUCKET|HASH_NOSCOPE); - if(opt_num != LONG_MIN) - { - double d = opt_num; - nv_putval(np, (char*)&d, NV_INTEGER|NV_RDONLY); - } - else - nv_putval(np, opt_arg, NV_RDONLY); - return(r); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/hist.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/hist.c deleted file mode 100644 index 35001f200..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/hist.c +++ /dev/null @@ -1,324 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: hist.c /main/3 1995/11/01 16:28:36 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include -#include -#include "variables.h" -#include "io.h" -#include "name.h" -#include "history.h" -#include "builtins.h" - -static void hist_subst __PROTO__((const char*, int fd, char*)); - -int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - History_t *hp; - char *arg; - int flag,fdo; - struct stat statb; - time_t before; - Sfio_t *outfile; - char *fname; - int range[2], incr, index2, indx= -1; - char *edit = 0; /* name of editor */ - char *replace = 0; /* replace old=new */ - int lflag = 0, nflag = 0, rflag = 0; - Histloc_t location; - NOT_USED(argc); - NOT_USED(extra); - if(!sh_histinit()) - error(ERROR_system(1),e_histopen); - hp = sh.hist_ptr; - while((flag = optget(argv,sh_opthist))) switch(flag) - { - case 'e': - edit = opt_arg; - break; - case 'n': - nflag++; - break; - case 'l': - lflag++; - break; - case 'r': - rflag++; - break; - case 's': - edit = "-"; - break; - case 'N': - if(indx<=0) - { - if((flag = hist_max(hp) - opt_num-1) < 0) - flag = 1; - range[++indx] = flag; - break; - } - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - argv += (opt_index-1); - flag = indx; - while(flag<1 && (arg=argv[1])) - { - /* look for old=new argument */ - if(!replace && strchr(arg+1,'=')) - { - replace = arg; - argv++; - continue; - } - else if(isdigit(*arg) || *arg == '-') - { - /* see if completely numeric */ - do arg++; - while(isdigit(*arg)); - if(*arg==0) - { - arg = argv[1]; - range[++flag] = atoi(arg); - if(*arg == '-') - range[flag] += (hist_max(hp)-1); - argv++; - continue; - } - } - /* search for last line starting with string */ - location = hist_find(hp,argv[1],hist_max(hp)-1,0,-1); - if((range[++flag] = location.hist_command) < 0) - error(ERROR_exit(1),e_found,argv[1]); - argv++; - } - if(flag <0) - { - /* set default starting range */ - if(lflag) - { - flag = hist_max(hp)-17; - if(flag<1) - flag = 1; - } - else - flag = hist_max(hp)-2; - range[0] = flag; - flag = 0; - } - index2 = hist_min(hp); - if(range[0]=(flag=(hist_max(hp) - 1))) - range[1] = flag; - /* check for valid ranges */ - if(range[1]=flag) - error(ERROR_exit(1),e_badrange,range[0],range[1]); - if(edit && *edit=='-' && range[0]!=range[1]) - error(ERROR_exit(1),e_eneedsarg); - /* now list commands from range[rflag] to range[1-rflag] */ - incr = 1; - flag = rflag>0; - if(range[1-flag] < range[flag]) - incr = -1; - if(lflag) - { - outfile = sfstdout; - arg = "\n\t"; - } - else - { - if(!(fname=pathtemp(NIL(char*),0,0))) - error(ERROR_exit(1),e_create,""); - if((fdo=open(fname,O_CREAT|O_RDWR,S_IRUSR|S_IWUSR)) < 0) - error(ERROR_system(1),e_create,fname); - outfile= sfnew(NIL(Sfio_t*),sh.outbuff,IOBSIZE,fdo,SF_WRITE); - arg = "\n"; - nflag++; - } - while(1) - { - if(nflag==0) - sfprintf(outfile,"%d\t",range[flag]); - else if(lflag) - sfputc(outfile,'\t'); - hist_list(sh.hist_ptr,outfile,hist_tell(sh.hist_ptr,range[flag]),0,arg); - if(lflag) - sh_sigcheck(); - if(range[flag] == range[1-flag]) - break; - range[flag] += incr; - } - if(lflag) - return(0); - if(fstat(sffileno(outfile),&statb)>=0) - before = statb.st_mtime; - sfclose(outfile); - hist_eof(hp); - arg = edit; - if(!arg && !(arg=nv_getval(nv_scoped(HISTEDIT))) && !(arg=nv_getval(nv_scoped(FCEDNOD)))) - arg = (char*)e_defedit; - - if(*arg != '-') - { - char *com[3]; - com[0] = arg; - com[1] = fname; - com[2] = 0; - error_info.errors = sh_eval(sh_sfeval(com),0); - } - fdo = sh_chkopen(fname); - unlink(fname); - free((__V_*)fname); - - /* don't history fc itself unless forked */ - error_info.flags |= ERROR_SILENT; - if(!sh_isstate(SH_FORKED)) - hist_cancel(hp); - sh_onstate(SH_VERBOSE|SH_HISTORY); /* echo lines as read */ - if(replace) - hist_subst(error_info.id,fdo,replace); - else if(error_info.errors == 0) - { - char buff[IOBSIZE+1]; - Sfio_t *iop = sfnew(NIL(Sfio_t*),buff,IOBSIZE,fdo,SF_READ); - /* read in and run the command */ - sh_eval(iop,1); - } - else - { - sh_close(fdo); - if(!sh_isoption(SH_VERBOSE)) - sh_offstate(SH_VERBOSE|SH_HISTORY); - } - return(sh.exitval); -} - - -/* - * given a file containing a command and a string of the form old=new, - * execute the command with the string old replaced by new - */ - -static void hist_subst __PARAM__((const char *command,int fd,char *replace), (command, fd, replace)) __OTORP__(const char *command;int fd;char *replace;){ - char *newp=replace; - char *sp; - int c; - off_t size; - char *string; - while(*++newp != '='); /* skip to '=' */ - if((size = lseek(fd,(off_t)0,SEEK_END)) < 0) - return; - lseek(fd,(off_t)0,SEEK_SET); - c = (int)size; - string = stakalloc(c+1); - if(read(fd,string,c)!=c) - return; - string[c] = 0; - *newp++ = 0; - if((sp=sh_substitute(string,replace,newp))==0) - error(ERROR_exit(1),e_subst,command); - *(newp-1) = '='; - sh_eval(sfopen(NIL(Sfio_t*),sp,"s"),1); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/misc.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/misc.c deleted file mode 100644 index 56731d0e0..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/misc.c +++ /dev/null @@ -1,561 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: misc.c /main/3 1995/11/01 16:28:50 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include "variables.h" -#include "shnodes.h" -#include "path.h" -#include "io.h" -#include "name.h" -#include "history.h" -#include "builtins.h" -#include "jobs.h" - -#define DOTMAX 32 /* maximum level of . nesting */ - -static int clear; -static void noexport __PROTO__((Namval_t*)); -static char *arg0; - -int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - int n; - sh.st.ioset = 0; - clear = 0; - NOT_USED(extra); - while (n = optget(argv, sh_optexec)) switch (n) - { - case 'a': - arg0 = opt_arg; - argc = 0; - break; - case 'c': - clear=1; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - argv += opt_index; - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - if(*argv) - b_login(argc,argv,0); - return(0); -} - -static void noexport __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){ - nv_offattr(np,NV_EXPORT); -} - -int b_login __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - const char *pname; - struct checkpt *pp = (struct checkpt*)sh.jmplist; - NOT_USED(extra); - if(sh_isoption(SH_RESTRICTED)) - error(ERROR_exit(1),e_restricted,argv[0]); - else - { - struct argnod *arg=sh.envlist; - Namval_t* np; - char *cp; - if(sh.subshell) - sh_subfork(); - if(clear) - nv_scan(sh.var_tree,noexport,NV_EXPORT,NV_EXPORT); - while(arg) - { - if((cp=strchr(arg->argval,'=')) && - (*cp=0,np=nv_search(arg->argval,sh.var_tree,0))) - nv_onattr(np,NV_EXPORT); - if(cp) - *cp = '='; - arg=arg->argnxt.ap; - } - pname = argv[0]; - if(argc==0) - argv[0] = arg0; -#ifdef JOBS - if(job_close() < 0) - return(1); -#endif /* JOBS */ - /* force bad exec to terminate shell */ - pp->mode = SH_JMPEXIT; - sh_sigreset(2); - sh_freeup(); - path_exec(pname,argv,NIL(struct argnod*)); - sh_done(0); - } - return(1); -} - -int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - int r; - char *arg; - NOT_USED(argc); - NOT_USED(extra); - while (r = optget(argv,sh_optlet)) switch (r) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors || !*argv) - error(ERROR_usage(2),optusage((char*)0)); - while(arg= *argv++) - r = !sh_arith(arg); - return(r); -} - -int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - int r; - NOT_USED(argc); - NOT_USED(extra); - while (r = optget(argv,sh_opteval)) switch (r) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - argv += opt_index; - if(*argv && **argv) - { - sh_offstate(SH_MONITOR); - sh_eval(sh_sfeval(argv),0); - } - return(sh.exitval); -} - -int b_dot_cmd __PARAM__((int n,char *argv[],__V_* extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_* extra;){ - char *script; - Namval_t *np; - int jmpval; - int fd; - struct dolnod *argsave=0, *saveargfor; - char **saveargv; - struct checkpt buff; - Sfio_t *iop=0; - NOT_USED(extra); - while (n = optget(argv,sh_optdot)) switch (n) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - argv += opt_index; - script = *argv; - if(error_info.errors || !script) - error(ERROR_usage(2),optusage((char*)0)); - if(!(np=sh.posix_fun)) - { - /* check for KornShell style function first */ - np = nv_search(script,sh.fun_tree,0); - if(np && is_afunction(np) && !nv_isattr(np,NV_FPOSIX)) - { - if(!np->nvalue.ip) - { - path_search(script,NIL(char*),0); - if(np->nvalue.ip) - { - if(nv_isattr(np,NV_FPOSIX)) - np = 0; - } - else - error(ERROR_exit(1),e_found,script); - } - } - else - np = 0; - if(!np && (fd=path_open(script,path_get(script))) < 0) - error(ERROR_system(1),e_open,script); - } - sh.posix_fun = 0; - if(sh.dot_depth++ > DOTMAX) - error(ERROR_exit(1),e_toodeep,script); - if(np || argv[1]) - { - n = sh.st.dolc; - saveargv = sh.st.dolv; - argsave = sh_argnew(argv,&saveargfor); - } - sh_pushcontext(&buff,SH_JMPDOT); - jmpval = sigsetjmp(buff.buff,0); - if(jmpval == 0) - { - if(np) - sh_exec((union anynode*)(nv_funtree(np)),sh_isstate(SH_ERREXIT)); - else - { - char buff[IOBSIZE+1]; - iop = sfnew(NIL(Sfio_t*),buff,IOBSIZE,fd,SF_READ); - sh_eval(iop,0); - } - } - sh_popcontext(&buff); - sh.dot_depth--; - if((np || argv[1]) && jmpval!=SH_JMPSCRIPT) - { - sh_argreset(argsave,saveargfor); - sh.st.dolc = n; - sh.st.dolv = saveargv; - } - if(sh.exitval > SH_EXITSIG) - sh_fault(sh.exitval&SH_EXITMASK); - if(jmpval && jmpval!=SH_JMPFUN) - siglongjmp(*sh.jmplist,jmpval); - return(sh.exitval); -} - -/* - * null, true command - */ -int b_true __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - NOT_USED(argc); - NOT_USED(argv[0]); - NOT_USED(extra); - return(0); -} - -/* - * false command - */ -int b_false __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - NOT_USED(argc); - NOT_USED(argv[0]); - NOT_USED(extra); - return(1); -} - -int b_shift __PARAM__((int n, char *argv[], __V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[]; __V_ *extra;){ - char *arg; - NOT_USED(extra); - while((n = optget(argv,sh_optcflow))) switch(n) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - argv += opt_index; - n = ((arg= *argv)?(int)sh_arith(arg):1); - if(n<0 || sh.st.dolc1) - error(ERROR_usage(2),optusage((char*)0)); - if(arg = argv[0]) - { - if(!astconf("_AST_UNIVERSE",0,arg)) - error(ERROR_exit(1), e_badname,arg); - } - else - { - if(!(arg=astconf("_AST_UNIVERSE",0,0))) - error(ERROR_exit(1),e_nouniverse); - else - sfputr(sfstdout,arg,'\n'); - } - return(0); -} -#endif /* cmd_universe */ - -#ifdef SHOPT_FS_3D - int b_vpath_map __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - int flag, n; - const char *optstr; - char *vend; - NOT_USED(extra); - if(argv[0][1]=='p') - { - optstr = sh_optvpath; - flag = FS3D_VIEW; - } - else - { - optstr = sh_optvmap; - flag = FS3D_VERSION; - } - while(n = optget(argv, optstr)) switch(n) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - argv += opt_index; - argc -= opt_index; - switch(argc) - { - case 0: - case 1: - flag |= FS3D_GET; - if((n = mount(*argv,(char*)0,flag,0)) >= 0) - { - vend = stakalloc(++n); - n = mount(*argv,vend,flag|FS3D_SIZE(n),0); - } - if(n < 0) - goto failed; - if(argc==1) - { - sfprintf(sfstdout,"%s\n",vend); - break; - } - n = 0; - while(flag = *vend++) - { - if(flag==' ') - { - flag = e_sptbnl[n+1]; - n = !n; - } - sfputc(sfstdout,flag); - } - if(n) - sfputc(sfstdout,'\n'); - break; - default: - if((argc&1)) - error(ERROR_usage(2),optusage((char*)0)); - /*FALLTHROUGH*/ - case 2: - if(!sh.lim.fs3d) - goto failed; - if(sh.subshell) - sh_subfork(); - for(n=0;n1) - error(ERROR_exit(1),e_cantset,flag==2?e_mapping:e_versions); - else - error(ERROR_exit(1),e_cantget,flag==2?e_mapping:e_versions); - return(1); - } -#endif /* SHOPT_FS_3D */ - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/print.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/print.c deleted file mode 100644 index 7c9b637e1..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/print.c +++ /dev/null @@ -1,630 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: print.c /main/3 1995/11/01 16:29:05 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include "io.h" -#include "name.h" -#include "history.h" -#include "builtins.h" - -union types_t -{ - unsigned char c; - int i; - long l; - double d; - float f; - char *s; - int *ip; - char **p; -}; - -static int getarg __PROTO__((int, union types_t *)); -static int extend __PROTO__((char*, int, int, char**)); -static char *genformat __PROTO__((char*)); -static int fmtvecho __PROTO__((const char*)); -#define fmtre(x) (x) - -static char bsd_univ,cescape, raw, echon; -static char **nextarg; -static const char *options; -static const char preformat[] = "%&%@"; - -/* - * Need to handle write failures to avoid locking output pool - */ -static int outexceptf __PARAM__((Sfio_t* iop, int mode, Sfdisc_t* dp), (iop, mode, dp)) __OTORP__(Sfio_t* iop; int mode; Sfdisc_t* dp;){ - if(mode==SF_DPOP || mode==SF_CLOSE) - free((__V_*)dp); - else if(mode==SF_WRITE) - { - int save = errno; - sfpurge(iop); - sfpool(iop,NIL(Sfio_t*),SF_WRITE); - errno = save; - error(ERROR_system(1),e_badwrite,sffileno(iop)); - } - return(0); -} - -#ifndef SHOPT_ECHOPRINT - int b_echo __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ - options = sh_optecho+5; - raw = echon = 0; - NOT_USED(argc); - NOT_USED(extra); - /* This mess is because /bin/echo on BSD is different */ - if(!sh.universe) - { - char *universe; - if(universe=astconf("_AST_UNIVERSE",0,0)) - bsd_univ = (strcmp(universe,"ucb")==0); - sh.universe = 1; - } - if(!bsd_univ) - return(b_print(0,argv,0)); - options = sh_optecho; - raw = 1; - if(argv[1] && strcmp(argv[1],"-n")==0) - echon = 1; - return(b_print(0,argv+echon,0)); - } -#endif /* SHOPT_ECHOPRINT */ - -int b_printf __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ - NOT_USED(argc); - NOT_USED(extra); - options = sh_optprintf; - return(b_print(-1,argv,0)); -} - -/* - * argc==0 when called from echo - * argc==-1 when called from printf - */ - -int b_print __PARAM__((int argc, char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[]; __V_ *extra;){ - Sfio_t *outfile; - int n, fd = 1; - const char *msg = e_file+4; - char *format = 0; - int sflag = 0, nflag, rflag; - NOT_USED(extra); - if(argc>0) - { - options = sh_optprint; - nflag = rflag = 0; - format = 0; - } - else if(argc==0) - { - nflag = echon; - rflag = raw; - argv++; - goto skip; - } - while((n = optget(argv,options))) switch(n) - { - case 'n': - nflag++; - break; - case 'p': - fd = sh.coutpipe; - msg = e_query; - break; - case 'f': - format = opt_arg; - break; - case 's': - /* print to history file */ - if(!sh_histinit()) - error(ERROR_system(1),e_history); - fd = sffileno(sh.hist_ptr->histfp); - sh_onstate(SH_HISTORY); - sflag++; - break; - case 'e': - rflag = 0; - break; - case 'r': - rflag = 1; - break; - case 'u': - fd = (int)strtol(opt_arg,&opt_arg,10); - if(*opt_arg) - fd = -1; - else if(fd<0 || fd >= sh.lim.open_max) - fd = -1; - else if(sh_inuse(fd) || (sh.hist_ptr && fd==sffileno(sh.hist_ptr->histfp))) - fd = -1; - break; - case ':': - /* The followin is for backward compatibility */ - if(strcmp(opt_option,"-R")==0) - { - rflag = 1; - if(error_info.errors==0) - { - argv += opt_index+1; - /* special case test for -Rn */ - if(strchr(argv[-1],'n')) - nflag++; - if(*argv && strcmp(*argv,"-n")==0) - { - - nflag++; - argv++; - } - goto skip2; - } - } - else - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors || (argc<0 && !(format = *argv++))) - error(ERROR_usage(2),optusage((char*)0)); -skip: - if(format) - format = genformat(format); - /* handle special case of '-' operand for print */ - if(argc>0 && *argv && strcmp(*argv,"-")==0 && strcmp(argv[-1],"--")) - argv++; -skip2: - if(fd < 0) - { - errno = EBADF; - n = 0; - } - else if(!(n=sh.fdstatus[fd])) - n = sh_iocheckfd(fd); - if(!(n&IOWRITE)) - { - /* don't print error message for stdout for compatibility */ - if(fd==1) - return(1); - error(ERROR_system(1),msg); - } - if(!(outfile=sh.sftable[fd])) - { - Sfdisc_t *dp; - sh_onstate(SH_NOTRACK); - n = SF_WRITE|((n&IOREAD)?SF_READ:0); - sh.sftable[fd] = outfile = sfnew(NIL(Sfio_t*),sh.outbuff,IOBSIZE,fd,n); - sh_offstate(SH_NOTRACK); - sfpool(outfile,sh.outpool,SF_WRITE); - if(dp = new_of(Sfdisc_t,0)) - { - dp->exceptf = outexceptf; - dp->seekf = 0; - dp->writef = 0; - dp->readf = 0; - sfdisc(outfile,dp); - } - } - cescape = 0; - /* turn off share to guarantee atomic writes for printf */ - n = sfset(outfile,SF_SHARE|SF_PUBLIC,0); - if(format) - { - /* printf style print */ - Sfio_t *pool; - sh_offstate(SH_STOPOK); - pool=sfpool(sfstderr,NIL(Sfio_t*),SF_WRITE); - nextarg = argv; - do - { - if(sh.trapnote&SH_SIGSET) - break; - sfprintf(outfile,format,extend,getarg); - } - while(*nextarg && nextarg!=argv); - sfpool(sfstderr,pool,SF_WRITE); - } - else - { - /* echo style print */ - if(sh_echolist(outfile,rflag,argv) && !nflag) - sfputc(outfile,'\n'); - } - if(sflag) - { - hist_flush(sh.hist_ptr); - sh_offstate(SH_HISTORY); - } - else if(n&SF_SHARE) - { - sfset(outfile,SF_SHARE|SF_PUBLIC,1); - sfsync(outfile); - } - return(0); -} - -/* - * echo the argument list onto - * if is non-zero then \ is not a special character. - * returns 0 for \c otherwise 1. - */ - -int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, raw, argv)) __OTORP__(Sfio_t *outfile; int raw; char *argv[];){ - char *cp; - int n; - while(!cescape && (cp= *argv++)) - { - if(!raw && (n=fmtvecho(cp))>=0) - { - if(n) - sfwrite(outfile,stakptr(staktell()),n); - } - else - sfputr(outfile,cp,-1); - if(*argv) - sfputc(outfile,' '); - sh_sigcheck(); - } - return(!cescape); -} - - -static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *format;){ - char *fp; - stakseek(0); - stakputs(preformat); - stakputs(format); - fp = (char*)stakfreeze(1); - stresc(fp+sizeof(preformat)-1); - return(fp); -} - -static int getarg __PARAM__((int format,union types_t *value), (format, value)) __OTORP__(int format;union types_t *value;){ - char *argp = *nextarg; - char *lastchar = ""; - int neg = 0; - if(!argp) - { - switch(format) - { - case 'c': - value->c = 0; - break; - case 's': - case 'q': - case 'P': - case 'R': - case 'b': - value->s = ""; - break; - case 'f': - value->f = 0.; - break; - case 'F': - value->d = 0.; - break; - case 'n': - { - static int intvar; - value->ip = &intvar; - break; - } - default: - value->l = 0; - } - return(0); - } - switch(format) - { - case 'p': - value->p = (char**)strtol(argp,&lastchar,10); - break; - case 'n': - { - Namval_t *np; - np = nv_open(argp,sh.var_tree,NV_VARNAME|NV_NOASSIGN|NV_ARRAY); - nv_unset(np); - nv_onattr(np,NV_INTEGER); - np->nvalue.lp = new_of(long,0); - nv_setsize(np,10); - if(sizeof(int)==sizeof(long)) - value->ip = (int*)np->nvalue.lp; - else - { - struct temp { int hi; int low; } *sp = (struct temp*)(np->nvalue.lp); - sp->hi = 0; - sp->low = 1; - if(*np->nvalue.lp==1) - value->ip = &sp->low; - else - value->ip = &sp->hi; - } - nv_close(np); - break; - } - case 'q': - case 'b': - case 's': - case 'P': - case 'R': - value->s = argp; - break; - case 'c': - value->c = *argp; - break; - case 'u': - case 'U': - case 'd': - case 'D': - switch(*argp) - { - case '\'': case '"': - value->l = argp[1]; - break; - default: - value->l = (long)sh_strnum(argp,&lastchar); - if(lastchar == *nextarg) - { - value->l = *argp; - lastchar = ""; - } - } - if(neg) - value->l = -value->l; - if(sizeof(int)!=sizeof(long) && format=='d') - value->i = (int)value->l; - break; - case 'f': - case 'F': - value->d = sh_strnum(*nextarg,&lastchar); - if(sizeof(float)!=sizeof(double) && format=='f') - value->f = (float)value->d; - break; - default: - value->l = 0; - error(ERROR_exit(1),e_formspec,format); - } - if(*lastchar) - error(ERROR_exit(1),e_argtype,format); - nextarg++; - return(0); -} - -/* - * This routine adds new % escape sequences to printf - */ -static int extend __PARAM__((char *invalue,int format,int precis,char **outval), (invalue, format, precis, outval)) __OTORP__(char *invalue;int format;int precis;char **outval;){ - int n; - NOT_USED(precis); - switch(format) - { - case 'b': - if((n=fmtvecho(invalue))>=0) - { - *outval = stakptr(staktell()); - return(n); - } - *outval = invalue; - return(strlen(*outval)); - case 'q': - *outval = sh_fmtq(invalue); - return(strlen(*outval)); - case 'P': - *outval = fmtmatch(invalue); - if(*outval==0) - error(ERROR_exit(1),e_badregexp,invalue); - return(strlen(*outval)); - case 'R': - *outval = fmtre(invalue); - if(*outval==0) - error(ERROR_exit(1),e_badregexp,invalue); - return(strlen(*outval)); - default: - *outval = 0; - return(-1); - } -} - -/* - * construct System V echo string out of - * If there are not escape sequences, returns -1 - * Otherwise, puts null terminated result on stack, but doesn't freeze it - * returns lenght of output. - */ - -static int fmtvecho __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ - static char *nullarg; - const char *cp = string, *cpmax; - int c; - int offset = staktell(); - int chlen; - if (MB_CUR_MAX > 1) - { - while (1) - { - if ((chlen = mblen(cp, MB_CUR_MAX)) > 1) - { - /* Skip over multibyte characters */ - cp += chlen; - } - else - { - c = *cp++; - if ((c == '\0') || (c == '\\')) - break; - } - } - } - else - while((c= *cp++) && (c!='\\')); - if(c==0) - return(-1); - c = --cp - string; - if(c>0) - stakwrite((__V_*)string,c); - /* for(; c= *cp; cp++) */ - while(1) - { - if ((MB_CUR_MAX > 1) && ((chlen = mblen(cp, MB_CUR_MAX)) > 1)) - { - /* Skip over multibyte characters */ - int i; - for (i = 0; i < chlen; i++) - { - c = *cp++; - stakputc(c); - } - } - else - { - if ((c = *cp) == '\0') - break; - - if( c=='\\') switch(*++cp) - { - case 'E': - c = '\033'; - break; - case 'a': - c = '\007'; - break; - case 'b': - c = '\b'; - break; - case 'c': - cescape++; - nextarg = &nullarg; - goto done; - case 'f': - c = '\f'; - break; - case 'n': - c = '\n'; - break; - case 'r': - c = '\r'; - break; - case 'v': - c = '\013'; - break; - case 't': - c = '\t'; - break; - case '\\': - c = '\\'; - break; - case '0': - c = 0; - cpmax = cp + 4; - while(++cp='0' && *cp<='7') - { - c <<= 3; - c |= (*cp-'0'); - } - default: - cp--; - } - stakputc(c); - cp++; - } - } -done: - c = staktell()-offset; - stakseek(offset); - return(c); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/read.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/read.c deleted file mode 100644 index caba67fb3..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/read.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: read.c /main/3 1995/11/01 16:29:22 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include -#include -#include -#include "defs.h" -#include "variables.h" -#include "lexstates.h" -#include "io.h" -#include "name.h" -#include "builtins.h" -#include "history.h" -#include "terminal.h" -#include "national.h" - -#define R_FLAG 1 /* raw mode */ -#define S_FLAG 2 /* save in history file */ -#define A_FLAG 4 /* read into array */ -#define D_FLAG 6 /* must be number of bits for all flags */ - -int b_read __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ - char *name; - int r, flags=0, fd=0; - long timeout = 1000*sh.tmout; - int save_prompt; - NOT_USED(argc); - NOT_USED(extra); - while((r = optget(argv,sh_optread))) switch(r) - { - case 'A': - flags |= A_FLAG; - break; - case 't': - timeout = 1000*opt_num; - break; - case 'd': - if(opt_arg && *opt_arg!='\n') - flags |= ((*opt_arg)<< D_FLAG); - break; - case 'p': - if((fd = sh.cpipe[0])<=0) - error(ERROR_exit(1),e_query); - break; - case 'r': - flags |= R_FLAG; - break; - case 's': - /* save in history file */ - flags |= S_FLAG; - break; - case 'u': - fd = (int)opt_num; - if(sh_inuse(fd)) - fd = -1; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - if(!((r=sh.fdstatus[fd])&IOREAD) || !(r&(IOSEEK|IONOSEEK))) - r = sh_iocheckfd(fd); - if(fd<0 || !(r&IOREAD)) - error(ERROR_system(1),e_file+4); - /* look for prompt */ - if((name = *argv) && (name=strchr(name,'?')) && (r&IOTTY)) - { - r = strlen(++name)+1; - if(sh.prompt=(char*)sfreserve(sfstderr,r,1)) - { - memcpy(sh.prompt,name,r); - sfwrite(sfstderr,sh.prompt,r); - } - } - sh.timeout = 0; - save_prompt = sh.nextprompt; - sh.nextprompt = 0; - r=sh_readline(argv,fd,flags,timeout); - sh.nextprompt = save_prompt; - if(r==0 && (r=(sfeof(sh.sftable[fd])||sferror(sh.sftable[fd])))) - { - if(fd == sh.cpipe[0]) - { - sh_pclose(sh.cpipe); - return(1); - } - } - sfclrerr(sh.sftable[fd]); - return(r); -} - -/* - * here for read timeout - */ -static void timedout __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;){ - sfclrlock((Sfio_t*)handle); - sh_exit(1); -} - -/* - * This is the code to read a line and to split it into tokens - * is an array of variable names - * is the file descriptor - * is union of -A, -r, -s, and contains delimiter if not '\n' - * is number of milli-seconds until timeout - */ - -int sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names, fd, flags, timeout)) __OTORP__(char **names; int fd; int flags;long timeout;){ - int c; - unsigned char *cp; - Namval_t *np; - char *name, *val; - Sfio_t *iop; - char *ifs; - unsigned char *cpmax; - char was_escape = 0; - char use_stak = 0; - int rel; - long array_index = 0; - __V_ *timeslot=0; - int delim = '\n'; - int jmpval=0; - struct checkpt buff; - if(!(iop=sh.sftable[fd]) && !(iop=sh_iostream(fd))) - return(1); - if(flags>>D_FLAG) /* delimiter not new-line */ - { - delim = ((unsigned)flags)>>D_FLAG; - if(sh.fdstatus[fd]&IOTTY) - tty_raw(fd,1); - } - /* set up state table based on IFS */ - ifs = nv_getval(np=nv_scoped(IFSNOD)); - if((flags&R_FLAG) && sh.ifstable['\\']==S_ESC) - sh.ifstable['\\'] = 0; - else if(!(flags&R_FLAG) && sh.ifstable['\\']==0) - sh.ifstable['\\'] = S_ESC; - sh.ifstable[delim] = S_NL; - if(delim!='\n') - { - sh.ifstable['\n'] = 0; - nv_putval(np, ifs, NV_RDONLY); - } - sh.ifstable[0] = S_EOF; - if(names && (name = *names)) - { - if(val= strchr(name,'?')) - *val = 0; - np = nv_open(name,sh.var_tree,NV_NOASSIGN|NV_VARNAME); - if(flags&A_FLAG) - { - flags &= ~A_FLAG; - array_index = 1; - nv_unset(np); - nv_putsub(np,NIL(char*),0L); - } - else - name = *++names; - if(val) - *val = '?'; - } - else - { - name = 0; - if(hashscope(sh.var_tree)) - np = nv_search((char*)REPLYNOD,sh.var_tree,HASH_BUCKET); - else - np = REPLYNOD; - } - sfclrerr(iop); - if(timeout) - { - sh_pushcontext(&buff,1); - jmpval = sigsetjmp(buff.buff,0); - if(jmpval) - goto done; - timeslot = (__V_*)kshtimeradd(timeout,0,timedout,(__V_*)iop); - } - if(!(cp = (unsigned char*)sfgetr(iop,delim,0))) - cp = (unsigned char*)sfgetr(iop,delim,-1); - if(timeslot) - timerdel(timeslot); - if(cp) - { - cpmax = cp + sfslen(); - if(*(cpmax-1) != delim) - *(cpmax-1) = delim; - if(flags&S_FLAG) - sfwrite(sh.hist_ptr->histfp,(char*)cp,sfslen()); - c = sh.ifstable[*cp++]; -#ifndef SHOPT_MULTIBYTE - if(!name && (flags&R_FLAG)) /* special case single argument */ - { - /* skip over leading blanks */ - while(c==S_SPACE) - c = sh.ifstable[*cp++]; - /* strip trailing delimiters */ - if(cpmax[-1] == '\n') - cpmax--; - *cpmax =0; - if(cpmax>cp) - { - while((c=sh.ifstable[*--cpmax])==S_DELIM || c==S_SPACE); - cpmax[1] = 0; - } - nv_putval(np,(char*)cp-1,0); - goto done; - } -#endif /* !SHOPT_MULTIBYTE */ - } - else - c = S_NL; - sh.nextprompt = 2; - rel= staktell(); - /* val==0 at the start of a field */ - val = 0; - while(1) - { - switch(c) - { -#ifdef SHOPT_MULTIBYTE - case S_MBYTE: - if(sh_strchr(ifs,(char*)cp-1)>=0) - { - c = mblen((char*)cp-1,MB_CUR_MAX); - cp[-1] = 0; - cp += (c-1); - c = S_DELIM; - } - else - c = 0; - continue; -#endif /*SHOPT_MULTIBYTE */ - case S_ESC: - /* process escape character */ - if((c = sh.ifstable[*cp++]) == S_NL) - was_escape = 1; - else - c = 0; - if(val) - { - stakputs(val); - use_stak = 1; - was_escape = 1; - *val = 0; - } - continue; - - case S_EOF: - /* check for end of buffer */ - if(val && *val) - { - stakputs(val); - use_stak = 1; - } - val = 0; - if(cp>=cpmax) - { - c = S_NL; - break; - } - /* eliminate null bytes */ - c = sh.ifstable[*cp++]; - if(!name && val && (c==S_SPACE||c==S_DELIM||c==S_MBYTE)) - c = 0; - continue; - case S_NL: - if(was_escape) - { - was_escape = 0; - if((cp = (unsigned char*)sfgetr(iop,delim,0)) || - (cp = (unsigned char*)sfgetr(iop,delim,-1))) - { - if(flags&S_FLAG) - sfwrite(sh.hist_ptr->histfp,(char*)cp,sfslen()); - cpmax = cp + sfslen(); - c = sh.ifstable[*cp++]; - val=0; - if(!name && (c==S_SPACE || c==S_DELIM || c==S_MBYTE)) - c = 0; - continue; - } - } - c = S_NL; - break; - - case S_SPACE: - /* skip over blanks */ - while(c==S_SPACE) - c = sh.ifstable[*cp++]; - if(!val) - continue; -#ifdef SHOPT_MULTIBYTE - if(c==S_MBYTE) - { - if(sh_strchr(ifs,(char*)cp-1)>=0) - { - c = mblen((char*)cp-1,MB_CUR_MAX); - cp += (c-1); - c = S_DELIM; - } - else - c = 0; - } -#endif /* SHOPT_MULTIBYTE */ - if(c!=S_DELIM) - break; - /* FALL THRU */ - case S_DELIM: - if(name) - { - /* skip over trailing blanks */ - while((c=sh.ifstable[*cp++])==S_SPACE); - break; - } - - case 0: - was_escape = 0; - val = (char*)(cp-1); - /* skip over word characters */ - while(1) - { - while((c=sh.ifstable[*cp++])==0); - if(name || c==S_NL || c==S_ESC || c==S_EOF || c==S_MBYTE) - break; - } - if(c!=S_MBYTE) - cp[-1] = 0; - continue; - } - /* assign value and advance to next variable */ - if(!val) - val = ""; - if(use_stak) - { - stakputs(val); - stakputc(0); - val = stakptr(rel); - } - if(!name && *val) - { - /* strip off trailing delimiters */ - char *cp = val + strlen(val); - int n; - while((n=sh.ifstable[*--cp])==S_DELIM || n==S_SPACE); - cp[1] = 0; - } - nv_putval(np,val,0); - val = 0; - if(use_stak) - { - stakseek(rel); - use_stak = 0; - } - if(array_index) - { - nv_putsub(np, NIL(char*), array_index++); - if(c!=S_NL) - continue; - name = *++names; - } - while(1) - { - if(sh_isoption(SH_ALLEXPORT)&&!strchr(nv_name(np),'.')) - nv_onattr(np,NV_EXPORT); - if(name) - { - nv_close(np); - np = nv_open(name,sh.var_tree,NV_NOASSIGN|NV_VARNAME); - name = *++names; - } - else - np = 0; - if(c!=S_NL) - break; - if(!np) - goto done; - nv_putval(np, "", 0); - } - } -done: - nv_close(np); - if(timeout) - sh_popcontext(&buff); - if((flags>>D_FLAG) && (sh.fdstatus[fd]&IOTTY)) - tty_cooked(fd); - if(flags&S_FLAG) - hist_flush(sh.hist_ptr); - return(jmpval); -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/sleep.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/sleep.c deleted file mode 100644 index 7d0e2c333..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/sleep.c +++ /dev/null @@ -1,234 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: sleep.c /main/3 1995/11/01 16:29:36 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include "builtins.h" -#include "FEATURE/time" -#include "FEATURE/poll" -#ifdef _NEXT_SOURCE -# define sleep _ast_sleep -#endif /* _NEXT_SOURCE */ -#ifdef _lib_poll_notimer -# undef _lib_poll -#endif /* _lib_poll_notimer */ - -int b_sleep __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - char *cp; - double d; - time_t tloc = 0; - NOT_USED(extra); - while((argc = optget(argv,sh_optsleep))) switch(argc) - { - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors || !(cp= *argv) || !(strmatch(cp,e_numeric))) - error(ERROR_usage(2),optusage((char*)0)); - if((d=atof(cp)) > 1.0) - { - sfsync(sh.outpool); - time(&tloc); - tloc += (time_t)(d+.5); - } - while(1) - { - time_t now; - errno = 0; - sh.lastsig=0; - sh_delay(d); - if(tloc==0 || errno!=EINTR || sh.lastsig) - break; - sh_sigcheck(); - if(tloc < (now=time(NIL(time_t*)))) - break; - d = (double)(tloc-now); - if(sh.sigflag[SIGALRM]&SH_SIGTRAP) - sh_timetraps(); - } - return(0); -} - -static char expired; -static void completed __PARAM__((__V_ * handle), (handle)) __OTORP__(__V_ * handle;){ - NOT_USED(handle); - expired = 1; -} - -unsigned sleep __PARAM__((unsigned sec), (sec)) __OTORP__(unsigned sec;){ - pid_t newpid, curpid=getpid(); - __V_ *tp; - expired = 0; - sh.lastsig = 0; - tp = (__V_*)kshtimeradd(1000*sec, 0, completed, (__V_*)0); - do - { - pause(); - if(sh.sigflag[SIGALRM]&SH_SIGTRAP) - sh_timetraps(); - if((newpid=getpid()) != curpid) - { - curpid = newpid; - alarm(1); - } - } - while(!expired && sh.lastsig==0); - if(!expired) - timerdel(tp); - sh_sigcheck(); - return(0); -} - -/* - * delay execution for time - */ - -void sh_delay __PARAM__((double t), (t)) __OTORP__(double t;){ - int n = (int)t; -#ifdef _lib_poll - struct pollfd fd; - if(t<=0) - return; - else if(n > 30) - { - sleep(n); - t -= n; - } - if(n=(int)(1000*t)) - poll(&fd,0,n); -#else -# if defined(_lib_select) && defined(_mem_tv_usec_timeval) - struct timeval timeloc; - if(t<=0) - return; - timeloc.tv_sec = n; - timeloc.tv_usec = 1000000*(t-(double)n); - select(0,(fd_set*)0,(fd_set*)0,(fd_set*)0,&timeloc); -# else -# ifdef _lib_select - /* for 9th edition machines */ - if(t<=0) - return; - if(n > 30) - { - sleep(n); - t -= n; - } - if(n=(int)(1000*t)) - select(0,(fd_set*)0,(fd_set*)0,n); -# else - struct tms tt; - if(t<=0) - return; - sleep(n); - t -= n; - if(t) - { - clock_t begin = times(&tt); - if(begin==0) - return; - t *= sh.lim.clk_tck; - n += (t+.5); - while((times(&tt)-begin) < n); - } -# endif -# endif -#endif /* _lib_poll */ -} diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/test.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/test.c deleted file mode 100644 index 046d608d4..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/test.c +++ /dev/null @@ -1,601 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: test.c /main/5 1995/12/12 14:46:01 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include -#include -#include "io.h" -#include "terminal.h" -#include "test.h" -#include "builtins.h" -#include "FEATURE/externs" - -#ifndef _lib_setregid -# undef _lib_setreuid -#endif /* _lib_setregid */ - -#if defined(_lib_setreuid) && !defined(_AIX) - extern __MANGLE__ int setreuid __PROTO__((uid_t,uid_t)); - extern __MANGLE__ int setregid __PROTO__((uid_t,uid_t)); -#endif /* _lib_setreuid */ - -#define permission(a,f) (sh_access(a,f)==0) -static time_t test_time __PROTO__((const char*, const char*)); -static int test_stat __PROTO__((const char*, struct stat*)); -static int test_mode __PROTO__((const char*)); - -static struct stat statb; - -/* single char string compare */ -#define c_eq(a,c) (*a==c && *(a+1)==0) -/* two character string compare */ -#define c2_eq(a,c1,c2) (*a==c1 && *(a+1)==c2 && *(a+2)==0) - -static char *nxtarg __PROTO__((int)); -static int expr __PROTO__((int)); -static int e3 __PROTO__((void)); - -static int ap, ac; -static char **av; - -int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ - char *cp = argv[0]; - int not; - NOT_USED(extra); - av = argv; - ap = 1; - if(c_eq(cp,'[')) - { - cp = argv[--argc]; - if(!c_eq(cp, ']')) - error(ERROR_exit(2),e_missing,"']'"); - } - if(argc <= 1) - return(1); - cp = argv[1]; - not = c_eq(cp,'!'); - /* posix portion for test */ - switch(argc) - { - case 5: - if(!not) - break; - argv++; - /* fall through */ - case 4: - { - int op = sh_lookup(cp=argv[2],shtab_testops); - if(op&TEST_BINOP) - break; - if(!op) - { - if(argc==5) - break; - if(not && cp[0]=='-' && cp[2]==0) - return(test_unop(cp[1],argv[3])); - error(ERROR_exit(2),e_badop,cp); - } - return(test_binop(op,argv[1],argv[3])^(argc!=5)); - } - case 3: - if(not) - return(*argv[2]!=0); - if(cp[0] != '-' || cp[2]) - break; - return(!test_unop(cp[1],argv[2])); - case 2: - return(*cp==0); - } - if(argc==5) - argv--; - ac = argc; - return(!expr(0)); -} - -/* - * evaluate a test expression. - * flag is 0 on outer level - * flag is 1 when in parenthesis - * flag is 2 when evaluating -a - */ -static int expr __PARAM__((int flag), (flag)) __OTORP__(int flag;){ - int r; - char *p; - r = e3(); - while(ap < ac) - { - p = nxtarg(0); - /* check for -o and -a */ - if(flag && c_eq(p,')')) - { - ap--; - break; - } - if(*p=='-' && *(p+2)==0) - { - if(*++p == 'o') - { - if(flag==2) - { - ap--; - break; - } - r |= expr(3); - continue; - } - else if(*p == 'a') - { - r &= expr(2); - continue; - } - } - if(flag==0) - break; - error(ERROR_exit(2),e_badsyntax); - } - return(r); -} - -static char *nxtarg __PARAM__((int mt), (mt)) __OTORP__(int mt;){ - if(ap >= ac) - { - if(mt) - { - ap++; - return(0); - } - error(ERROR_exit(2),e_argument); - } - return(av[ap++]); -} - - -static int e3 __PARAM__((void), ()){ - char *arg, *cp; - int op; - char *binop; - arg=nxtarg(0); - if(c_eq(arg, '!')) - return(!e3()); - if(c_eq(arg, '(')) - { - op = expr(1); - cp = nxtarg(0); - if(!c_eq(cp, ')')) - error(ERROR_exit(2),e_missing,"')'"); - return(op); - } - cp = nxtarg(1); - if(cp!=0 && (c_eq(cp,'=') || c2_eq(cp,'!','='))) - goto skip; - if(c2_eq(arg,'-','t')) - { - if(cp && isdigit(*cp)) - return(*(cp+1)?0:tty_check(*cp-'0')); - else - { - /* test -t with no arguments */ - ap--; - return(tty_check(1)); - } - } - if(*arg=='-' && arg[2]==0) - { - op = arg[1]; - if(!cp) - { - /* for backward compatibility with new flags */ - if(op==0 || !strchr(test_opchars+10,op)) - return(1); - error(ERROR_exit(2),e_argument); - } - if(strchr(test_opchars,op)) - return(test_unop(op,cp)); - } - if(!cp) - { - ap--; - return(*arg!=0); - } -skip: - op = sh_lookup(binop=cp,shtab_testops); - if(!(op&TEST_BINOP)) - cp = nxtarg(0); - if(!op) - error(ERROR_exit(2),e_badop,binop); - return(test_binop(op,arg,cp)); -} - -int test_unop __PARAM__((int op,const char *arg), (op, arg)) __OTORP__(int op;const char *arg;){ - switch(op) - { - case 'r': - return(permission(arg, R_OK)); - case 'w': - return(permission(arg, W_OK)); - case 'x': - return(permission(arg, X_OK)); - case 'V': -#ifdef SHOPT_FS_3D - { - int offset = staktell(); - if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode)) - return(0); - /* add trailing / */ - stakputs(arg); - stakputc('/'); - stakputc(0); - arg = (const char*)stakptr(offset); - stakseek(offset); - /* FALL THRU */ - } -#else - return(0); -#endif /* SHOPT_FS_3D */ - case 'd': - return(test_stat(arg,&statb)>=0 && S_ISDIR(statb.st_mode)); - case 'c': - return(test_stat(arg,&statb)>=0 && S_ISCHR(statb.st_mode)); - case 'b': - return(test_stat(arg,&statb)>=0 && S_ISBLK(statb.st_mode)); - case 'f': - return(test_stat(arg,&statb)>=0 && S_ISREG(statb.st_mode)); - case 'u': - return(test_mode(arg)&S_ISUID); - case 'g': - return(test_mode(arg)&S_ISGID); - case 'k': -#ifdef S_ISVTX - return(test_mode(arg)&S_ISVTX); -#else - return(0); -#endif /* S_ISVTX */ - case 'L': - case 'h': /* undocumented, and hopefully will disappear */ - { - struct stat statb; - if(*arg==0 || lstat(arg,&statb)<0) - return(0); - return(S_ISLNK(statb.st_mode)); - } - - case 'C': -#ifdef S_ISCTG - return(test_stat(arg,&statb)>=0 && S_ISCTG(statb.st_mode)); -#else - return(0); -#endif /* S_ISCTG */ - case 'H': -#ifdef S_ISCDF - { - int offset = staktell(); - if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode)) - return(1); - stakputs(arg); - stakputc('+'); - stakputc(0); - arg = (const char*)stakptr(offset); - stakseek(offset); - return(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode)); - } -#else - return(0); -#endif /* S_ISCDF */ - - case 'S': -#ifdef S_ISSOCK - return(test_stat(arg,&statb)>=0 && S_ISSOCK(statb.st_mode)); -#else - return(0); -#endif /* S_ISSOCK */ - case 'p': - return(test_stat(arg,&statb)>=0 && S_ISFIFO(statb.st_mode)); - case 'n': - return(*arg != 0); - case 'z': - return(*arg == 0); - case 's': - case 'O': - case 'G': - { - struct stat statb; - if(*arg==0 || test_stat(arg,&statb)<0) - return(0); - if(op=='s') - return(statb.st_size>0); - else if(op=='O') - return(statb.st_uid==sh.userid); - return(statb.st_gid==sh.groupid); - } - case 'a': - case 'e': - return(permission(arg, F_OK)); - case 'o': - op = sh_lookup(arg,shtab_options); - return(op && sh_isoption((1L<0); - case TEST_SLT: - return(strcoll(left, right)<0); - case TEST_SEQ: - return(strcmp(left, right)==0); - case TEST_SNE: - return(strcmp(left, right)!=0); - case TEST_EF: - return(test_inode(left,right)); - case TEST_NT: - return(test_time(left,right)>0); - case TEST_OT: - return(test_time(left,right)<0); - case TEST_EQ: - return(lnum==rnum); - case TEST_NE: - return(lnum!=rnum); - case TEST_GT: - return(lnum>rnum); - case TEST_LT: - return(lnum=rnum); - case TEST_LE: - return(lnum<=rnum); - } - /* NOTREACHED */ -} - -/* - * returns the modification time of f1 - modification time of f2 - */ - -static time_t test_time __PARAM__((const char *file1,const char *file2), (file1, file2)) __OTORP__(const char *file1;const char *file2;){ - struct stat statb1,statb2; - if(test_stat(file1,&statb1)<0) - statb1.st_mtime = 0; - if(test_stat(file2,&statb2)<0) - statb2.st_mtime = 0; - return(statb1.st_mtime-statb2.st_mtime); -} - -/* - * return true if inode of two files are the same - */ - -int test_inode __PARAM__((const char *file1,const char *file2), (file1, file2)) __OTORP__(const char *file1;const char *file2;){ - struct stat stat1,stat2; - if(test_stat(file1,&stat1)>=0 && test_stat(file2,&stat2)>=0) - if(stat1.st_dev == stat2.st_dev && stat1.st_ino == stat2.st_ino) - return(1); - return(0); -} - - -/* - * This version of access checks against effective uid/gid - * The static buffer statb is shared with test_mode. - */ - -int sh_access __PARAM__((const char *name, int mode), (name, mode)) __OTORP__(const char *name; int mode;){ - if(*name==0) - return(-1); - if(strmatch(name,(char*)e_devfdNN)) - return(sh_ioaccess(atoi(name+8),mode)); - /* can't use access function for execute permission with root */ - if(mode==X_OK && sh.euserid==0) - goto skip; - if(sh.userid==sh.euserid && sh.groupid==sh.egroupid) - return(access(name,mode)); -#ifdef _lib_setreuid - /* swap the real uid to effective, check access then restore */ - /* first swap real and effective gid, if different */ - if(sh.groupid==sh.euserid || setregid(sh.egroupid,sh.groupid)==0) - { - /* next swap real and effective uid, if needed */ - if(sh.userid==sh.euserid || setreuid(sh.euserid,sh.userid)==0) - { - mode = access(name,mode); - /* restore ids */ - if(sh.userid!=sh.euserid) - setreuid(sh.userid,sh.euserid); - if(sh.groupid!=sh.egroupid) - setregid(sh.groupid,sh.egroupid); - return(mode); - } - else if(sh.groupid!=sh.egroupid) - setregid(sh.groupid,sh.egroupid); - } -#endif /* _lib_setreuid */ -skip: - if(test_stat(name, &statb) == 0) - { - if(mode == F_OK) - return(mode); - else if(sh.euserid == 0) - { - if(!S_ISREG(statb.st_mode) || mode!=X_OK) - return(0); - /* root needs execute permission for someone */ - mode = (S_IXUSR|S_IXGRP|S_IXOTH); - } - else if(sh.euserid == statb.st_uid) - mode <<= 6; - else if(sh.egroupid == statb.st_gid) - mode <<= 3; -#ifdef _lib_getgroups - /* on some systems you can be in several groups */ - else - { - static int maxgroups = 0; - gid_t *groups; - int n; - if(maxgroups==0) - { - /* first time */ - if((maxgroups=getgroups(0, (gid_t *)NULL)) <= 0) - { - /* pre-POSIX system */ - maxgroups=NGROUPS_MAX; - } - } - groups = (gid_t*)stakalloc((maxgroups+1)*sizeof(gid_t)); - n = getgroups(maxgroups,groups); - while(--n >= 0) - { - if(groups[n] == statb.st_gid) - { - mode <<= 3; - break; - } - } - } -# endif /* _lib_getgroups */ - if(statb.st_mode & mode) - return(0); - } - return(-1); -} - -/* - * Return the mode bits of file - * If is null, then the previous stat buffer is used. - * The mode bits are zero if the file doesn't exist. - */ - -static int test_mode __PARAM__((const char *file), (file)) __OTORP__(const char *file;){ - if(file && (*file==0 || test_stat(file,&statb)<0)) - return(0); - return(statb.st_mode); -} - -/* - * do an fstat() for /dev/fd/n, otherwise stat() - */ -static int test_stat __PARAM__((const char *name,struct stat *buff), (name, buff)) __OTORP__(const char *name;struct stat *buff;){ - if(strmatch(name,(char*)e_devfdNN)) - return(fstat(atoi(name+8),buff)); - else - return(stat(name,buff)); -} diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/trap.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/trap.c deleted file mode 100644 index 2496bf819..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/trap.c +++ /dev/null @@ -1,391 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: trap.c /main/4 1996/08/16 15:31:57 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include "jobs.h" -#include "builtins.h" - -#define L_FLAG 1 -#define S_FLAG 2 - -static const char trapfmt[] = "trap -- %s %s\n"; - -static int sig_number __PROTO__((const char*)); -static void sig_list __PROTO__((int)); - -int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - char *arg = argv[1]; - int sig, pflag = 0; - NOT_USED(argc); - NOT_USED(extra); - while (sig = optget(argv, sh_opttrap)) switch (sig) - { - case 'p': - pflag=1; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors) - error(ERROR_usage(2),optusage((char*)0)); - if(arg = *argv) - { - int clear; - char *action = arg; - if(!pflag) - { - /* first argument all digits or - means clear */ - while(isdigit(*arg)) - arg++; - clear = (arg!=action && *arg==0); - if(!clear) - { - ++argv; - if(*action=='-' && action[1]==0) - clear++; - } - while(!argv[0]) - error(ERROR_exit(1),e_condition); - } - while(arg = *argv++) - { - sig = sig_number(arg); - if(sig<0) - { - error(2,e_trap,arg); - return(1); - } - /* internal traps */ - if(sig&SH_TRAP) - { - sig &= ~SH_TRAP; - if(sig>SH_DEBUGTRAP) - { - error(2,e_trap,arg); - return(1); - } - if(pflag) - { - if(arg=sh.st.trap[sig]) - sfputr(sfstdout,sh_fmtq(arg),'\n'); - continue; - } - if(sh.st.trap[sig]) - free(sh.st.trap[sig]); - sh.st.trap[sig] = 0; - if(!clear && *action) - sh.st.trap[sig] = strdup(action); - if(sig == SH_DEBUGTRAP) - { - if(sh.st.trap[sig]) - sh.trapnote |= SH_SIGTRAP; - else - sh.trapnote = 0; - } - continue; - } - if(sig>sh.sigmax) - { - error(2,e_trap,arg); - return(1); - } - else if(pflag) - { - if(arg=sh.st.trapcom[sig]) - sfputr(sfstdout,sh_fmtq(arg),'\n'); - } - else if(clear) - sh_sigclear(sig); - else - { - if(sig >= sh.st.trapmax) - sh.st.trapmax = sig+1; - if(arg=sh.st.trapcom[sig]) - free(arg); - sh.st.trapcom[sig] = strdup(action); - sh_sigtrap(sig); - } - } - } - else /* print out current traps */ - sig_list(-1); - return(0); -} - -int b_kill __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - char *signame; - int sig=SIGTERM, flag=0, n; - NOT_USED(argc); - NOT_USED(extra); - while((n = optget(argv,sh_optkill))) switch(n) - { - case ':': - if((signame=argv[opt_index++]) && (sig=sig_number(signame+1))>=0) - { - if(argv[opt_index] && strcmp(argv[opt_index],"--")==0) - opt_index++; - goto endopts; - } - opt_index--; - error(2, opt_arg); - break; - case 'n': - sig = (int)opt_num; - break; - case 's': - flag |= S_FLAG; - signame = opt_arg; - break; - case 'l': - flag |= L_FLAG; - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } -endopts: - argv += opt_index; - if(error_info.errors || flag==(L_FLAG|S_FLAG) || (!(*argv) && !(flag&L_FLAG))) - error(ERROR_usage(2),optusage((char*)0)); - /* just in case we send a kill -9 $$ */ - sfsync(sfstderr); - if(flag&L_FLAG) - { - if(!(*argv)) - sig_list(0); - else while(signame = *argv++) - { - if(isdigit(*signame)) - sig_list((atoi(signame)&0177)+1); - else - { - if((sig=sig_number(signame))<0) - { - sh.exitval = 2; - error(ERROR_exit(1),e_nosignal,signame); - } - sfprintf(sfstdout,"%d\n",sig); - } - } - return(sh.exitval); - } - if(flag&S_FLAG) - { - if((sig=sig_number(signame)) < 0 || sig > sh.sigmax) - error(ERROR_exit(1),e_nosignal,signame); - } - if(job_walk(sfstdout,job_kill,sig,argv)) - sh.exitval = 1; - return(sh.exitval); -} - -/* - * Given the name or number of a signal return the signal number - */ - -static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ - int n; - char *last; - if(isdigit(*string)) - { - n = strtol(string,&last,10); - if(*last) - n = -1; - } - else - { - int c; - n = staktell(); - do - { - c = *string++; - if(islower(c)) - c = toupper(c); - stakputc(c); - } - while(c); - stakseek(n); - init_shtab_signals(); - n = sh_lookup(stakptr(n),shtab_signals); - n &= (1< is positive, then print signal name corresponding to - * if is zero, then print all signal names - * if is negative, then print all traps - */ -static void sig_list __PARAM__((int flag), (flag)) __OTORP__(int flag;){ - const struct shtable2 *tp; - int sig = sh.sigmax+1; - const char *names[SH_TRAP]; - const char *traps[SH_DEBUGTRAP+1]; - - init_shtab_signals(); - - tp=shtab_signals; - if(flag==0) - { - /* not all signals may be defined, so initialize */ - while(--sig >= 0) - names[sig] = 0; - for(sig=SH_DEBUGTRAP; sig>=0; sig--) - traps[sig] = 0; - } - while(*tp->sh_name) - { - sig = tp->sh_number; - sig &= ((1<sh_name); - return; - } - else if(sig&SH_TRAP) - traps[sig&~SH_TRAP] = (char*)tp->sh_name; - else if(sig < sizeof(names)/sizeof(char*)) - names[sig] = (char*)tp->sh_name; - tp++; - } - if(flag > 0) - sfprintf(sfstdout,"%d\n",flag-1); - else if(flag<0) - { - /* print the traps */ - char *trap,*sname,**trapcom; - sig = sh.st.trapmax; - /* use parent traps if otrapcom is set (for $(trap) */ - trapcom = (sh.st.otrapcom?sh.st.otrapcom:sh.st.trapcom); - while(--sig >= 0) - { - if(!(trap=trapcom[sig])) - continue; - if(!(sname=(char*)names[sig+1])) - { - sname="SIG??"; - sname[3] = (sig/10)+'0'; - sname[4] = (sig%10)+'0'; - } - sfprintf(sfstdout,trapfmt,sh_fmtq(trap),sname); - } - for(sig=SH_DEBUGTRAP; sig>=0; sig--) - { - if(!(trap=sh.st.trap[sig])) - continue; - sfprintf(sfstdout,trapfmt,sh_fmtq(trap),traps[sig]); - } - } - else - { - /* print all the signal names */ - for(sig=2; sig <= sh.sigmax; sig++) - { - if(names[sig]) - sfputr(sfstdout,names[sig],'\n'); - else - sfprintf(sfstdout,"SIG%d\n",sig-1); - } - } -} - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/typeset.c b/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/typeset.c deleted file mode 100644 index 69f967aee..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/typeset.c +++ /dev/null @@ -1,1158 +0,0 @@ -/* - * CDE - Common Desktop Environment - * - * Copyright (c) 1993-2012, The Open Group. All rights reserved. - * - * These libraries and programs are free software; you can - * redistribute them and/or modify them under the terms of the GNU - * Lesser General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) - * any later version. - * - * These libraries and programs are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU Lesser General Public License for more - * details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with these libraries and programs; if not, write - * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth - * Floor, Boston, MA 02110-1301 USA - */ -/* $XConsortium: typeset.c /main/3 1995/11/01 16:30:25 rswiston $ */ -/*************************************************************** -* * -* AT&T - PROPRIETARY * -* * -* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF * -* AT&T BELL LABORATORIES * -* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN * -* ACCORDANCE WITH APPLICABLE AGREEMENTS * -* * -* Copyright (c) 1995 AT&T Corp. * -* Unpublished & Not for Publication * -* All Rights Reserved * -* * -* The copyright notice above does not evidence any * -* actual or intended publication of such source code * -* * -* This software was created by the * -* Advanced Software Technology Department * -* AT&T Bell Laboratories * -* * -* For further information contact * -* {research,attmail}!dgk * -* * -***************************************************************/ - -/* : : generated by proto : : */ - -#if !defined(__PROTO__) -#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus) -#if defined(__cplusplus) -#define __MANGLE__ "C" -#else -#define __MANGLE__ -#endif -#define __STDARG__ -#define __PROTO__(x) x -#define __OTORP__(x) -#define __PARAM__(n,o) n -#if !defined(__STDC__) && !defined(__cplusplus) -#if !defined(c_plusplus) -#define const -#endif -#define signed -#define void int -#define volatile -#define __V_ char -#else -#define __V_ void -#endif -#else -#define __PROTO__(x) () -#define __OTORP__(x) x -#define __PARAM__(n,o) o -#define __MANGLE__ -#define __V_ char -#define const -#define signed -#define void int -#define volatile -#endif -#if defined(__cplusplus) || defined(c_plusplus) -#define __VARARG__ ... -#else -#define __VARARG__ -#endif -#if defined(__STDARG__) -#define __VA_START__(p,a) va_start(p,a) -#else -#define __VA_START__(p,a) va_start(p) -#endif -#endif -#include "defs.h" -#include -#include "path.h" -#include "name.h" -#include "history.h" -#include "builtins.h" -#include "variables.h" - -/* use these prototyped because dlhdr.h may be wrong */ -extern __MANGLE__ __V_ *dlopen __PROTO__((const char*,int)); -extern __MANGLE__ __V_ *dlsym __PROTO__((__V_*, const char*)); -extern __MANGLE__ char *dlerror __PROTO__((void)); -#define DL_MODE 1 - -static int print_namval __PROTO__((Sfio_t*, Namval_t*, int)); -static void print_attribute __PROTO__((Namval_t*)); -static void print_all __PROTO__((Sfio_t*, Hashtab_t*)); -static void print_scan __PROTO__((Sfio_t*, int, Hashtab_t*, int)); -static int b_unall __PROTO__((int, char**, Hashtab_t*)); -static int b_common __PROTO__((char**, int, Hashtab_t*)); -static void pushname __PROTO__((Namval_t*)); -static void unref __PROTO__((Namval_t*)); -static char **argnam; -static int argnum; -static int aflag; -static int scanmask; -static Hashtab_t *scanroot; -static Sfio_t *outfile; -static void(*nullscan) __PROTO__((Namval_t*)); -static char *prefix; - -static char *get_tree __PROTO__((Namval_t*, Namfun_t *)); -static void put_tree __PROTO__((Namval_t*, const char*, int,Namfun_t*)); - -static const Namdisc_t treedisc = -{ - 0, - put_tree, - get_tree -}; - - -/* - * The following few builtins are provided to set,print, - * and test attributes and variables for shell variables, - * aliases, and functions. - * In addition, typeset -f can be used to test whether a - * function has been defined or to list all defined functions - * Note readonly is same as typeset -r. - * Note export is same as typeset -x. - */ - -int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - int flag; - char *command = argv[0]; - NOT_USED(argc); - NOT_USED(extra); - aflag = '-'; - argnum = 0; - prefix = 0; - while((flag = optget(argv,sh_optexport))) switch(flag) - { - case 'p': - prefix = command; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(error_info.errors) - error(ERROR_usage(2),optusage(NIL(char*))); - argv += (opt_index-1); - if(*command=='r') - flag = (NV_ASSIGN|NV_RDONLY|NV_VARNAME); - else - flag = (NV_ASSIGN|NV_EXPORT|NV_IDENT); - if(*argv) - return(b_common(argv,flag,sh.var_tree)); - print_scan(sfstdout,flag,sh.var_tree,aflag=='+'); - return(0); -} - - -int b_alias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - unsigned flag = NV_ARRAY|NV_NOSCOPE|NV_ASSIGN; - Hashtab_t *troot = sh.alias_tree; - int n; - NOT_USED(argc); - NOT_USED(extra); - prefix=0; - if(*argv[0]=='h') - flag = NV_TAGGED; - if(argv[1]) - { - opt_char = 0; - opt_index = 1; - *opt_option = 0; - argnum = 0; - aflag = *argv[1]; - while((n = optget(argv,sh_optalias))) switch(n) - { - case 'p': - prefix = argv[0]; - break; - case 't': - flag |= NV_TAGGED; - break; - case 'x': - flag |= NV_EXPORT; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(error_info.errors) - error(ERROR_usage(2),optusage(NIL(char*))); - argv += (opt_index-1); - if(flag&NV_TAGGED) - { - if(argv[1] && strcmp(argv[1],"-r")==0) - { - /* hack to handle hash -r */ - nv_putval(PATHNOD,nv_getval(PATHNOD),NV_RDONLY); - return(0); - } - troot = sh.track_tree; - } - } - return(b_common(argv,flag,troot)); -} - - -int b_typeset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - int flag = NV_VARNAME|NV_ASSIGN; - int n; - Hashtab_t *troot = sh.var_tree; - int isfloat = 0; - NOT_USED(argc); - NOT_USED(extra); - aflag = argnum = 0; - prefix = 0; - while((n = optget(argv,sh_opttypeset))) - { - switch(n) - { - case 'A': - flag |= NV_ARRAY; - break; - case 'E': - /* The following is for ksh88 compatibility */ - if(opt_char && !strchr(argv[opt_index],'E')) - { - argnum = (int)opt_num; - break; - } - case 'F': - if(!opt_arg || (argnum = opt_num) <0) - argnum = 10; - isfloat = 1; - if(n=='E') - flag |= NV_EXPNOTE; - break; - case 'n': - flag &= ~NV_VARNAME; - flag |= (NV_REF|NV_IDENT); - break; - case 'H': - flag |= NV_HOST; - break; -#ifdef SHOPT_OO - case 'C': - prefix = opt_arg; - flag |= NV_IMPORT; - break; -#endif /* SHOPT_OO */ - case 'L': - if(argnum==0) - argnum = (int)opt_num; - if(argnum < 0) - error(ERROR_exit(1), e_badfield, argnum); - flag |= NV_LJUST; - break; - case 'Z': - flag |= NV_ZFILL; - /* FALL THRU*/ - case 'R': - if(argnum==0) - argnum = (int)opt_num; - if(argnum < 0) - error(ERROR_exit(1), e_badfield, argnum); - flag |= NV_RJUST; - break; - case 'f': - flag &= ~(NV_VARNAME|NV_ASSIGN); - troot = sh.fun_tree; - break; - case 'i': - if(!opt_arg || (argnum = opt_num) <0) - argnum = 1; - flag |= NV_INTEGER; - break; - case 'l': - flag |= NV_UTOL; - break; - case 'p': - prefix = argv[0]; - continue; - case 'r': - flag |= NV_RDONLY; - break; - case 't': - flag |= NV_TAGGED; - break; - case 'u': - flag |= NV_LTOU; - break; - case 'x': - flag &= ~NV_VARNAME; - flag |= (NV_EXPORT|NV_IDENT); - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - if(aflag==0) - aflag = *opt_option; - } - argv += opt_index; - /* handle argument of + and - specially */ - if(*argv && argv[0][1]==0 && (*argv[0]=='+' || *argv[0]=='-')) - aflag = *argv[0]; - else - argv--; - if((flag&NV_INTEGER) && (flag&(NV_LJUST|NV_RJUST|NV_ZFILL))) - error_info.errors++; - if(troot==sh.fun_tree && ((isfloat || flag&~(NV_FUNCT|NV_TAGGED|NV_EXPORT|NV_LTOU)))) - error_info.errors++; - if(error_info.errors) - error(ERROR_usage(2),optusage(NIL(char*))); - if(isfloat) - flag |= NV_INTEGER|NV_DOUBLE; - if(sh.fn_depth) - flag |= NV_NOSCOPE; - return(b_common(argv,flag,troot)); -} - -static int b_common __PARAM__((char **argv,int flag,Hashtab_t *troot), (argv, flag, troot)) __OTORP__(char **argv;int flag;Hashtab_t *troot;){ - char *name; - int nvflags=(flag&(NV_ARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_ASSIGN)); - int r=0, ref=0; -#ifdef SHOPT_OO - char *base=0; - if(flag&NV_IMPORT) - { - if(!argv[1]) - error(ERROR_exit(1),"requires arguments"); - if(aflag!='-') - error(ERROR_exit(1),"cannot be unset"); - base = prefix; - prefix = 0; - flag &= ~(NV_IMPORT|NV_ASSIGN); - } -#endif /* SHOPT_OO */ - flag &= ~(NV_ARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT); - if(argv[1]) - { - if(flag&NV_REF) - { - flag &= ~NV_REF; - ref=1; - if(aflag!='-') - nvflags |= NV_REF; - } - while(name = *++argv) - { - unsigned newflag; - Namval_t *np; - unsigned curflag; - if(troot == sh.fun_tree) - { - /* - *functions can be exported or - * traced but not set - */ - if(flag&NV_LTOU) - { - /* Function names cannot be special builtin */ - if((np=nv_search(name,sh.bltin_tree,0)) && nv_isattr(np,BLT_SPC)) - error(ERROR_exit(1),e_badfun,name); - np = nv_open(name,sh.fun_tree,NV_ARRAY|NV_IDENT|NV_NOSCOPE); - } - else - np = nv_search(name,sh.fun_tree,HASH_NOSCOPE); - if(np && ((flag&NV_LTOU) || !nv_isnull(np) || nv_isattr(np,NV_LTOU))) - { - if(flag==0) - { - print_namval(sfstdout,np,0); - continue; - } - if(sh.subshell) - sh_subfork(); - if(aflag=='-') - nv_onattr(np,flag|NV_FUNCTION); - else if(aflag=='+') - nv_offattr(np,flag); - } - else - r++; - continue; - } - np = nv_open(name,troot,nvflags); - /* tracked alias */ - if(troot==sh.track_tree && aflag=='-') - { - nv_onattr(np,NV_NOALIAS); - path_alias(np,path_absolute(nv_name(np),NIL(char*))); - continue; - } - if(flag==NV_ASSIGN && !ref && aflag!='-' && !strchr(name,'=')) - { - if(troot!=sh.var_tree && (nv_isnull(np) || !print_namval(sfstdout,np,0))) - { - sfprintf(sfstderr,e_noalias,name); - r++; - } - continue; - } - if(troot==sh.var_tree && (nvflags&NV_ARRAY)) - nv_setarray(np,nv_associative); -#ifdef SHOPT_OO - if(base) - { - Namval_t *nq, *nr; - nv_offattr(np,NV_IMPORT); - if(!(nq=nv_search(base,troot,0))) - error(ERROR_exit(1),e_badbase,base); - /* check for loop */ - for(nr=nq; nr; nr = nv_class(nr)) - { - if(nr==np) - error(ERROR_exit(1),e_loop,base); - } - np->nvenv = (char*)nq; - if(nq->nvfun && (nq->nvfun)->disc->create) - (*(nq->nvfun)->disc->create)(np,0,nq->nvfun); - } -#endif /* SHOPT_OO */ - curflag = np->nvflag; - if (aflag == '-') - { - if((flag&NV_EXPORT) && strchr(nv_name(np),'.')) - error(ERROR_exit(1),e_badexport,nv_name(np)); -#ifdef SHOPT_BSH - if(flag&NV_EXPORT) - nv_offattr(np,NV_IMPORT); -#endif /* SHOPT_BSH */ - newflag = curflag; - if(flag&~NV_NOCHANGE) - newflag &= NV_NOCHANGE; - newflag |= flag; - if (flag & (NV_LJUST|NV_RJUST)) - { - if (flag & NV_LJUST) - newflag &= ~NV_RJUST; - else - newflag &= ~NV_LJUST; - } - if (flag & NV_UTOL) - newflag &= ~NV_LTOU; - else if (flag & NV_LTOU) - newflag &= ~NV_UTOL; - } - else - { - if((flag&NV_RDONLY) && (curflag&NV_RDONLY)) - error(ERROR_exit(1),e_readonly,nv_name(np)); - newflag = curflag & ~flag; - } - if (aflag && (argnum>0 || (curflag!=newflag))) - { - if(sh.subshell) - sh_assignok(np,1); - if(troot!=sh.var_tree) - nv_setattr(np,newflag); - else - nv_newattr (np, newflag,argnum); - } - /* set or unset references */ - if(ref) - { - if(aflag=='-') - nv_setref(np); - else - unref(np); - } - nv_close(np); - } - } - else - { - if(aflag) - { - if(troot==sh.fun_tree) - { - flag |= NV_FUNCTION; - prefix = 0; - } - else if(troot==sh.var_tree) - flag |= (nvflags&NV_ARRAY); - print_scan(sfstdout,flag,troot,aflag=='+'); - } - else if(troot==sh.alias_tree) - print_scan(sfstdout,0,troot,0); - else - print_all(sfstdout,troot); - } - return(r); -} - -typedef int (*Fptr_t) __PROTO__((int, char*[], __V_*)); - -#define GROWLIB 4 -static __V_ **liblist; - -/* - * This allows external routines to load from the same library */ -__V_ **sh_getliblist __PARAM__((void), ()){ - return(liblist); -} - -/* - * add change or list built-ins - * adding builtins requires dlopen() interface - */ -int b_builtin __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - char *arg=0, *name; - int n, r=0, flag=0; - Namval_t *np; - int dlete=0; - static int maxlib, nlib; - Fptr_t addr; - __V_ *library=0; - char *errmsg; - NOT_USED(argc); - NOT_USED(extra); - while (n = optget(argv,sh_optbuiltin)) switch (n) - { - case 's': - flag = BLT_SPC; - break; - case 'd': - dlete=1; - break; - case 'f': -#ifdef SHOPT_DYNAMIC - arg = opt_arg; -#else - error(2, "adding built-ins not supported"); - error_info.errors++; -#endif /* SHOPT_DYNAMIC */ - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(2), opt_arg); - break; - } - argv += opt_index; - if(error_info.errors) - error(ERROR_usage(2),optusage(NIL(char*))); - if(arg || *argv) - { - if(sh_isoption(SH_RESTRICTED)) - error(ERROR_exit(1),e_restricted,argv[-opt_index]); - if(sh.subshell) - sh_subfork(); - } - if(arg) - { - if(!(library = dlopen(arg,DL_MODE))) - { - error(ERROR_exit(0),"%s: %s",arg,dlerror()); - return(1); - } - /* - * see if library is already on search list - * if it is, move to head of search list - */ - for(n=r=0; n < nlib; n++) - { - if(r) - liblist[n-1] = liblist[n]; - else if(liblist[n]==library) - r++; - } - if(r) - nlib--; - if(nlib >= maxlib) - { - /* add library to search list */ - maxlib += GROWLIB; - if(nlib>0) - liblist = (__V_**)realloc((__V_*)liblist,(maxlib+1)*sizeof(__V_**)); - else - liblist = (__V_**)malloc((maxlib+1)*sizeof(__V_**)); - } - liblist[nlib++] = library; - liblist[nlib] = 0; - } - else if(*argv==0 && !dlete) - { - print_scan(sfstdout, flag, sh.bltin_tree, 1); - return(0); - } - r = 0; - flag = staktell(); - while(arg = *argv) - { - name = path_basename(arg); - stakputs("b_"); - stakputs(name); - errmsg = 0; - addr = 0; - for(n=(nlib?nlib:dlete); --n>=0;) - { - /* (char*) added for some sgi-mips compilers */ - if(dlete || (addr = (Fptr_t)dlsym(liblist[n],stakptr(flag)))) - { - if(sh_addbuiltin(arg, addr,0) < 0) - errmsg = "restricted name"; - else - errmsg = 0; - break; - } - } - if(!dlete && !addr) - { - if(np=nv_search(name,sh.bltin_tree,0)) - { - if(sh_addbuiltin(arg, np->nvalue.bfp,0) < 0) - errmsg = "restricted name"; - } - else - errmsg = "not found"; - } - if(errmsg) - { - error(ERROR_exit(0),"%s: %s",*argv,errmsg); - r = 1; - } - stakseek(flag); - argv++; - } - return(r); -} - -int b_set __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - NOT_USED(extra); - prefix=0; - if(argv[1]) - { - if(sh_argopts(argc,argv) < 0) - return(2); - sh_offstate(SH_VERBOSE|SH_MONITOR); - sh_onstate(sh_isoption(SH_VERBOSE|SH_MONITOR)); - } - else - /*scan name chain and print*/ - print_scan(sfstdout,0,sh.var_tree,0); - return(0); -} - -/* - * The removing of Shell variable names, aliases, and functions - * is performed here. - * Unset functions with unset -f - * Non-existent items being deleted give non-zero exit status - */ - -int b_unalias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - NOT_USED(extra); - return(b_unall(argc,argv,sh.alias_tree)); -} - -int b_unset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ - NOT_USED(extra); - return(b_unall(argc,argv,sh.var_tree)); -} - -static int b_unall __PARAM__((int argc, char **argv, Hashtab_t *troot), (argc, argv, troot)) __OTORP__(int argc; char **argv; Hashtab_t *troot;){ - Namval_t *np; - struct slnod *slp; - const char *name; - int r; - int nflag = 0; - int all=0; - NOT_USED(argc); - if(troot!=sh.var_tree && sh.subshell) - sh_subfork(); - if(troot==sh.alias_tree) - name = sh_optunalias; - else - name = sh_optunset; - while(r = optget(argv,name)) switch(r) - { - case 'f': - troot = sh.fun_tree; - break; - case 'a': - all=1; - break; - case 'n': - nflag = NV_NOREF; - case 'v': - troot = sh.var_tree; - break; - case ':': - error(2, opt_arg); - break; - case '?': - error(ERROR_usage(0), opt_arg); - return(2); - } - argv += opt_index; - if(error_info.errors || (*argv==0 &&!all)) - error(ERROR_usage(2),optusage(NIL(char*))); - r = 0; - if(troot==sh.var_tree) - nflag |= NV_VARNAME; - if(all) - { - hashfree(troot); - sh.alias_tree = hashalloc(sh.var_tree,HASH_set,HASH_ALLOCATE,0); - } - else while(name = *argv++) - { - if(np=nv_open(name,troot,NV_NOADD|nflag)) - { - if(troot!=sh.var_tree) - { - if(is_abuiltin(np)) - { - r = 1; - continue; - } - else if(slp=(struct slnod*)(np->nvenv)) - { - /* free function definition */ - char *cp= strrchr(name,'.'); - if(cp) - { - Namval_t *npv; - *cp = 0; - npv = nv_open(name,sh.var_tree,NV_ARRAY|NV_VARNAME|NV_NOADD); - *cp++ = '.'; - if(npv) - nv_setdisc(npv,cp,NIL(Namval_t*),(Namfun_t*)npv); - } - stakdelete(slp->slptr); - np->nvenv = 0; - hashlook(troot,(char*)np,HASH_DELETE|HASH_BUCKET,(char*)0); - continue; - } - } - - if(sh.subshell) - np=sh_assignok(np,0); - nv_unset(np); - nv_close(np); - } - else - r = 1; - } - return(r); -} - - - -/* - * print out the name and value of a name-value pair - */ - -static int print_namval __PARAM__((Sfio_t *file,Namval_t *np,int flag), (file, np, flag)) __OTORP__(Sfio_t *file;Namval_t *np;int flag;){ - char *cp; - sh_sigcheck(); - if(flag) - flag = '\n'; - if(nv_isattr(np,NV_NOPRINT)==NV_NOPRINT) - { - if(is_abuiltin(np)) - sfputr(file,np->nvenv?np->nvenv:nv_name(np),'\n'); - return(0); - } - if(prefix) - sfputr(file,prefix,' '); - if(is_afunction(np)) - { - if(!flag && !np->nvalue.ip) - sfputr(file,"typeset -fu",' '); - else if(!flag && !nv_isattr(np,NV_FPOSIX)) - sfputr(file,"function",' '); - if(!np->nvalue.ip || np->nvalue.rp->hoffset<0) - flag = '\n'; - sfputr(file,nv_name(np),flag?flag:-1); - if(!flag) - { - sfputr(file,nv_isattr(np,NV_FPOSIX)?"()\n{":"\n{",'\n'); - hist_list(sh.hist_ptr,file,np->nvalue.rp->hoffset,0,"\n"); - } - return(nv_size(np)+1); - } - if(cp=nv_getval(np)) - { - Namarr_t *ap; - sfputr(file,sh_fmtq(nv_name(np)),-1); - if(!flag) - { - flag = '='; - if(ap = nv_arrayptr(np)) - sfprintf(file,"[%s]", sh_fmtq(nv_getsub(np))); - } - sfputc(file,flag); - if(flag != '\n') - sfputr(file,sh_fmtq(cp),'\n'); - return(1); - } - else if(scanmask && scanroot==sh.var_tree) - sfputr(file,nv_name(np),'\n'); - return(0); -} - -/* - * print attributes at all nodes - */ - -static void print_all __PARAM__((Sfio_t *file,Hashtab_t *root), (file, root)) __OTORP__(Sfio_t *file;Hashtab_t *root;){ - outfile = file; - nv_scan(root, print_attribute, 0, 0); -} - -#include -#include "argnod.h" - -/* - * format initialization list given a list of assignments - */ -static void genvalue __PARAM__((struct argnod *argp, const char *prefix, int n, int indent), (argp, prefix, n, indent)) __OTORP__(struct argnod *argp; const char *prefix; int n; int indent;){ - struct argnod *ap; - char *cp,*nextcp; - int m,isarray; - Namval_t *np; - if(n==0) - m = strlen(prefix); - else - m = strchr(prefix,'.')-prefix; - m++; - if(outfile) - { - sfwrite(outfile,"(\n",2); - indent++; - } - for(ap=argp; ap; ap=ap->argchn.ap) - { - if(ap->argflag==ARG_MAC) - continue; - cp = ap->argval+n; - if(n==0 && cp[m-1]!='.') - { - ap->argflag = ARG_MAC; - continue; - } - if(n && cp[n-1]==0) - continue; - if(n==0 || strncmp(ap->argval,prefix-n,m+n)==0) - { - cp +=m; - if(nextcp=strchr(cp,'.')) - { - if(outfile) - { - sfnputc(outfile,'\t',indent); - sfwrite(outfile,cp,nextcp-cp); - sfputc(outfile,'='); - } - genvalue(argp,cp,n+m ,indent); - if(outfile) - sfputc(outfile,'\n'); - continue; - } - ap->argflag = ARG_MAC; - if(!(np=nv_search(ap->argval,sh.var_tree,0))) - continue; - if(np->nvfun && np->nvfun->disc== &treedisc) - continue; - isarray=0; - if(nv_isattr(np,NV_ARRAY)) - { - nv_putsub(np,NIL(char*),ARRAY_SCAN); - isarray=1; - } - if(!outfile) - { - nv_close(np); - continue; - } - sfnputc(outfile,'\t',indent); - if(nv_isattr(np,~NV_DEFAULT)) - print_attribute(np); - sfputr(outfile,cp,'='); - if(isarray) - { - sfwrite(outfile,"(\n",2); - sfnputc(outfile,'\t',++indent); - } - while(1) - { - if(isarray) - { - sfprintf(outfile,"[%s]",sh_fmtq(nv_getsub(np))); - sfputc(outfile,'='); - } - sfputr(outfile,sh_fmtq(nv_getval(np)),'\n'); - if(!ap || !nv_nextsub(np)) - break; - sfnputc(outfile,'\t',indent); - } - if(isarray) - { - sfnputc(outfile,'\t',--indent); - sfwrite(outfile,")\n",2); - } - } - } - if(outfile) - { - if(indent > 1) - sfnputc(outfile,'\t',indent-1); - sfputc(outfile,')'); - } -} - -/* - * walk the virtual tree and print or delete name-value pairs - */ -static char *walk_tree __PARAM__((Namval_t *np, int dlete), (np, dlete)) __OTORP__(Namval_t *np; int dlete;){ - static Sfio_t *out; - int n; - Fcin_t save; - int savtop = staktell(); - char *savptr = stakfreeze(0); - struct argnod *ap; - struct argnod *arglist=0; - char *name = nv_name(np); - stakseek(ARGVAL); - stakputs("\"${!"); - stakputs(name); - stakputs("@}\""); - ap = (struct argnod*)stakfreeze(1); - ap->argflag = ARG_MAC; - fcsave(&save); - n = sh_macexpand(ap,&arglist); - fcrestore(&save); - ap = arglist; - if(dlete) - outfile = 0; - else if(!(outfile=out)) - outfile = out = sfnew((Sfio_t*)0,(char*)0,-1,-1,SF_WRITE|SF_STRING); - else - sfseek(outfile,0L,SEEK_SET); - prefix = "typeset"; - aflag = '='; - genvalue(ap,name,0,0); - stakset(savptr,savtop); - if(!outfile) - return((char*)0); - sfputc(out,0); - return((char*)out->data); -} - -/* - * get discipline for compound initializations - */ -static char *get_tree __PARAM__((Namval_t *np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t *np; Namfun_t *fp;){ - NOT_USED(fp); - return(walk_tree(np,0)); -} - -/* - * put discipline for compound initializations - */ -static void put_tree __PARAM__((Namval_t *np, const char *val, int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t *np; const char *val; int flags;Namfun_t *fp;){ - walk_tree(np,1); - if(fp = nv_stack(np,NIL(Namfun_t*))) - { - free((__V_*)fp); - if(np->nvalue.cp && !nv_isattr(np,NV_NOFREE)) - free((__V_*)np->nvalue.cp); - } - if(val) - nv_putval(np,val,flags); -} - -/* - * Insert discipline to cause $x to print current tree - */ -void nv_setvtree __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){ - Namfun_t *nfp = newof(NIL(__V_*),Namfun_t,1,0); - nfp->disc = &treedisc; - nv_stack(np, nfp); -} - -/* - * print the attributes of name value pair give by - */ -static void print_attribute __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){ - const Shtable_t *tp; - char *cp; - unsigned val; - unsigned mask; -#ifdef SHOPT_OO - Namval_t *nq; - char *cclass=0; -#endif /* SHOPT_OO */ - if (nv_isattr(np,~NV_DEFAULT)) - { - if(prefix) - sfputr(outfile,prefix,' '); - for(tp = shtab_attributes; *tp->sh_name;tp++) - { - val = tp->sh_number; - mask = val; - if(val&NV_INTEGER) - mask |= NV_DOUBLE; - if(nv_isattr(np,mask)==val) - { - if(val==NV_ARRAY) - { - Namarr_t *ap = nv_arrayptr(np); - if(array_assoc(ap)) - cp = "associative"; - else - cp = "indexed"; - if(!prefix) - sfputr(outfile,cp,' '); - else if(*cp=='i') - continue; - } - if(prefix) - { - if(*tp->sh_name=='-') - sfprintf(outfile,"%.2s ",tp->sh_name); - } - else - sfputr(outfile,tp->sh_name+2,' '); - if ((val&(NV_LJUST|NV_RJUST|NV_ZFILL)) && !(val&NV_INTEGER)) - sfprintf(outfile,"%d ",nv_size(np)); - } - if(val == NV_INTEGER && nv_isattr(np,NV_INTEGER)) - { - if(nv_size(np) != 10) - { - if(nv_isattr(np, NV_DOUBLE)) - cp = "precision"; - else - cp = "base"; - if(!prefix) - sfputr(outfile,cp,' '); - sfprintf(outfile,"%d ",nv_size(np)); - } - break; - } - } -#ifdef SHOPT_OO - if(nq=nv_class(np)) - { - if(prefix && *prefix=='t') - cclass = "-C"; - else if(!prefix) - cclass = "class"; - if(cclass) - sfprintf(outfile,"%s %s ",cclass,nv_name(nq)); - - } -#endif /* SHOPT_OO */ - if(aflag) - return; - sfputr(outfile,nv_name(np),'\n'); - } -} - -/* - * print the nodes in tree which have attributes set - * of