Compile dtksh on FreeBSD
authorMarcin Cieslak <saper@saper.info>
Tue, 14 Aug 2012 13:31:55 +0000 (15:31 +0200)
committerJon Trulson <jon@radscan.com>
Tue, 14 Aug 2012 18:18:38 +0000 (12:18 -0600)
dtksh can be now compiled on FreeBSD. Work in progress.

Needs a real Korn shell to bootstrap as $(KSHELL).
KSHELL is set by default to /usr/local/bin/ksh93
(generic POSIX shell may not work)

Tested on:

  FreeBSD 9.0-BETA1 #0 r224912M amd64

Known issues:

xvmstat:
* sleep does not work well (SIGSTOP is delivered)
xpong:
* xpong: line 220:  ball1x = max_x * 2.2 / 3 : arithmetic syntax error
* dtksh is rebuilt uncondtionally every time make is invoked

21 files changed:
cde/programs/Imakefile
cde/programs/dtksh/Imakefile
cde/programs/dtksh/dtkcvt.c
cde/programs/dtksh/ksh93/Imakefile
cde/programs/dtksh/ksh93/ship/shipin
cde/programs/dtksh/ksh93/ship/shipproto.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/alarm.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/read.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/bltins/sleep.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/edit/history.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/edit/vi.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/include/fault.h
cde/programs/dtksh/ksh93/src/cmd/ksh93/sh/io.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/sh/timers.c
cde/programs/dtksh/ksh93/src/cmd/ksh93/sh/xec.c
cde/programs/dtksh/ksh93/src/lib/libast/hash/hashalloc.c
cde/programs/dtksh/ksh93/src/lib/libast/port/astconf.c
cde/programs/dtksh/ksh93/src/lib/libast/sfio/sfvprintf.c
cde/programs/dtksh/ksh93/src/lib/libast/string/tokscan.c
cde/programs/dtksh/xmcmds.c
cde/programs/dtksh/xmdtksym.h

index ca66a8bc67d5ff2eaad1ac621c37daaa51450805..f6b18353c3726cf44e1bfce5512a6857b590e0ee 100644 (file)
@@ -12,9 +12,12 @@ EXTRADIRS += util
 
 XCOMM some of these cannot be built on linux yet.
 XCOMM dtksh dtinfo
-#if defined(LinuxArchitecture) || defined(OpenBSDArchitecture) || defined(FreeBSDArchitecture)
+#if defined(LinuxArchitecture) || defined(OpenBSDArchitecture)
 DTKSHDIR = 
 DTINFODIR = 
+#elif defined(FreeBSDArchitecture)
+DTKSHDIR = dtksh
+DTINFODIR = 
 #else
 DTKSHDIR = dtksh
 DTINFODIR = dtinfo
index 0b78726970f5643477b51d766ca729149feb97ea..f5071a305ce5c914b4b797c7e67e7e0a50f498c9 100644 (file)
@@ -135,4 +135,4 @@ ComplexProgramTarget($(PROGRAMS))
 
 clean::
        @echo " Cleaning ksh directories"
-       ./MakeClean
+       $(SHELL) MakeClean
index ff5f892e2e882594817e54a97cd5fe3f6b9f70ef..fe69042d27e977b938de2ddc5445cbc08e3620d4 100644 (file)
@@ -67,7 +67,8 @@
 #include "xmwidgets.h"
 #include "msgs.h"
 
-#if defined(SYSV) || defined(SVR4_0) || defined(SVR4) || defined(DEC)
+#if defined(SYSV) || defined(SVR4_0) || defined(SVR4) || defined(DEC) \
+       || defined(CSRG_BASED) || defined(linux)
 #define lsprintf sprintf
 #endif
 
