src/commands/sh/sh.h File Reference

#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>

Go to the source code of this file.

Classes

struct  op
struct  brkcon
struct  ioword
struct  env
struct  var
struct  iobuf
struct  ioarg
struct  io
struct  wdblock

Defines

#define _VOID
#define LINELIM   4096
#define NPUSH   8
#define NOFILE   20
#define NUFILE   10
#define FDBASE   10
#define WAITSIG(s)   ((s)&0177)
#define WAITVAL(s)   (((s)>>8)&0377)
#define WAITCORE(s)   (((s)&0200)!=0)
#define QUOTE   0200
#define NOBLOCK   ((struct op *)NULL)
#define NOWORD   ((char *)NULL)
#define NOWORDS   ((char **)NULL)
#define NOPIPE   ((int *)NULL)
#define TCOM   1
#define TPAREN   2
#define TPIPE   3
#define TLIST   4
#define TOR   5
#define TAND   6
#define TFOR   7
#define TDO   8
#define TCASE   9
#define TIF   10
#define TWHILE   11
#define TUNTIL   12
#define TELIF   13
#define TPAT   14
#define TBRACE   15
#define TASYNC   16
#define BIT(i)   (1<<(i))
#define FEXEC   BIT(0)
#define DOSUB   1
#define DOBLANK   2
#define DOGLOB   4
#define DOKEY   8
#define DOTRIM   16
#define DOALL   (DOSUB|DOBLANK|DOGLOB|DOKEY|DOTRIM)
#define IOREAD   1
#define IOHERE   2
#define IOWRITE   4
#define IOCAT   8
#define IOXHERE   16
#define IODUP   32
#define IOCLOSE   64
#define IODEFAULT   (-1)
#define COPYV   1
#define RONLY   01
#define EXPORT   02
#define GETCELL   04
#define AFID_NOBUF   (~0)
#define AFID_ID   0
#define XOTHER   0
#define XDOLL   1
#define XGRAVE   2
#define XIO   3
#define INSUB()   (e.iop->task == XGRAVE || e.iop->task == XDOLL)
#define PUSHIO(what, arg, gen)   ((temparg.what = (arg)),pushio(&temparg,(gen)))
#define RUN(what, arg, gen)   ((temparg.what = (arg)), run(&temparg,(gen)))
#define WORD_H   1
#define NEW(type)   (type *)getcell(sizeof(type))
#define DELETE(obj)   freecell((char *)obj)

Typedefs

typedef char * xint

Functions

int(*)() inbuilt ()
 _PROTOTYPE (char *rexecve,(char *c, char **v, char **envp))
 _PROTOTYPE (char *space,(int n))
 _PROTOTYPE (char *strsave,(char *s, int a))
 _PROTOTYPE (char *evalstr,(char *cp, int f))
 _PROTOTYPE (char *itoa,(unsigned u, int n))
 _PROTOTYPE (char *unquote,(char *as))
 _PROTOTYPE (struct var *lookup,(char *n))
 _PROTOTYPE (int rlookup,(char *n))
 _PROTOTYPE (struct wdblock *glob,(char *cp, struct wdblock *wb))
 _PROTOTYPE (int subgetc,(int ec, int quoted))
 _PROTOTYPE (char **makenv,(void))
 _PROTOTYPE (char **eval,(char **ap, int f))
 _PROTOTYPE (int setstatus,(int s))
 _PROTOTYPE (int waitfor,(int lastpid, int canintr))
 _PROTOTYPE (void onintr,(int s))
 _PROTOTYPE (int newenv,(int f))
 _PROTOTYPE (void quitenv,(void))
 _PROTOTYPE (void err,(char *s))
 _PROTOTYPE (int anys,(char *s1, char *s2))
 _PROTOTYPE (int any,(int c, char *s))
 _PROTOTYPE (void next,(int f))
 _PROTOTYPE (void runtrap,(int i))
 _PROTOTYPE (int letter,(int c))
 _PROTOTYPE (int gmatch,(char *s, char *p))
 _PROTOTYPE (int yyparse,(void))
 _PROTOTYPE (void setval,(struct var *vp, char *val))
 _PROTOTYPE (void nameval,(struct var *vp, char *val, char *name))
 _PROTOTYPE (void export,(struct var *vp))
 _PROTOTYPE (int isassign,(char *s))
 _PROTOTYPE (int checkname,(char *cp))
 _PROTOTYPE (int assign,(char *s, int cf))
 _PROTOTYPE (void putvlist,(int f, int out))
 _PROTOTYPE (int eqname,(char *n1, char *n2))
 _PROTOTYPE (int execute,(struct op *t, int *pin, int *pout, int act))
 _PROTOTYPE (int nlchar,(struct ioarg *ap))
 _PROTOTYPE (int gravechar,(struct ioarg *ap, struct io *iop))
 _PROTOTYPE (void freehere,(int area))
 _PROTOTYPE (void markhere,(char *s, struct ioword *iop))
 _PROTOTYPE (int herein,(char *hname, int xdoll))
 _PROTOTYPE (int run,(struct ioarg *argp, int(*f)(_VOID)))
 _PROTOTYPE (int getc,(int ec))
 _PROTOTYPE (void unget,(int c))
 _PROTOTYPE (void prn,(unsigned u))
 _PROTOTYPE (void pushio,(struct ioarg *argp, int(*fn)(_VOID)))
 _PROTOTYPE (int remap,(int fd))
 _PROTOTYPE (int openpipe,(int *pv))
 _PROTOTYPE (void closepipe,(int *pv))
 _PROTOTYPE (struct io *setbase,(struct io *ip))
 _PROTOTYPE (struct wdblock *addword,(char *wd, struct wdblock *wb))
 _PROTOTYPE (struct wdblock *newword,(int nw))
 _PROTOTYPE (char **getwords,(struct wdblock *wb))
 _PROTOTYPE (char *getcell,(unsigned nbytes))
 _PROTOTYPE (void setarea,(char *cp, int a))
 _PROTOTYPE (void freearea,(int a))
 _PROTOTYPE (void freecell,(char *cp))

