Ignore:
Timestamp:
Oct 8, 2007, 2:24:31 AM (18 years ago)
Author:
bird
Message:

more fixes - it all compiles now (linking fails of course).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/generated/init.c

    r1212 r1222  
    1818#include "trap.h"
    1919#include "var.h"
    20 
    21 
    22 
    23 #undef  ATABSIZE
    24 #define ATABSIZE 39
     20#include "shinstance.h"
     21
     22
     23
     24#undef  PROFILE
     25#define PROFILE 0
     26#undef  SIGSSIZE
     27#define SIGSSIZE (sizeof(sigs)/sizeof(sigs[0]))
    2528#undef  MAXPWD
    2629#define MAXPWD 256
     
    3336#undef  EV_BACKCMD
    3437#define EV_BACKCMD 04           /* command executing within back quotes */
    35 #undef  CMDTABLESIZE
    36 #define CMDTABLESIZE 31         /* should be prime */
    37 #undef  ARB
    38 #define ARB 1                   /* actual size determined at run time */
    3938#undef  NEWARGS
    4039#define NEWARGS 5
     
    4746#undef  EOF_NLEFT
    4847#define EOF_NLEFT -99           /* value of parsenleft when EOF pushed back */
    49 #undef  MAXMBOXES
    50 #define MAXMBOXES 10
    51 #undef  PROFILE
    52 #define PROFILE 0
    53 #undef  SIGSSIZE
    54 #define SIGSSIZE (sizeof(sigs)/sizeof(sigs[0]))
    55 #undef  MINSIZE
    56 #define MINSIZE 504             /* minimum size of a block */
    5748#undef  DEFINE_OPTIONS
    5849#define DEFINE_OPTIONS
    59 #undef  OUTBUFSIZ
    60 #define OUTBUFSIZ BUFSIZ
    6150#undef  BLOCK_OUT
    6251#define BLOCK_OUT -2            /* output to a fixed block of memory */
    63 #undef  MEM_OUT
    64 #define MEM_OUT -3              /* output to dynamically allocated memory */
    6552#undef  OUTPUT_ERR
    6653#define OUTPUT_ERR 01           /* error occurred on output */
    6754#undef  TEMPSIZE
    68 #define TEMPSIZE 24
     55#define TEMPSIZE 32
    6956#undef  HAVE_VASPRINTF
    7057#define HAVE_VASPRINTF 1
     
    10794#undef  QHINF_MAPSEL
    10895#define QHINF_MAPSEL        8 /* NE only */
    109 #undef  VTABSIZE
    110 #define VTABSIZE 39
    111 #undef  VTABSIZE
    112 #define VTABSIZE 517
    113 #undef  main
    114 #define main echocmd
    115 #undef  main
    116 #define main killcmd
    117 
    118 
    119 
    120 extern void rmaliases(struct shinstance *);
    121 
    122 extern int loopnest;            /* current loop nesting level */
     96#undef  SET_LEN
     97#define SET_LEN 6               /* initial # of bitcmd struct to malloc */
     98#undef  SET_LEN_INCR
     99#define SET_LEN_INCR 4          /* # of bitcmd structs to add as needed */
     100#undef  CMD2_CLR
     101#define CMD2_CLR        0x01
     102#undef  CMD2_SET
     103#define CMD2_SET        0x02
     104#undef  CMD2_GBITS
     105#define CMD2_GBITS      0x04
     106#undef  CMD2_OBITS
     107#define CMD2_OBITS      0x08
     108#undef  CMD2_UBITS
     109#define CMD2_UBITS      0x10
     110#undef  STANDARD_BITS
     111#define STANDARD_BITS   (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
     112
     113
     114
     115extern void rmaliases(shinstance *psh);
    123116
    124117extern void deletefuncs(struct shinstance *);
    125118extern void hash_special_builtins(struct shinstance *);
    126 
    127 struct strpush {
    128         struct strpush *prev;   /* preceding string on stack */
    129         char *prevstring;
    130         int prevnleft;
    131         int prevlleft;
    132         struct alias *ap;       /* if push was associated with an alias */
    133 };
    134 
    135 struct parsefile {
    136         struct parsefile *prev; /* preceding file on stack */
    137         int linno;              /* current line */
    138         int fd;                 /* file descriptor (or -1 if string) */
    139         int nleft;              /* number of chars left in this line */
    140         int lleft;              /* number of chars left in this buffer */
    141         char *nextc;            /* next char in buffer */
    142         char *buf;              /* input buffer */
    143         struct strpush *strpush; /* for pushing strings at this level */
    144         struct strpush basestrpush; /* so pushing one is fast */
    145 };
    146 
    147 extern int parselleft;          /* copy of parsefile->lleft */
    148 extern struct parsefile basepf; /* top level input file */
    149 extern char basebuf[BUFSIZ];    /* buffer for top level input file */
    150 
    151 extern pid_t backgndpid;        /* pid of last background process */
    152 extern int jobctl;
    153 
    154 extern int tokpushback;         /* last token pushed back */
    155 extern int checkkwd;            /* 1 == check for kwds, 2 == also eat newlines */
    156119
    157120struct redirtab {
     
    160123};
    161124
    162 //extern struct redirtab *redirlist;
    163 
    164 extern char sigmode[NSIG];      /* current value of signal */
    165 
    166 extern char **environ;
    167 
    168125
    169126
     
    177134      /* from exec.c: */
    178135      {
    179               hash_special_builtins();
     136              hash_special_builtins(psh);
    180137      }
    181138
    182139      /* from input.c: */
    183140      {
    184               basepf.nextc = basepf.buf = basebuf;
     141              psh->basepf.nextc = psh->basepf.buf = psh->basebuf;
    185142      }
    186143
     
    190147
    191148              initvar(psh);
    192               for (envp = environ ; *envp ; envp++) {
     149              for (envp = sh_environ(psh) ; *envp ; envp++) {
    193150                      if (strchr(*envp, '=')) {
    194151                              setvareq(psh, *envp, VEXPORT|VTEXTFIXED);
     
    226183              psh->out1 = &psh->output;
    227184              psh->out2 = &psh->errout;
    228               if (memout.buf != NULL) {
    229                       ckfree(memout.buf);
    230                       memout.buf = NULL;
     185              if (psh->memout.buf != NULL) {
     186                      ckfree(psh->memout.buf);
     187                      psh->memout.buf = NULL;
    231188              }
    232189      }
     
    278235              psh->backgndpid = -1;
    279236#if JOBS
    280               jobctl = 0;
     237              psh->jobctl = 0;
    281238#endif
    282239      }
     
    286243              int i;
    287244
    288               for (i = 0; optlist[i].name; i++)
    289                       optlist[i].val = 0;
     245              for (i = 0; psh->optlist[i].name; i++)
     246                      psh->optlist[i].val = 0;
    290247              optschanged(psh);
    291248
Note: See TracChangeset for help on using the changeset viewer.