@@ -430,7 +431,7 @@ DtkshCvtStringToCallback(
    cb = (XtCallbackList)XtMalloc(sizeof(XtCallbackRec)*2);
    cb[0].callback = (XtCallbackProc)stdCB;
 
-   cdata = GetNewCBData((String)fval->addr, w, DTKSHConversionResource, NULL);
+   cdata = GetNewCBData((String)fval->addr, w, DTKSHConversionResource, None);
 
    cb[0].closure = (caddr_t)cdata;
    cb[1].callback = NULL;
@@ -572,7 +573,7 @@ static EventMaskTable eventMasks[] = {
    {"PropertyChangeMask", PropertyChangeMask},
    {"ColormapChangeMask", ColormapChangeMask},
    {"OwnerGrabButtonMask", OwnerGrabButtonMask},
-   {NULL, NULL},
+   {NULL, NoEventMask},
 };
 
 
@@ -739,7 +740,7 @@ static MWMTable mwmDecorations[] = {
    {"MWM_DECOR_MENU", MWM_DECOR_MENU},
    {"MWM_DECOR_MINIMIZE", MWM_DECOR_MINIMIZE},
    {"MWM_DECOR_MAXIMIZE", MWM_DECOR_MAXIMIZE},
-   {NULL, NULL},
+   {NULL, 0},
 };
 
 static MWMTable mwmFunctions[] = {
@@ -749,7 +750,7 @@ static MWMTable mwmFunctions[] = {
    {"MWM_FUNC_MINIMIZE", MWM_FUNC_MINIMIZE},
    {"MWM_FUNC_MAXIMIZE", MWM_FUNC_MAXIMIZE},
    {"MWM_FUNC_CLOSE", MWM_FUNC_CLOSE},
-   {NULL, NULL},
+   {NULL, 0},
 };
 
 static void
index 410a9c49ac6aaf4b677fd9c0f33195efda48dc64..ee961cbefbe1926ba9f885bb643f4ada56ba8649 100644 (file)
@@ -15,7 +15,7 @@ CCFLAGS =
 .NO_PARALLEL:
 #endif /* SunArchitecture */
 
-FORCE_SHIP = -E
+FORCE_SHIP = -F
 
 MALLOCOBJ =
 
@@ -31,6 +31,7 @@ KSH_OBJS = \
 
 OBJS = $(KSH_OBJS) $(KSH_LIBS)
 
+KSHELL?= /usr/local/bin/ksh93
 
 SUIDEXECDEFINES = \
        -DPROFILEPATH=\"$(CDE_CONFIGURATION_TOP)/config/profile\" \
@@ -57,15 +58,7 @@ ALL_SUBS = *
 
 ksh93src:
        $(RM) $(SHIP_DIR)/$(ALL_SUBS)/$(ALL_SUBS)/BUILT; \
-       if [ -f /bin/ksh ]; \
-       then \
-               SHELL=/bin/ksh CC=$(CC) CCFLAGS="$(CCFLAGS)" /bin/ksh ship/shipin $(FORCE_SHIP); \
-       elif [ -f /bin/sh ]; \
-       then \
-               SHELL=/bin/sh CC=$(CC) CCFLAGS="$(CCFLAGS)"  /bin/sh ship/shipin $(FORCE_SHIP); \
-       else \
-               SHELL="" CC=$(CC) CCFLAGS="$(CCFLAGS)"  ship/shipin $(FORCE_SHIP); \
-       fi
+       SHELL=$(KSHELL) CC=$(CC) CCFLAGS="$(CCFLAGS)" $(KSHELL) ship/shipin $(FORCE_SHIP)
 
 ksh93.o: $(OBJS)
        $(LD) -r -o $@ $(OBJS)
index 0a005168ae2c6a7e1f4abc90ae6d6c2044e59e37..e91dbf2603d6a13ebaf571655ef953376a699c58 100755 (executable)
@@ -727,110 +727,6 @@ esac
 esac
 trap 'exit 2' 1 2
 
-#
-# check if we can use pax -- punt to cpio
-#
-
-AR_DELTA=
-NEED_pax=
-_cpio_=
-_cpio_local=
-_pax_=
-_pax_local=
-for p in $_path_
-do     case $AR_DELTA in
-       "")     for f in $p/pax $p/pax.save
-               do      if      ($f -f /dev/null -z /dev/null) >/dev/null 2>&1
-                       then    _pax_=$p/pax
-                               c=pax; eval new=$_stamp_
-                               if      test "$new" -ge "$OLDEST_pax"
-                               then    case $f in
-                                       $BIN/pax)       if      test ! -f $f.save
-                                                       then    $_trace_ cp $f $f.save
-                                                       fi
-                                                       ;;
-                                       esac
-                                       AR_DELTA=$f
-                                       break 2
-                               fi
-                       fi
-               done
-               ;;
-       esac
-       case $_cpio_ in
-       "")     if      test -f $p/cpio
-               then    case $p in
-                       $BIN)   _cpio_local=$p/cpio
-                               ;;
-                       *)      _cpio_=$p/cpio
-                               case $AR_DELTA in
-                               ?*)     break ;;
-                               esac
-                               ;;
-                       esac
-               fi
-               ;;
-       esac
-       case $_pax_ in
-       "")     if      test -f $p/pax
-               then    case $p in
-                       $BIN)   _pax_local=$p/pax
-                               ;;
-                       *)      _pax_=$p/pax
-                               case $AR_DELTA in
-                               ?*)     break ;;
-                               esac
-                               ;;
-                       esac
-               fi
-               ;;
-       esac
-done
-case $_cpio_ in
-"")    _cpio_=$_cpio_local ;;
-esac
-case $_pax_ in
-"")    _pax_=$_pax_local ;;
-esac
-case $_pax_ in
-?*)    AR_PATH=$_pax_
-       case $AR_DELTA in
-       "")     AR_LIST="$AR_PATH" ;;
-       *)      AR_LIST="$AR_PATH -x ignore" ;;
-       esac
-       AR_READ="$AR_PATH -r"
-       AR_WRITE="$AR_PATH -w"
-       ;;
-*)     AAR_PATH=tar
-       AAR_LIST="$AAR_PATH t"
-       AAR_READ="$AAR_PATH x"
-       AAR_WRITE="$AAR_PATH c"
-       case $_cpio_ in
-       ?*)     AR_PATH=$_cpio_
-               AR_LIST="$AR_PATH -ict"
-               AR_READ="$AR_PATH -icdmu"
-               AR_WRITE="$AR_PATH -oc"
-               ;;
-       *)      AR_PATH=$AAR_PATH
-               AR_LIST=$AAR_LIST
-               AR_READ=$AAR_READ
-               AR_WRITE=$AAR_WRITE
-               AAR_PATH=
-               AAR_LIST=
-               AAR_READ=
-               AAR_WRITE=
-               ;;
-       esac
-esac
-case $AR_PATH in
-"")    echo $_command_: must have pax, cpio, or tar to uncrate >&2; exit 1 ;;
-esac
-OAR_PATH=$AR_PATH
-OAR_LIST=$AR_LIST
-OAR_READ=$AR_READ
-OAR_WRITE=$AR_WRITE
-OAR_DELTA=$AR_DELTA
-
 #
 # check if we can use nmake from the start
 # if so then limit proto to notices only