Variables

Extern char ** dolv
Extern int dolc
Extern int exstat
Extern char gflg
Extern int talking
Extern int execflg
Extern int multiline
Extern struct opouttree
Extern xintfailpt
Extern xinterrpt
Extern struct brkconbrklist
Extern int isbreak
Extern struct wdblockwdlist
Extern struct wdblockiolist
struct env e
char * flag
char * null
int intr
Extern char * trap [_NSIG+1]
Extern char ourtrap [_NSIG+1]
Extern int trapset
int heedint
Extern int yynerrs
Extern char line [LINELIM]
char * elinep
Extern struct varvlist
Extern struct varhomedir
Extern struct varprompt
Extern struct varcprompt
Extern struct varpath
Extern struct varshell
Extern struct varifs
Extern struct ioarg ioargstack [NPUSH]
Extern struct io iostack [NPUSH]
struct ioarg temparg
Extern int areanum


Define Documentation

#define _VOID

Definition at line 9 of file sh.h.

#define AFID_ID   0

Definition at line 285 of file sh.h.

#define AFID_NOBUF   (~0)

Definition at line 284 of file sh.h.

#define BIT ( i   )     (1<<(i))

Definition at line 88 of file sh.h.

#define COPYV   1

Definition at line 237 of file sh.h.

#define DELETE ( obj   )     freecell((char *)obj)

Definition at line 383 of file sh.h.

#define DOALL   (DOSUB|DOBLANK|DOGLOB|DOKEY|DOTRIM)

Definition at line 100 of file sh.h.

#define DOBLANK   2

Definition at line 95 of file sh.h.

#define DOGLOB   4

Definition at line 96 of file sh.h.

#define DOKEY   8

Definition at line 97 of file sh.h.

#define DOSUB   1

Definition at line 94 of file sh.h.

#define DOTRIM   16

Definition at line 98 of file sh.h.

#define EXPORT   02

Definition at line 239 of file sh.h.

#define FDBASE   10

Definition at line 22 of file sh.h.

#define FEXEC   BIT(0)

Definition at line 89 of file sh.h.

#define GETCELL   04

Definition at line 240 of file sh.h.

 
#define INSUB (  )     (e.iop->task == XGRAVE || e.iop->task == XDOLL)

Definition at line 304 of file sh.h.

#define IOCAT   8

Definition at line 132 of file sh.h.

#define IOCLOSE   64

Definition at line 135 of file sh.h.

#define IODEFAULT   (-1)

Definition at line 137 of file sh.h.

#define IODUP   32

Definition at line 134 of file sh.h.

#define IOHERE   2

Definition at line 130 of file sh.h.

#define IOREAD   1

Definition at line 129 of file sh.h.

#define IOWRITE   4

Definition at line 131 of file sh.h.

#define IOXHERE   16

Definition at line 133 of file sh.h.

#define LINELIM   4096

Definition at line 17 of file sh.h.

#define NEW ( type   )     (type *)getcell(sizeof(type))

Definition at line 382 of file sh.h.

#define NOBLOCK   ((struct op *)NULL)

Definition at line 50 of file sh.h.

#define NOFILE   20

Definition at line 20 of file sh.h.

