#include <stdlib.h>
#include "defs.h"
-LOCAL STRING *copyargs();
-LOCAL DOLPTR dolh;
+static STRING *copyargs();
+static DOLPTR dolh;
CHAR flagadr[10];
return(argr);
}
-LOCAL STRING * copyargs(from, n)
+static STRING * copyargs(from, n)
STRING from[];
{
REG STRING * np=(STRING *)alloc(sizeof(STRING*)*n+3*BYTESPERWORD);
#include "defs.h"
#include "sym.h"
-LOCAL IOPTR inout();
-LOCAL void chkword();
-LOCAL void chksym();
-LOCAL TREPTR term();
-LOCAL TREPTR makelist();
-LOCAL TREPTR list();
-LOCAL REGPTR syncase();
-LOCAL TREPTR item();
-LOCAL int skipnl();
-LOCAL void prsym();
-LOCAL void synbad();
+static IOPTR inout();
+static void chkword();
+static void chksym();
+static TREPTR term();
+static TREPTR makelist();
+static TREPTR list();
+static REGPTR syncase();
+static TREPTR item();
+static int skipnl();
+static void prsym();
+static void synbad();
/* ======== command line decoding ========*/
return(TREPTR)(t);
}
-LOCAL TREPTR makelist(type,i,r)
+static TREPTR makelist(type,i,r)
INT type;
TREPTR i, r;
{
* list || term
*/
-LOCAL TREPTR list(flg)
+static TREPTR list(flg)
{
REG TREPTR r;
REG INT b;
* item |^ term
*/
-LOCAL TREPTR term(flg)
+static TREPTR term(flg)
{
REG TREPTR t;
FI
}
-LOCAL REGPTR syncase(esym)
+static REGPTR syncase(esym)
REG INT esym;
{
skipnl();
* begin ... end
*/
-LOCAL TREPTR item(flag)
+static TREPTR item(flag)
BOOL flag;
{
REG TREPTR t;
}
-LOCAL int skipnl()
+static int skipnl()
{
WHILE (reserv++, word()==NL) DO chkpr(NL) OD
return(wdval);
}
-LOCAL IOPTR inout(lastio)
+static IOPTR inout(lastio)
IOPTR lastio;
{
REG INT iof;
return(iop);
}
-LOCAL void chkword()
+static void chkword()
{
IF word()
THEN synbad();
FI
}
-LOCAL void chksym(sym)
+static void chksym(sym)
{
REG INT x = sym&wdval;
IF ((x&SYMFLG) ? x : sym) != wdval
FI
}
-LOCAL void prsym(sym)
+static void prsym(sym)
{
IF sym&SYMFLG
THEN REG SYSPTR sp=reserved;
FI
}
-LOCAL void synbad()
+static void synbad()
{
prp(); prs(synmsg);
IF (flags&ttyflg)==0
*
*/
-LOCAL void addg();
+static void addg();
INT expand(as,rflg)
ENDSW
}
-LOCAL void addg(as1,as2,as3)
+static void addg(as1,as2,as3)
STRING as1, as2, as3;
{
REG STRING s1, s2;
*
*/
-#define LOCAL static
#define PROC extern
#define TYPE typedef
#define STRUCT TYPE struct
#include "defs.h"
#include "sym.h"
-LOCAL CHAR quote; /* used locally */
-LOCAL CHAR quoted; /* used locally */
+static CHAR quote; /* used locally */
+static CHAR quoted; /* used locally */
-LOCAL getch();
-LOCAL comsubst();
-LOCAL flush();
+static getch();
+static comsubst();
+static flush();
-LOCAL STRING copyto(endch)
+static STRING copyto(endch)
REG CHAR endch;
{
REG CHAR c;
IF c!=endch THEN error(badsub) FI
}
-LOCAL skipto(endch)
+static skipto(endch)
REG CHAR endch;
{
/* skip chars up to } */
IF c!=endch THEN error(badsub) FI
}
-LOCAL getch(endch)
+static getch(endch)
CHAR endch;
{
REG CHAR d;
return(fixstak());
}
-LOCAL comsubst()
+static comsubst()
{
/* command substn */
FILEBLK cb;
pop();
}
-LOCAL flush(ot)
+static flush(ot)
{
write(ot,stakbot,staktop-stakbot);
IF flags&execpr THEN write(output,stakbot,staktop-stakbot) FI
#include <sys/stat.h>
UFD output = 2;
-LOCAL BOOL beenhere = FALSE;
+static BOOL beenhere = FALSE;
CHAR tmpout[20] = "/tmp/sh-";
FILEBLK stdfile;
FILE standin = &stdfile;
-LOCAL void exfile();
+static void exfile();
done();
}
-LOCAL void exfile(prof)
+static void exfile(prof)
BOOL prof;
{
REG L_INT mailtime = 0;
#include "defs.h"
-LOCAL BOOL chkid();
-LOCAL void namwalk();
+static BOOL chkid();
+static void namwalk();
NAMNOD ps2nod = {(NAMPTR)NIL, (NAMPTR)NIL, ps2name},
return(*prev = nscan);
}
-LOCAL BOOL chkid(nam)
+static BOOL chkid(nam)
STRING nam;
{
REG CHAR * cp=nam;
return(TRUE);
}
-LOCAL void (*namfn)();
+static void (*namfn)();
namscan(fn)
void (*fn)();
{
namwalk(namep);
}
-LOCAL void namwalk(np)
+static void namwalk(np)
REG NAMPTR np;
{
IF np
FI
}
-LOCAL STRING staknam(n)
+static STRING staknam(n)
REG NAMPTR n;
{
REG STRING p;
DO setname(*e++, N_ENVNAM) OD
}
-LOCAL INT namec;
+static INT namec;
void countnam(n)
NAMPTR n;
namec++;
}
-LOCAL STRING *argnam;
+static STRING *argnam;
void pushnam(n)
NAMPTR n;
#include "defs.h"
-LOCAL STRING execs();
-LOCAL void gsort();
-LOCAL INT split();
+static STRING execs();
+static void gsort();
+static INT split();
#define ARGMK 01
return(path);
}
-LOCAL STRING xecmsg;
-LOCAL STRING *xecenv;
+static STRING xecmsg;
+static STRING *xecenv;
void execa(at)
STRING at[];
FI
}
-LOCAL STRING execs(ap,t)
+static STRING execs(ap,t)
STRING ap;
REG STRING t[];
{
/* for processes to be waited for */
#define MAXP 20
-LOCAL INT pwlist[MAXP];
-LOCAL INT pwc;
+static INT pwlist[MAXP];
+static INT pwc;
postclr()
{
return(comargn);
}
-LOCAL void gsort(from,to)
+static void gsort(from,to)
STRING from[], to[];
{
INT k, m, n;
return(count);
}
-LOCAL INT split(s)
+static INT split(s)
REG STRING s;
{
REG STRING argp;
#include "defs.h"
#include "sym.h"
-LOCAL readb();
+static readb();
/* ======== character handling for command lines ========*/
return(c);
}
-LOCAL readb()
+static readb()
{
REG FILE f=standin;
REG INT len;
#include "defs.h"
#include "sym.h"
-LOCAL INT parent;
+static INT parent;
SYSTAB commands;