index 787f9700d37449dcf9c75d8fd46399a4d60d2c27..8d4165d397e007e31de343285a7c790e225fbc7b 100644 (file)
 
 # include <sys/types.h>
 # include <sys/stat.h>
+# include <string.h>
 
 # undef        ctime
 
@@ -1331,7 +1332,7 @@ struct ppsymkey
 
 
 extern __MANGLE__ int          access __PROTO__((const char*, int));
-extern __MANGLE__ __V_*                calloc __PROTO__((int, 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*));
index af880508e8c9220710c6f166af350a5891123f2b..a0a82914bd6293526d1e2de001172c3c3e94a83a 100644 (file)
@@ -134,7 +134,7 @@ static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list))
                tp->next = item;
        }
        tp = item;
-       tp->timeout = (__V_*)timeradd(tp->milli,tp->flags&R_FLAG,trap_timeout,(__V_*)tp);
+       tp->timeout = (__V_*)kshtimeradd(tp->milli,tp->flags&R_FLAG,trap_timeout,(__V_*)tp);
        return(list);
 }
 
index 9f7bec0380aebfb6237c76eaa3db8da7c1aa9d29..1af46e23e6987a76769b7db9ce7501b0ba4a1dc8 100644 (file)
@@ -271,7 +271,7 @@ int sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names
                jmpval = sigsetjmp(buff.buff,0);
                if(jmpval)
                        goto done;