#define NOPIPE   ((int *)NULL)

Definition at line 53 of file sh.h.

#define NOWORD   ((char *)NULL)

Definition at line 51 of file sh.h.

#define NOWORDS   ((char **)NULL)

Definition at line 52 of file sh.h.

#define NPUSH   8

Definition at line 18 of file sh.h.

#define NUFILE   10

Definition at line 21 of file sh.h.

#define PUSHIO ( what,
arg,
gen   )     ((temparg.what = (arg)),pushio(&temparg,(gen)))

Definition at line 350 of file sh.h.

#define QUOTE   0200

Definition at line 48 of file sh.h.

#define RONLY   01

Definition at line 238 of file sh.h.

#define RUN ( what,
arg,
gen   )     ((temparg.what = (arg)), run(&temparg,(gen)))

Definition at line 351 of file sh.h.

#define TAND   6

Definition at line 73 of file sh.h.

#define TASYNC   16

Definition at line 83 of file sh.h.

#define TBRACE   15

Definition at line 82 of file sh.h.

#define TCASE   9

Definition at line 76 of file sh.h.

#define TCOM   1

Definition at line 68 of file sh.h.

#define TDO   8

Definition at line 75 of file sh.h.

#define TELIF   13

Definition at line 80 of file sh.h.

#define TFOR   7

Definition at line 74 of file sh.h.

#define TIF   10

Definition at line 77 of file sh.h.

#define TLIST   4

Definition at line 71 of file sh.h.

#define TOR   5

Definition at line 72 of file sh.h.

#define TPAREN   2

Definition at line 69 of file sh.h.

#define TPAT   14

Definition at line 81 of file sh.h.

#define TPIPE   3

Definition at line 70 of file sh.h.

#define TUNTIL   12

Definition at line 79 of file sh.h.

#define TWHILE   11

Definition at line 78 of file sh.h.

#define WAITCORE ( s   )     (((s)&0200)!=0)

Definition at line 29 of file sh.h.

#define WAITSIG ( s   )     ((s)&0177)

Definition at line 27 of file sh.h.

#define WAITVAL ( s   )     (((s)>>8)&0377)

Definition at line 28 of file sh.h.

#define WORD_H   1

Definition at line 355 of file sh.h.

#define XDOLL   1

Definition at line 299 of file sh.h.

#define XGRAVE   2

Definition at line 300 of file sh.h.

#define XIO   3

Definition at line 301 of file sh.h.

#define XOTHER   0

Definition at line 298 of file sh.h.


Typedef Documentation

typedef char* xint

Definition at line 37 of file sh.h.


Function Documentation