-                timeslot = (__V_*)timeradd(timeout,0,timedout,(__V_*)iop);
+                timeslot = (__V_*)kshtimeradd(timeout,0,timedout,(__V_*)iop);
        }
        if(!(cp = (unsigned char*)sfgetr(iop,delim,0)))
                cp = (unsigned char*)sfgetr(iop,delim,-1);
index 741a477d97412bb61b5a939d21fc81cef611544b..5a1ddb6baa3c265c693610cacb080cf128896b30 100644 (file)
@@ -157,7 +157,7 @@ unsigned sleep __PARAM__((unsigned sec), (sec)) __OTORP__(unsigned sec;){
        __V_ *tp;
        expired = 0;
        sh.lastsig = 0;
-       tp = (__V_*)timeradd(1000*sec, 0, completed, (__V_*)0);
+       tp = (__V_*)kshtimeradd(1000*sec, 0, completed, (__V_*)0);
        do
        {
                pause();
index c9ccaaf5fa93d747b9859516c612e25a108a5767..5d56fb320b12e538dae74b1ce0f3da5a181b98ac 100644 (file)
@@ -372,7 +372,7 @@ retry:
 #ifdef KSHELL
        (HISTCUR)->nvalue.lp = (&hp->histind);
 #endif /* KSHELL */
-       timeradd(1000L*(HIST_RECENT-30), 1, hist_touch, (__V_*)hp->histname);
+       kshtimeradd(1000L*(HIST_RECENT-30), 1, hist_touch, (__V_*)hp->histname);
 #ifdef SHOPT_ACCTFILE
        if(sh_isstate(SH_INTERACTIVE))
                acctinit();
index f0acfecb5a6f6d6f408335c7573c42d2fc49616e..bfeffba7e659275b5261816f3f411e11d35ef024 100644 (file)
 
 #define        MAXCHAR MAXLINE-2               /* max char per line */
 
-#undef isblank
 #ifdef SHOPT_MULTIBYTE
     static int bigvi;
 #   define gencpy(a,b) ed_gencpy(a,b)
 #   define is_print(c) ((c&~STRIP) || isprint(c))
     static int isalph __PROTO__((int));
     static int ismetach __PROTO__((int));
-    static int isblank __PROTO__((int));
+    static int kshisblank __PROTO__((int));
 #   include    "lexstates.h"
 #else
 #   define gencpy(a,b) strcpy((char*)(a),(char*)(b))
 #   define genncpy(a,b,n) strncpy((char*)(a),(char*)(b),n)
 #   define genlen(str) strlen(str)
 #   define isalph(v)   ((_c=virtual[v])=='_'||isalnum(_c))
-#   define isblank(v)  isspace(virtual[v])
+#   define kshisblank(v)       isspace(virtual[v])
 #   define ismetach(v) ismeta(virtual[v])
 #   define digit(c)    isdigit(c)
 #   define is_print(c) isprint(c)
@@ -220,7 +219,7 @@ static char paren_chars[] = "([{)]}";   /* for % command */
 
 #ifdef FIORDCHK
     static clock_t typeahead;          /* typeahead occurred */
-    extern __MANGLE__ int ioctl __PROTO__((int, int, ...));
+    extern __MANGLE__ int ioctl __PROTO__((int, unsigned long, ...));
 #else
     static int typeahead;              /* typeahead occurred */
 #endif /* FIORDCHK */
@@ -680,7 +679,7 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
        register int tcur_virt = cur_virt;
        while( nwords-- && tcur_virt > first_virt )
        {
-               if( !isblank(tcur_virt) && isblank(tcur_virt-1)
+               if( !kshisblank(tcur_virt) && kshisblank(tcur_virt-1)
                        && tcur_virt>first_virt )
                        --tcur_virt;
                else if(cmd != 'B')
@@ -690,11 +689,11 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
                        if((!cur && last) || (cur && !last))
                                --tcur_virt;
                }
-               while( isblank(tcur_virt) && tcur_virt>=first_virt )
+               while( kshisblank(tcur_virt) && tcur_virt>=first_virt )
                        --tcur_virt;
                if( cmd == 'B' )
                {
-                       while( !isblank(tcur_virt) && tcur_virt>=first_virt )
+                       while( !kshisblank(tcur_virt) && tcur_virt>=first_virt )
                                --tcur_virt;
                }
                else
@@ -703,7 +702,7 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
                                while( isalph(tcur_virt) && tcur_virt>=first_virt )
                                        --tcur_virt;
                        else
-                               while( !isalph(tcur_virt) && !isblank(tcur_virt)
+                               while( !isalph(tcur_virt) && !kshisblank(tcur_virt)
                                        && tcur_virt>=first_virt )
                                        --tcur_virt;
                }
@@ -1185,7 +1184,7 @@ static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__
        {
                /*** called by change operation, user really expects ***/
                /* the effect of the eE commands, so back up to end of word */
-               while( end>begin && isblank(end-1) )
+               while( end>begin && kshisblank(end-1) )
                        --end;
                if( end == begin )
                        ++end;
@@ -1220,13 +1219,13 @@ static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __O
        register int tcur_virt = cur_virt;
        while( nwords-- )
        {
-               if( !isblank(tcur_virt) && tcur_virt<=last_virt )
+               if( !kshisblank(tcur_virt) && tcur_virt<=last_virt )
                        ++tcur_virt;
-               while( isblank(tcur_virt) && tcur_virt<=last_virt )
+               while( kshisblank(tcur_virt) && tcur_virt<=last_virt )
                        ++tcur_virt;    
                if( cmd == 'E' )
                {
-                       while( !isblank(tcur_virt) && tcur_virt<=last_virt )
+                       while( !kshisblank(tcur_virt) && tcur_virt<=last_virt )
                                ++tcur_virt;
                }
                else
@@ -1235,7 +1234,7 @@ static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __O
                                while( isalph(tcur_virt) && tcur_virt<=last_virt )
                                        ++tcur_virt;
                        else
-                               while( !isalph(tcur_virt) && !isblank(tcur_virt)
+                               while( !isalph(tcur_virt) && !kshisblank(tcur_virt)
                                        && tcur_virt<=last_virt )
                                        ++tcur_virt;
                }
@@ -1258,7 +1257,7 @@ static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __O
        {
                if( cmd == 'W' )
                {
-                       while( !isblank(tcur_virt) && tcur_virt < last_virt )
+                       while( !kshisblank(tcur_virt) && tcur_virt < last_virt )
                                ++tcur_virt;
                }
                else
@@ -1270,12 +1269,12 @@ static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __O
                        }
                        else
                        {
-                               while( !isalph(tcur_virt) && !isblank(tcur_virt)
+                               while( !isalph(tcur_virt) && !kshisblank(tcur_virt)
                                        && tcur_virt < last_virt )
                                        ++tcur_virt;
                        }
                }
-               while( isblank(tcur_virt) && tcur_virt < last_virt )
+               while( kshisblank(tcur_virt) && tcur_virt < last_virt )
                        ++tcur_virt;
        }
        cur_virt = tcur_virt;
@@ -2528,7 +2527,7 @@ yankeol:
     }
 
 
-    static int isblank __PARAM__((register int c), (c)) __OTORP__(register int c;){
+    static int kshisblank __PARAM__((register int c), (c)) __OTORP__(register int c;){
        register int v = virtual[c];
        return((v&~STRIP)==0 && isspace(v));
     }
index 0ad74319c07d874e2ee411b79c966693d5d8bf81..9eaf79214f7c39c823fa9c15bff3743a93f2de96 100644 (file)
@@ -176,7 +176,7 @@ extern __MANGLE__ void      sh_siginit __PROTO__((void));
 extern __MANGLE__ void         sh_sigtrap __PROTO__((int));
 extern __MANGLE__ void         sh_sigreset __PROTO__((int));
 extern __MANGLE__ void         sh_timetraps __PROTO__((void));
-extern __MANGLE__ __V_         *timeradd __PROTO__((unsigned long,int ,void (*)(__V_*),__V_*));
+extern __MANGLE__ __V_         *kshtimeradd __PROTO__((unsigned long,int ,void (*)(__V_*),__V_*));
 extern __MANGLE__ void timerdel __PROTO__((__V_*));
 
 extern __MANGLE__ const char e_alarm[];
index 4d8587c4b2e71defdf9ad7d0131fa1ad643b46d5..f3f87494ed3576f8e381c360c0ddc0b415f2e540 100644 (file)
@@ -964,7 +964,7 @@ static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t
        if(io_prompt(sh.nextprompt)<0 && errno==EIO)
                return(0);
        if(sh.timeout)
-               timeout = (__V_*)timeradd(sh_isstate(SH_GRACE)?1000L*TGRACE:1000L*sh.timeout,0,time_grace,NIL(__V_*));
+               timeout = (__V_*)kshtimeradd(sh_isstate(SH_GRACE)?1000L*TGRACE:1000L*sh.timeout,0,time_grace,NIL(__V_*));
 #   ifdef SHOPT_ESH
        if(sh_isoption(SH_EMACS|SH_GMACS))
                readf = ed_emacsread;
index 1f18785c4e2e806789e63d3abefb69afd7d4d75e..13f4c94ecb9786dd4f3b0e7b45ea0823a39980d3 100644 (file)
@@ -236,7 +236,7 @@ static void oldalrm __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;)
        (*fn)(SIGALRM);
 }
        
-__V_ *timeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),__V_ *handle), (msec, flags, action, handle)) __OTORP__(unsigned long msec;int flags;void (*action)();__V_ *handle;){
+__V_ *kshtimeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),__V_ *handle), (msec, flags, action, handle)) __OTORP__(unsigned long msec;int flags;void (*action)();__V_ *handle;){
        register Timer_t *tp;
        double t;
        Handler_t fn;
@@ -260,7 +260,7 @@ __V_ *timeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),__V
                        if(hp)
                        {
                                *hp = fn;
-                               timeradd((long)(1000*t), 0, oldalrm, (__V_*)hp);
+                               kshtimeradd((long)(1000*t), 0, oldalrm, (__V_*)hp);
                        }
                }
                tp = tptop;
index a6cf4c4cb7ab69d0ec334d5270483918d222432e..3736c0d4105eccc69795bc9275b14ed26d566df3 100644 (file)
@@ -1322,7 +1322,7 @@ pid_t _sh_fork __PARAM__((register pid_t parent,int flags,int *jobid), (parent,
                        error(ERROR_system(ERROR_NOEXEC),e_nofork);
                }
                sh_sigcheck();
-               timeout = (__V_*)timeradd(forkcnt, 0, timed_out, NIL(__V_*));
+               timeout = (__V_*)kshtimeradd(forkcnt, 0, timed_out, NIL(__V_*));
                job_wait((pid_t)-1);
                if(timeout)
                {
index b1b5eff4d497b64849e5eab570148ea1a8c65cb7..d09af247b6b10446e3c201763de5ca605dca1f82 100644 (file)
@@ -112,7 +112,7 @@ hashalloc __PARAM__((Hash_table_t* ref, ...), (va_alist)) __OTORP__(va_dcl)
        register Hash_table_t*  ret = 0;
        register int            internal;
        int                     n;
-       va_list                 ap;
+       va_list                 ap, vl;
        va_list                 va[4];
        va_list*                vp = va;
        HASHregion              region = 0;
@@ -214,27 +214,19 @@ hashalloc __PARAM__((Hash_table_t* ref, ...), (va_alist)) __OTORP__(va_dcl)
                        tab->flags |= HASH_STATIC;
                        break;
                case HASH_va_list:
-#ifdef __ppc
                        if (vp < &va[elementsof(va)])
                        {
                                __va_copy( *vp, ap );
                                vp++;
                        }
-                       __va_copy(ap, *((va_list *) va_arg(ap, va_list)) );
-#else
-                       if (vp < &va[elementsof(va)]) *vp++ = ap;
-                       ap = va_arg(ap, va_list);
-#endif
+                       vl = va_arg(ap, va_list);
+                       __va_copy(ap, vl);
                        break;
                case 0:
                        if (vp > va)
                        {
-#ifdef __ppc
                                vp--;
                                __va_copy( ap, *vp );
-#else
-                               ap = *--vp;
-#endif
                                break;
                        }
                        if (tab->flags & HASH_SCOPE)
index 233efd7973f2119786ec147291beefc669b49311..7133fb71e6d2ba9e69d03f743b04d56db58a3817 100644 (file)
@@ -285,8 +285,6 @@ initialize __PARAM__((register Feature_t* fp, const char* path, const char* comm
 
        if (fp->op != OP_path_resolve || !fs3d(FS3D_TEST))
        {
-               if (fp->op == OP_universe)
-                       ok = streq(_UNIV_DEFAULT, "att");
                if (p = getenv("PATH"))
                {
                        register int    r = 1;
@@ -402,12 +400,6 @@ feature __PARAM__((const char* name, const char* path, const char* value), (name
                break;
 
        case OP_universe:
-#if _lib_universe
-               if (getuniverse(fp->value) < 0)
-                       strcpy(fp->value, "att");
-               if (value)
-                       setuniverse(value);
-#else
 #ifdef UNIV_MAX
                n = 0;
                if (value)
@@ -417,20 +409,13 @@ feature __PARAM__((const char* name, const char* path, const char* value), (name
                        if (n >= univ_max)
                                return(0);
                }
-#ifdef ATT_UNIV
-               n = setuniverse(n + 1);
-               if (!value && n > 0)
-                       setuniverse(n);
-#else
                n = universe(value ? n + 1 : U_GET);
-#endif
                if (n <= 0 || n >= univ_max)
                        n = 1;
                strcpy(fp->value, univ_name[n - 1]);
 #else
                if (!synthesize(fp, path, value))
                        initialize(fp, path, "echo", "att", "ucb");
-#endif
 #endif
                break;
 
index d8683001c2ad174e89f564091620c673d4774bb0..a95084bb7ceb8f5b043de86d8c101449b2791910 100644 (file)
@@ -90,7 +90,6 @@
                goto pop_fa; \
          else  elt = (etype)arge; \
        }
-#ifdef __ppc
 #define GETARGL(elt,arge,argf,args,etype,type,fmt,t_user,n_user) \
        { if(!argf) \
                __va_copy( elt, va_arg(args,type) ); \
@@ -98,7 +97,6 @@
                goto pop_fa; \
          else  __va_copy( elt, arge ); \
        }
-#endif
 
 #if __STD_C
 sfvprintf(Sfio_t* f, const char* form, va_list args)
@@ -303,15 +301,9 @@ loop_fa :
                        GETARG(form,form,argf,args,char*,char*,'1',t_user,n_user);
                        if(!form)
                                form = "";
-#ifdef __ppc
                        GETARGL(argsp,argsp,argf,args,va_list*,va_list*,'2',t_user,n_user);
                        __va_copy( fa->args, args );
                        __va_copy( args, argsp );
-#else
-                       GETARG(argsp,argsp,argf,args,va_list*,va_list*,'2',t_user,n_user);
-                       memcpy((Void_t*)(&(fa->args)), (Void_t*)(&args), sizeof(va_list));
-                       memcpy((Void_t*)(&args), (Void_t*)argsp, sizeof(va_list));
-#endif
                        fa->argf.p = argf;
                        fa->extf.p = extf;
                        fa->next = fast;
@@ -321,12 +313,8 @@ loop_fa :
                default :       /* unknown directive */
                        if(extf)
                        {
-#ifdef __ppc
                                va_list savarg;         /* is this portable?   Sorry .. NO. */
                                __va_copy( savarg, args );
-#else
-                               va_list savarg = args;  /* is this portable? */
-#endif
 
                                GETARG(sp,astr,argf,args,char*,char*,fmt,t_user,n_user);
                                astr = NIL(char*);
@@ -334,11 +322,7 @@ loop_fa :
                                if((sp = astr) )
                                        goto s_format;
 
-#ifdef __ppc
                                __va_copy( args, savarg ); /* extf failed, treat as if unmatched */
-#else
-                               args = savarg;  /* extf failed, treat as if unmatched */
-#endif
                        }
 
                        /* treat as text */
index f65a7d6b794bbbdf942672c54f7a85e6eaab326e..3316b904e44942664c0458cebc4069659415ff44 100644 (file)
@@ -228,11 +228,7 @@ tokscan __PARAM__((register char* s, char** nxt, const char* fmt, ...), (va_alis
                if (f = prv_f)
                {
                        prv_f = 0;
-#ifdef __ppc
                        __va_copy( ap, prv_ap );
-#else
-                       ap = prv_ap;
-#endif
                        continue;
                }
                goto done;
@@ -261,15 +257,9 @@ tokscan __PARAM__((register char* s, char** nxt, const char* fmt, ...), (va_alis
                case ':':
                        prv_f = f;
                        f = va_arg(ap, char*);
-#ifdef __ppc
                        __va_copy( prv_ap, ap );
-                       pap = va_arg(ap, va_list*)) );
-                       __va_copy( ap, pap );
-#else
-                       prv_ap = ap;
                        pap = va_arg(ap, va_list*);
-                       memcpy(&ap, pap, sizeof(ap));
-#endif
+                       __va_copy( ap, pap );
                        continue;
                case 'c':
                        p_char = va_arg(ap, char*);
index 1a8282863da381995277a6f9c17e71d44ac5fa16..351c52d8cce65ec66d8dbb96d6eaf29898cd393b 100644 (file)
@@ -171,12 +171,12 @@ static int Text_Widget(
                         int argc,
                         char *argv[]) ;
 static int Text_VarAndWidget( 
-                        int (*func)(),
+                        int (*func)(Widget w),
                         Boolean varIsString,
                         int argc,
                         char *argv[]) ;
 static int Text_WidgetAndBoolean( 
-                        void (*func)(),
+                        void (*func)(Widget w, int b),
                         int argc,
                         char *argv[]) ;
 static int Text_WidgetAndOneParam( 
@@ -3737,7 +3737,8 @@ do_catopen(
    char * ptr;
    nl_catd nlmsg_fd = (nl_catd)-1;
    char * errmsg;
-#if defined(SVR4) || defined (_AIX) || defined(sco) || defined(DEC)
+#if defined(SVR4) || defined (_AIX) || defined(sco) || defined(DEC) || \
+    defined(CSRG_BASED) || defined(linux)
    char * nextMatch;
 #endif
 
@@ -3761,7 +3762,8 @@ do_catopen(
        */
 
       altCatName = XtMalloc(strlen(catName) + 10);
-#if defined(SVR4) || defined (_AIX) || defined(sco) || defined(DEC)
+#if defined(SVR4) || defined (_AIX) || defined(sco) || defined(DEC) || \
+    defined(CSRG_BASED) || defined(linux)
       /* These platforms don't have strrstr() */
       ptr = NULL;
       nextMatch = catName;
@@ -3965,7 +3967,7 @@ do_XmTextRemove(
 
 static int
 Text_VarAndWidget(
-        int (*func)(),
+        int (*func)(Widget w),
         Boolean varIsString,
         int argc,
         char *argv[] )
@@ -4077,7 +4079,7 @@ do_XmTextGetString(
 
 static int
 Text_WidgetAndBoolean(
-        void (*func)(),
+        void (*func)(Widget w, int b),
         int argc,
         char *argv[] )
 {
index 106e07276c69c3bb7c7f8b4ff37501ab75a78ebb..5635275aec8af4d03182b602b4c8d116101eff9c 100644 (file)
@@ -42,6 +42,7 @@
 #ifndef _Dtksh_xmdtksym_h
 #define _Dtksh_xmdtksym_h
 
+#include "exksh.h"
 
 extern struct symarray Symarray[];
 extern int Symsize;