_PROTOTYPE ( void  freecell,
(char *cp  
)

_PROTOTYPE ( void  freearea,
(int a  
)

_PROTOTYPE ( void  setarea,
(char *cp, int a  
)

_PROTOTYPE ( char *  getcell,
(unsigned nbytes)   
)

_PROTOTYPE ( char **  getwords,
(struct wdblock *wb)   
)

_PROTOTYPE ( struct wdblock newword,
(int nw)   
)

_PROTOTYPE ( struct wdblock addword,
(char *wd, struct wdblock *wb)   
)

_PROTOTYPE ( struct io setbase,
(struct io *ip)   
)

_PROTOTYPE ( void  closepipe,
(int *pv)   
)

_PROTOTYPE ( int  openpipe,
(int *pv)   
)

_PROTOTYPE ( int  remap,
(int fd  
)

_PROTOTYPE ( void  pushio,
(struct ioarg *argp, int(*fn)(_VOID))   
)

_PROTOTYPE ( void  prn,
(unsigned u)   
)

_PROTOTYPE ( void  unget,
(int c  
)

_PROTOTYPE ( int  getc,
(int ec)   
)

_PROTOTYPE ( int  run,
(struct ioarg *argp, int(*f)(_VOID))   
)

_PROTOTYPE ( int  herein,
(char *hname, int xdoll)   
)

_PROTOTYPE ( void  markhere,
(char *s, struct ioword *iop)   
)

_PROTOTYPE ( void  freehere,
(int area)   
)

_PROTOTYPE ( int  gravechar,
(struct ioarg *ap, struct io *iop)   
)

_PROTOTYPE ( int  nlchar,
(struct ioarg *ap)   
)

_PROTOTYPE ( int  execute,
(struct op *t, int *pin, int *pout, int act  
)

_PROTOTYPE ( int  eqname,
(char *n1, char *n2)   
)

_PROTOTYPE ( void  putvlist,
(int f, int out)   
)

_PROTOTYPE ( int  assign,
(char *s, int cf)   
)

_PROTOTYPE ( int  checkname,
(char *cp  
)

_PROTOTYPE ( int  isassign,
(char *s  
)

_PROTOTYPE ( void  export,
(struct var *vp)   
)

_PROTOTYPE ( void  nameval,
(struct var *vp, char *val, char *name  
)

_PROTOTYPE ( void  setval,
(struct var *vp, char *val  
)

_PROTOTYPE ( int  yyparse,
(void)   
)

_PROTOTYPE ( int  gmatch,
(char *s, char *p  
)

_PROTOTYPE ( int  letter,
(int c  
)

_PROTOTYPE ( void  runtrap,
(int i  
)

_PROTOTYPE ( void  next,
(int f  
)

_PROTOTYPE ( int  any,
(int c, char *s  
)

_PROTOTYPE ( int  anys,
(char *s1, char *s2)   
)

_PROTOTYPE ( void  err,
(char *s  
)

_PROTOTYPE ( void  quitenv,
(void)   
)

_PROTOTYPE ( int  newenv,
(int f  
)

_PROTOTYPE ( void  onintr,
(int s  
)

_PROTOTYPE ( int  waitfor,
(int lastpid, int canintr)   
)

_PROTOTYPE ( int  setstatus,
(int s  
)

_PROTOTYPE ( char **  eval,
(char **ap, int f  
)

_PROTOTYPE ( char **  makenv,
(void)   
)

_PROTOTYPE ( int  subgetc,
(int ec, int quoted)   
)

_PROTOTYPE ( struct wdblock glob,
(char *cp, struct wdblock *wb)   
)

_PROTOTYPE ( int  rlookup,
(char *n  
)

_PROTOTYPE ( struct var lookup,
(char *n  
)

_PROTOTYPE ( char *  unquote,
(char *as  
)

_PROTOTYPE ( char *  itoa,
(unsigned u, int n  
)

_PROTOTYPE ( char *  evalstr,
(char *cp, int f  
)

_PROTOTYPE ( char *  strsave,
(char *s, int a  
)

_PROTOTYPE ( char *  space,
(int n  
)

_PROTOTYPE ( char *  rexecve,
(char *c, char **v, char **envp  
)

int(*)() inbuilt (  ) 


Variable Documentation

Extern int areanum

Definition at line 380 of file sh.h.

Extern struct brkcon* brklist

Definition at line 118 of file sh.h.

Extern struct var* cprompt

Definition at line 246 of file sh.h.

Extern int dolc

Definition at line 103 of file sh.h.

Extern char** dolv

Definition at line 102 of file sh.h.

struct env e

char* elinep

Definition at line 18 of file sh1.c.

Extern xint* errpt

Definition at line 112 of file sh.h.

Extern int execflg

Definition at line 107 of file sh.h.

Extern int exstat

Definition at line 104 of file sh.h.

Extern xint* failpt

Definition at line 111 of file sh.h.

char* flag

Definition at line 17 of file sh1.c.

Extern char gflg

Definition at line 105 of file sh.h.

int heedint

Definition at line 20 of file sh1.c.

Extern struct var* homedir

Definition at line 244 of file sh.h.

Extern struct var* ifs

Definition at line 249 of file sh.h.

int intr

Definition at line 14 of file sh1.c.

Extern struct ioarg ioargstack[NPUSH]

Definition at line 283 of file sh.h.

Extern struct wdblock* iolist

Definition at line 140 of file sh.h.

Extern struct io iostack[NPUSH]

Definition at line 297 of file sh.h.

Extern int isbreak

Definition at line 119 of file sh.h.

Extern char line[LINELIM]

Definition at line 177 of file sh.h.

Extern int multiline

Definition at line 108 of file sh.h.

char* null

Definition at line 114 of file main.c.

Extern char ourtrap[_NSIG+1]

Definition at line 170 of file sh.h.

Extern struct op* outtree

Definition at line 109 of file sh.h.

Extern struct var* path

Definition at line 247 of file sh.h.

Extern struct var* prompt

Definition at line 245 of file sh.h.

Extern struct var* shell

Definition at line 248 of file sh.h.

Extern int talking

Definition at line 106 of file sh.h.

struct ioarg temparg

Definition at line 19 of file sh5.c.

Extern char* trap[_NSIG+1]

Definition at line 169 of file sh.h.

Extern int trapset

Definition at line 171 of file sh.h.

Extern struct var* vlist

Definition at line 242 of file sh.h.

Extern struct wdblock* wdlist

Definition at line 139 of file sh.h.

Extern int yynerrs

Definition at line 175 of file sh.h.


Generated on Tue Mar 9 04:36:37 2010 for Minix by  doxygen 1.5.8