1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtksh: remove register keyword

This commit is contained in:
Jon Trulson 2018-06-27 17:18:06 -06:00
parent 556ce45298
commit 97264ba971
296 changed files with 2503 additions and 2503 deletions

View file

@ -200,11 +200,11 @@ DtCompareISOLatin1(
char *first, char *first,
char *second ) char *second )
{ {
register unsigned char *ap, *bp; unsigned char *ap, *bp;
for (ap = (unsigned char *) first, bp = (unsigned char *) second; for (ap = (unsigned char *) first, bp = (unsigned char *) second;
*ap && *bp; ap++, bp++) { *ap && *bp; ap++, bp++) {
register unsigned char a, b; unsigned char a, b;
if ((a = *ap) != (b = *bp)) { if ((a = *ap) != (b = *bp)) {
/* try lowercasing and try again */ /* try lowercasing and try again */

View file

@ -294,7 +294,7 @@ do_call(
char *p; char *p;
char dorun, promptflag; char dorun, promptflag;
unsigned char freeval, ret_type; unsigned char freeval, ret_type;
register int i, j, ret; int i, j, ret;
char * msg; char * msg;
char * errbuf; char * errbuf;
char * errmsg; char * errmsg;

View file

@ -69,7 +69,7 @@
#include "msgs.h" #include "msgs.h"
#include <locale.h> #include <locale.h>
extern Namval_t *sh_assignok(register Namval_t *np,int add); extern Namval_t *sh_assignok(Namval_t *np,int add);
static void PendingDestroy( static void PendingDestroy(
@ -542,8 +542,8 @@ parse_args(
char ** pargv , char ** pargv ,
Boolean postponePixmaps ) Boolean postponePixmaps )
{ {
register int i; int i;
register char *colon, *resource, *val, *p; char *colon, *resource, *val, *p;
XtArgVal argval; XtArgVal argval;
int freeflag, len; int freeflag, len;
char * errmsg; char * errmsg;
@ -638,7 +638,7 @@ free_args(
int n, int n,
Arg *args ) Arg *args )
{ {
register int i; int i;
/* /*
* Free up argument pointers * Free up argument pointers
@ -700,7 +700,7 @@ _CreateWidget(
wtab_t *w, *pw, *wtab; wtab_t *w, *pw, *wtab;
char *wname, *wclass, *parentid, *var; char *wname, *wclass, *parentid, *var;
Arg args[MAXARGS]; Arg args[MAXARGS];
register int i; int i;
int n; int n;
char * errmsg; char * errmsg;
int pargc; int pargc;
@ -777,7 +777,7 @@ do_XtCreateApplicationShell(
wtab_t *w, *wtab; wtab_t *w, *wtab;
char *wname, *wclass, *var; char *wname, *wclass, *var;
Arg args[MAXARGS]; Arg args[MAXARGS];
register int i; int i;
int n; int n;
char * errmsg; char * errmsg;
int pargc; int pargc;
@ -916,7 +916,7 @@ do_single_widget_arg_func(
char **argv ) char **argv )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc < 2) { if (argc < 2) {
@ -950,7 +950,7 @@ do_single_widget_test_func(
char **argv ) char **argv )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc != 2) { if (argc != 2) {
@ -985,7 +985,7 @@ do_XtIsShell(
char *argv[] ) char *argv[] )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc != 2) if (argc != 2)
@ -1044,7 +1044,7 @@ do_XtMapWidget(
char *argv[] ) char *argv[] )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc < 2) { if (argc < 2) {
@ -1068,7 +1068,7 @@ do_XtUnmapWidget(
char **argv ) char **argv )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc < 2) { if (argc < 2) {
@ -1681,7 +1681,7 @@ do_XtGetValues(
int argc, int argc,
char **argv ) char **argv )
{ {
register int i, j; int i, j;
int n; int n;
char *arg0 = argv[0]; char *arg0 = argv[0];
char *val, *p, *str; char *val, *p, *str;
@ -2030,7 +2030,7 @@ do_managelist_func(
int (*func)() ) int (*func)() )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
Widget widgets[MAXARGS]; Widget widgets[MAXARGS];
Cardinal nwidgets; Cardinal nwidgets;
char * errmsg; char * errmsg;
@ -2059,7 +2059,7 @@ do_XtIsSubclass(
char *argv[] ) char *argv[] )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc != 3) if (argc != 3)
@ -2095,7 +2095,7 @@ do_XtClass(
char *argv[] ) char *argv[] )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
WidgetClass class; WidgetClass class;
@ -2346,7 +2346,7 @@ do_XtRemoveAllCallbacks(
char *argv[] ) char *argv[] )
{ {
wtab_t *w; wtab_t *w;
register int i; int i;
char * errmsg; char * errmsg;
if (argc != 3) { if (argc != 3) {
@ -2480,7 +2480,7 @@ invokeXDrawFunction(
unsigned int width, height; unsigned int width, height;
char *s; char *s;
char *sp; char *sp;
register int i; int i;
int mode, parse; int mode, parse;
int text = FALSE; int text = FALSE;
int (*func)(); int (*func)();
@ -3307,7 +3307,7 @@ do_XtAddInput(
int argc, int argc,
char *argv[] ) char *argv[] )
{ {
register int i, j; int i, j;
int fd; int fd;
char *arg0 = argv[0]; char *arg0 = argv[0];
char *variable; char *variable;
@ -3811,7 +3811,7 @@ stdInputCB(
char cmdbuf[LINESIZE]; char cmdbuf[LINESIZE];
int cmd; int cmd;
char *p; char *p;
register int i, n, j; int i, n, j;
char * errmsg; char * errmsg;
int len; int len;

View file

@ -450,7 +450,7 @@ DtkshCvtCallbackToString(
{ {
XtCallbackList cb; XtCallbackList cb;
char buf[2048]; char buf[2048];
register char *p; char *p;
char * errmsg; char * errmsg;
Boolean count = 0; Boolean count = 0;

View file

@ -139,7 +139,7 @@ xk_prin_int(
unsigned long *old_v ) unsigned long *old_v )
{ {
register int i, printed = 0; int i, printed = 0;
struct symlist *sym; struct symlist *sym;
unsigned long v; unsigned long v;
@ -226,7 +226,7 @@ xk_par_int(
long *v, long *v,
struct envsymbols *env ) struct envsymbols *env )
{ {
register int ret, base; int ret, base;
char *p, *q, *pp; char *p, *q, *pp;
char nbuf[512]; char nbuf[512];
@ -339,7 +339,7 @@ xk_prin_charstr(
unsigned char *str, unsigned char *str,
int len ) int len )
{ {
register int i; int i;
if (str == NULL) if (str == NULL)
*buf += lsprintf(*buf, "NULL"); *buf += lsprintf(*buf, "NULL");
@ -390,7 +390,7 @@ xk_prin_hexstr(
char *str, char *str,
int len ) int len )
{ {
register int i; int i;
unsigned char tempc; unsigned char tempc;
if (str == NULL) if (str == NULL)
@ -443,7 +443,7 @@ xk_par_charstr(
char **str, char **str,
int *len ) int *len )
{ {
register int i; int i;
char delim; char delim;
int didmalloc = FALSE, getmode; int didmalloc = FALSE, getmode;
char cbuf[3]; /* conversion buffer for hex strings */ char cbuf[3]; /* conversion buffer for hex strings */

View file

@ -168,7 +168,7 @@ xk_parse(
memtbl_t *(*tbl_find)() ) memtbl_t *(*tbl_find)() )
{ {
memtbl_t *ntbl; memtbl_t *ntbl;
register int i = 0; int i = 0;
int skind, delim_type; int skind, delim_type;
long val = 0; /* used for choice selection */ long val = 0; /* used for choice selection */
char *np; char *np;
@ -726,7 +726,7 @@ xk_print(
memtbl_t *(*tbl_find)() ) memtbl_t *(*tbl_find)() )
{ {
memtbl_t *ntbl; memtbl_t *ntbl;
register int i; int i;
long val; /* used for choice selection */ long val; /* used for choice selection */
char *np; char *np;
int delim = _Delim; int delim = _Delim;
@ -962,7 +962,7 @@ xk_free(
memtbl_t *(*tbl_find)() ) memtbl_t *(*tbl_find)() )
{ {
memtbl_t *ntbl; memtbl_t *ntbl;
register int i; int i;
long val; /* used for choice selection */ long val; /* used for choice selection */
char *np; char *np;
int delim = _Delim; int delim = _Delim;

View file

@ -113,7 +113,7 @@ env_set_var(
char *var, char *var,
char *val ) char *val )
{ {
register int len; int len;
char tmp[512]; char tmp[512];
char *set = &tmp[0]; char *set = &tmp[0];

View file

@ -129,7 +129,7 @@ error __PARAM__((int level, const char* file, const char* msg), (level, file, ms
*/ */
static int static int
shipnewer __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){ shipnewer __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
unsigned long ref; unsigned long ref;
struct stat st; struct stat st;
@ -146,9 +146,9 @@ static char buf[4096];
static unsigned long static unsigned long
sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP__(char* file; int fd; unsigned long s;){ sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP__(char* file; int fd; unsigned long s;){
register unsigned char* b; unsigned char* b;
register unsigned char* e; unsigned char* e;
register int n; int n;
HASHPART(s, 0); HASHPART(s, 0);
while ((n = read(fd, buf, sizeof(buf))) > 0) while ((n = read(fd, buf, sizeof(buf))) > 0)
@ -166,9 +166,9 @@ sealfile __PARAM__((char* file, int fd, unsigned long s), (file, fd, s)) __OTORP
*/ */
static int static int
shipseal __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){ shipseal __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
register char* f; char* f;
register int fd; int fd;
unsigned long s; unsigned long s;
s = 0; s = 0;
@ -192,9 +192,9 @@ shipseal __PARAM__((register char** argv), (argv)) __OTORP__(register char** arg
*/ */
static int static int
shipstate __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){ shipstate __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
register char* s; char* s;
register int c; int c;
long ref; long ref;
struct stat st; struct stat st;
@ -225,7 +225,7 @@ shipstate __PARAM__((register char** argv), (argv)) __OTORP__(register char** ar
*/ */
static int static int
shiptime __PARAM__((register char** argv), (argv)) __OTORP__(register char** argv;){ shiptime __PARAM__((char** argv), (argv)) __OTORP__(char** argv;){
struct stat st; struct stat st;
time_t date; time_t date;
@ -262,8 +262,8 @@ static struct optab ops[] =
int int
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register char* s; char* s;
register int i; int i;
if (!(s = *++argv)) if (!(s = *++argv))
exit(0); exit(0);

View file

@ -2037,12 +2037,12 @@ static char* oct = &hex[14];
void void
ppfsm __PARAM__((int op, register char* s), (op, s)) __OTORP__(int op; register char* s;){ ppfsm __PARAM__((int op, char* s), (op, s)) __OTORP__(int op; char* s;){
register int c; int c;
register int n; int n;
register int i; int i;
register short* rp; short* rp;
register struct fsminit* fp; struct fsminit* fp;
@ -2556,8 +2556,8 @@ static int errors;
static int static int
sstrlen __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ sstrlen __PARAM__((char* s), (s)) __OTORP__(char* s;){
register char* b; char* b;
for (b = s; *s; s++); for (b = s; *s; s++);
return(s - b); return(s - b);
@ -2568,8 +2568,8 @@ sstrlen __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
static int static int
sstrncmp __PARAM__((register char* s, register char* t, register int n), (s, t, n)) __OTORP__(register char* s; register char* t; register int n;){ sstrncmp __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){
register char* e = s + n; char* e = s + n;
while (s < e) while (s < e)
{ {
@ -2585,8 +2585,8 @@ sstrncmp __PARAM__((register char* s, register char* t, register int n), (s, t,
static char* static char*
memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTORP__(register char* s; register char* t; int n;){ memcopy __PARAM__((char* s, char* t, int n), (s, t, n)) __OTORP__(char* s; char* t; int n;){
register char* e = t + n; char* e = t + n;
while (t < e) *s++ = *t++; while (t < e) *s++ = *t++;
return(s); return(s);
@ -2597,7 +2597,7 @@ memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTOR
static char* static char*
strcopy __PARAM__((register char* s, register char* t), (s, t)) __OTORP__(register char* s; register char* t;){ strcopy __PARAM__((char* s, char* t), (s, t)) __OTORP__(char* s; char* t;){
while (*s++ = *t++); while (*s++ = *t++);
return(s - 1); return(s - 1);
} }
@ -2612,8 +2612,8 @@ strcopy __PARAM__((register char* s, register char* t), (s, t)) __OTORP__(regist
static char* static char*
comment __PARAM__((register char* p, register char* s, register int n, int u), (p, s, n, u)) __OTORP__(register char* p; register char* s; register int n; int u;){ comment __PARAM__((char* p, char* s, int n, int u), (p, s, n, u)) __OTORP__(char* p; char* s; int n; int u;){
register char* e; char* e;
char* m; char* m;
if (!s) if (!s)
@ -2675,10 +2675,10 @@ typedef struct
} Notice_t; } Notice_t;
static char* static char*
copyright __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(register char* p; register char* s;){ copyright __PARAM__((char* p, char* s), (p, s)) __OTORP__(char* p; char* s;){
register char* v; char* v;
register char* x; char* x;
register int c; int c;
int i; int i;
int n; int n;
unsigned long h; unsigned long h;
@ -2909,8 +2909,8 @@ copyright __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(regi
static char* static char*
number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register char* p; register long n;){ number __PARAM__((char* p, long n), (p, n)) __OTORP__(char* p; long n;){
register long d; long d;
for (d = 1000000; d > 1; d /= 10) for (d = 1000000; d > 1; d /= 10)
if (n >= d) *p++ = '0' + (n / d) % 10; if (n >= d) *p++ = '0' + (n / d) % 10;
@ -2925,13 +2925,13 @@ number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register
static void 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;){ proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){
register char* p; char* p;
char buf[1024]; char buf[1024];
p = strcopy(buf, "proto: "); p = strcopy(buf, "proto: ");
if (iob) if (iob)
{ {
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
if (proto->line) if (proto->line)
{ {
@ -2977,7 +2977,7 @@ proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level,
static char* static char*
linesync __PARAM__((register struct proto* proto, register char* p, register long n), (proto, p, n)) __OTORP__(register struct proto* proto; register char* p; register long n;){ 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)) if (proto->flags & (1L<<12))
@ -3077,12 +3077,12 @@ init __PARAM__((char* op, int flags), (op, flags)) __OTORP__(char* op; int flags
static int static int
lex __PARAM__((register struct proto* proto, register long flags), (proto, flags)) __OTORP__(register struct proto* proto; register long flags;){ lex __PARAM__((struct proto* proto, long flags), (proto, flags)) __OTORP__(struct proto* proto; long flags;){
register char* ip; char* ip;
register char* op; char* op;
register int c; int c;
register int state; int state;
register short* rp; short* rp;
char* m; char* m;
char* e; char* e;
char* t; char* t;
@ -4478,7 +4478,7 @@ if !defined(va_start)\n\
void void
pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
if (proto->flags & (1L<<15)) close(proto->fd); if (proto->flags & (1L<<15)) close(proto->fd);
free((char*)proto); free((char*)proto);
@ -4496,10 +4496,10 @@ pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
char* char*
pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, notice, flags)) __OTORP__(char* file; int fd; char* notice; int flags;){ pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, notice, flags)) __OTORP__(char* file; int fd; char* notice; int flags;){
register struct proto* proto; struct proto* proto;
register char* iob; char* iob;
register long n; long n;
register char* s; char* s;
int pragma; int pragma;
char* b; char* b;
@ -4771,8 +4771,8 @@ pppopen __PARAM__((char* file, int fd, char* notice, int flags), (file, fd, noti
int int
pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
register struct proto* proto = (struct proto*)(iob - sizeof(struct proto)); struct proto* proto = (struct proto*)(iob - sizeof(struct proto));
register int n; int n;
if (proto->flags & (1L<<17)) if (proto->flags & (1L<<17))
{ {
@ -4796,9 +4796,9 @@ pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){
if (proto->flags & (1L<<29)) if (proto->flags & (1L<<29))
{ {
register char* ip = proto->ip; char* ip = proto->ip;
register char* op = proto->ob; char* op = proto->ob;
register char* ep = proto->ob + proto->oz - 2; char* ep = proto->ob + proto->oz - 2;
if (!*ip) if (!*ip)
{ {

View file

@ -120,7 +120,7 @@ static void trap_timeout __PROTO__((__V_*));
* insert timeout item on current given list in sorted order * 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;){ static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){
register struct tevent *tp = (struct tevent*)list; struct tevent *tp = (struct tevent*)list;
if(!tp || item->milli < tp->milli) if(!tp || item->milli < tp->milli)
{ {
item->next = tp; item->next = tp;
@ -141,8 +141,8 @@ static __V_ *time_add __PARAM__((struct tevent *item, __V_ *list), (item, list))
/* /*
* delete timeout item from current given list, delete timer * delete timeout item from current given list, delete timer
*/ */
static __V_ *time_delete __PARAM__((register struct tevent *item, __V_ *list), (item, list)) __OTORP__(register struct tevent *item; __V_ *list;){ static __V_ *time_delete __PARAM__((struct tevent *item, __V_ *list), (item, list)) __OTORP__(struct tevent *item; __V_ *list;){
register struct tevent *tp = (struct tevent*)list; struct tevent *tp = (struct tevent*)list;
if(item==tp) if(item==tp)
list = (__V_*)tp->next; list = (__V_*)tp->next;
else else
@ -158,12 +158,12 @@ static __V_ *time_delete __PARAM__((register struct tevent *item, __V_ *list),
} }
static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){ static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){
register struct tevent *tp = (struct tevent*)list; struct tevent *tp = (struct tevent*)list;
while(tp) while(tp)
{ {
if(tp->timeout) if(tp->timeout)
{ {
register char *name = nv_name(tp->node); char *name = nv_name(tp->node);
if(tp->flags&R_FLAG) if(tp->flags&R_FLAG)
{ {
double d = tp->milli; double d = tp->milli;
@ -177,7 +177,7 @@ static void print_alarms __PARAM__((__V_ *list), (list)) __OTORP__(__V_ *list;){
} }
static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* handle;){ static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* handle;){
register struct tevent *tp = (struct tevent*)handle; struct tevent *tp = (struct tevent*)handle;
sh.trapnote |= SH_SIGTRAP; sh.trapnote |= SH_SIGTRAP;
if(!(tp->flags&R_FLAG)) if(!(tp->flags&R_FLAG))
tp->timeout = 0; tp->timeout = 0;
@ -188,8 +188,8 @@ static void trap_timeout __PARAM__((__V_* handle), (handle)) __OTORP__(__V_* han
} }
void sh_timetraps __PARAM__((void), ()){ void sh_timetraps __PARAM__((void), ()){
register struct tevent *tp, *tpnext; struct tevent *tp, *tpnext;
register struct tevent *tptop; struct tevent *tptop;
while(1) while(1)
{ {
sh.sigflag[SIGALRM] &= ~SH_SIGTRAP; sh.sigflag[SIGALRM] &= ~SH_SIGTRAP;
@ -222,7 +222,7 @@ void sh_timetraps __PARAM__((void), ()){
static char *setdisc __PARAM__((Namval_t *np, const char *event, Namval_t* action, Namfun_t 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), (np, event, action, fp)) __OTORP__(Namval_t *np; const char *event; Namval_t* action; Namfun_t
*fp;){ *fp;){
register struct tevent *tp = (struct tevent*)fp; struct tevent *tp = (struct tevent*)fp;
if(!event) if(!event)
return(action?"":(char*)ALARM); return(action?"":(char*)ALARM);
if(strcmp(event,ALARM)!=0) if(strcmp(event,ALARM)!=0)
@ -241,8 +241,8 @@ static char *setdisc __PARAM__((Namval_t *np, const char *event, Namval_t* actio
* catch assignments and set alarm traps * 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;){ 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;){
register struct tevent *tp; struct tevent *tp;
register double d; double d;
if(val) if(val)
{ {
double now; double now;
@ -290,9 +290,9 @@ static const Namdisc_t alarmdisc =
}; };
int b_alarm __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_alarm __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int n,rflag=0; int n,rflag=0;
register Namval_t *np; Namval_t *np;
register struct tevent *tp; struct tevent *tp;
NOT_USED(extra); NOT_USED(extra);
while (n = optget(argv, sh_optalarm)) switch (n) while (n = optget(argv, sh_optalarm)) switch (n)
{ {

View file

@ -102,8 +102,8 @@
#include <ls.h> #include <ls.h>
int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *dir, *cdpath=""; char *dir, *cdpath="";
register const char *dp; const char *dp;
int saverrno=0; int saverrno=0;
int rval,flag = (sh_isoption(SH_PHYSICAL)!=0); int rval,flag = (sh_isoption(SH_PHYSICAL)!=0);
char *oldpwd; char *oldpwd;
@ -174,7 +174,7 @@ int b_cd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __
} }
if(!flag) if(!flag)
{ {
register char *cp; char *cp;
stakseek(PATH_MAX+PATH_OFFSET); stakseek(PATH_MAX+PATH_OFFSET);
#ifdef SHOPT_FS_3D #ifdef SHOPT_FS_3D
if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT))) if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT)))
@ -235,8 +235,8 @@ success:
} }
int b_pwd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ int b_pwd __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register int n, flag = (sh_isoption(SH_PHYSICAL)!=0); int n, flag = (sh_isoption(SH_PHYSICAL)!=0);
register char *cp; char *cp;
NOT_USED(extra); NOT_USED(extra);
NOT_USED(argc); NOT_USED(argc);
while((n = optget(argv,sh_optpwd))) switch(n) while((n = optget(argv,sh_optpwd))) switch(n)

View file

@ -102,9 +102,9 @@
/* /*
* return and exit * return and exit
*/ */
int b_ret_exit __PARAM__((register int n, register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[];__V_ *extra;){ 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; struct checkpt *pp = (struct checkpt*)sh.jmplist;
register char *arg; char *arg;
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n) while((n = optget(argv,sh_optcflow))) switch(n)
{ {
@ -133,9 +133,9 @@ done:
/* /*
* break and continue * break and continue
*/ */
int b_brk_cont __PARAM__((register int n, register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[];__V_ *extra;){ int b_brk_cont __PARAM__((int n, char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[];__V_ *extra;){
char *arg; char *arg;
register int cont= **argv=='c'; int cont= **argv=='c';
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n) while((n = optget(argv,sh_optcflow))) switch(n)
{ {

View file

@ -103,10 +103,10 @@
#define next_config(p) ((Shtable_t*)((char*)(p) + sizeof(*shtab_config))) #define next_config(p) ((Shtable_t*)((char*)(p) + sizeof(*shtab_config)))
#define MIN_LEN 20 #define MIN_LEN 20
int b_getconf __PARAM__((register int argc, char *argv[]), (argc, argv)) __OTORP__(register int argc; char *argv[];){ int b_getconf __PARAM__((int argc, char *argv[]), (argc, argv)) __OTORP__(int argc; char *argv[];){
register int m,n; int m,n;
register long val; long val;
register const char *name, *path=""; const char *name, *path="";
int offset = staktell(); int offset = staktell();
const Shtable_t *tp = shtab_config; const Shtable_t *tp = shtab_config;
error_info.id = argv[0]; error_info.id = argv[0];

View file

@ -99,9 +99,9 @@
#include "builtins.h" #include "builtins.h"
int b_getopts __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_getopts __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *options=error_info.context->id; char *options=error_info.context->id;
register Namval_t *np; Namval_t *np;
register int flag, mode, r=0; int flag, mode, r=0;
static char value[2], key[2]; static char value[2], key[2];
NOT_USED(extra); NOT_USED(extra);
while((flag = optget(argv,sh_optgetopts))) switch(flag) while((flag = optget(argv,sh_optgetopts))) switch(flag)

View file

@ -106,9 +106,9 @@
static void hist_subst __PROTO__((const char*, int fd, char*)); 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;){ int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register History_t *hp; History_t *hp;
register char *arg; char *arg;
register int flag,fdo; int flag,fdo;
struct stat statb; struct stat statb;
time_t before; time_t before;
Sfio_t *outfile; Sfio_t *outfile;
@ -301,9 +301,9 @@ int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra))
*/ */
static void hist_subst __PARAM__((const char *command,int fd,char *replace), (command, fd, replace)) __OTORP__(const char *command;int fd;char *replace;){ static void hist_subst __PARAM__((const char *command,int fd,char *replace), (command, fd, replace)) __OTORP__(const char *command;int fd;char *replace;){
register char *newp=replace; char *newp=replace;
register char *sp; char *sp;
register int c; int c;
off_t size; off_t size;
char *string; char *string;
while(*++newp != '='); /* skip to '=' */ while(*++newp != '='); /* skip to '=' */

View file

@ -109,7 +109,7 @@ static void noexport __PROTO__((Namval_t*));
static char *arg0; static char *arg0;
int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register int n; int n;
sh.st.ioset = 0; sh.st.ioset = 0;
clear = 0; clear = 0;
NOT_USED(extra); NOT_USED(extra);
@ -137,7 +137,7 @@ int b_exec __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra
return(0); return(0);
} }
static void noexport __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){ static void noexport __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
nv_offattr(np,NV_EXPORT); nv_offattr(np,NV_EXPORT);
} }
@ -149,9 +149,9 @@ int b_login __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra
error(ERROR_exit(1),e_restricted,argv[0]); error(ERROR_exit(1),e_restricted,argv[0]);
else else
{ {
register struct argnod *arg=sh.envlist; struct argnod *arg=sh.envlist;
register Namval_t* np; Namval_t* np;
register char *cp; char *cp;
if(sh.subshell) if(sh.subshell)
sh_subfork(); sh_subfork();
if(clear) if(clear)
@ -183,8 +183,8 @@ int b_login __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra
} }
int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int r; int r;
register char *arg; char *arg;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
while (r = optget(argv,sh_optlet)) switch (r) while (r = optget(argv,sh_optlet)) switch (r)
@ -205,7 +205,7 @@ int b_let __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
} }
int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){ int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register int r; int r;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
while (r = optget(argv,sh_opteval)) switch (r) while (r = optget(argv,sh_opteval)) switch (r)
@ -228,10 +228,10 @@ int b_eval __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra
return(sh.exitval); return(sh.exitval);
} }
int b_dot_cmd __PARAM__((register int n,char *argv[],__V_* extra), (n, argv, extra)) __OTORP__(register int n;char *argv[];__V_* extra;){ int b_dot_cmd __PARAM__((int n,char *argv[],__V_* extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_* extra;){
register char *script; char *script;
register Namval_t *np; Namval_t *np;
register int jmpval; int jmpval;
int fd; int fd;
struct dolnod *argsave=0, *saveargfor; struct dolnod *argsave=0, *saveargfor;
char **saveargv; char **saveargv;
@ -314,7 +314,7 @@ int b_dot_cmd __PARAM__((register int n,char *argv[],__V_* extra), (n, argv,
/* /*
* null, true command * null, true command
*/ */
int b_true __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ 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(argc);
NOT_USED(argv[0]); NOT_USED(argv[0]);
NOT_USED(extra); NOT_USED(extra);
@ -324,15 +324,15 @@ int b_true __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, arg
/* /*
* false command * false command
*/ */
int b_false __PARAM__((int argc,register char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[]; __V_ *extra;){ 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(argc);
NOT_USED(argv[0]); NOT_USED(argv[0]);
NOT_USED(extra); NOT_USED(extra);
return(1); return(1);
} }
int b_shift __PARAM__((register int n, register char *argv[], __V_ *extra), (n, argv, extra)) __OTORP__(register int n; register char *argv[]; __V_ *extra;){ int b_shift __PARAM__((int n, char *argv[], __V_ *extra), (n, argv, extra)) __OTORP__(int n; char *argv[]; __V_ *extra;){
register char *arg; char *arg;
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optcflow))) switch(n) while((n = optget(argv,sh_optcflow))) switch(n)
{ {
@ -357,7 +357,7 @@ int b_shift __PARAM__((register int n, register char *argv[], __V_ *extra), (
return(0); return(0);
} }
int b_wait __PARAM__((register int n,register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;register char *argv[];__V_ *extra;){ int b_wait __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optjoblist))) switch(n) while((n = optget(argv,sh_optjoblist))) switch(n)
{ {
@ -376,8 +376,8 @@ int b_wait __PARAM__((register int n,register char *argv[],__V_ *extra), (n,
} }
#ifdef JOBS #ifdef JOBS
int b_bg_fg __PARAM__((register int n,register char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;register char *argv[];__V_ *extra;){ int b_bg_fg __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
register int flag = **argv; int flag = **argv;
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optjoblist))) switch(n) while((n = optget(argv,sh_optjoblist))) switch(n)
{ {
@ -404,8 +404,8 @@ int b_bg_fg __PARAM__((register int n,register char *argv[],__V_ *extra), (n,
return(sh.exitval); return(sh.exitval);
} }
int b_jobs __PARAM__((register int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(register int n;char *argv[];__V_ *extra;){ int b_jobs __PARAM__((int n,char *argv[],__V_ *extra), (n, argv, extra)) __OTORP__(int n;char *argv[];__V_ *extra;){
register int flag = 0; int flag = 0;
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optjobs))) switch(n) while((n = optget(argv,sh_optjobs))) switch(n)
{ {
@ -443,8 +443,8 @@ int b_jobs __PARAM__((register int n,char *argv[],__V_ *extra), (n, argv, ext
* setuniv() calls. * setuniv() calls.
*/ */
int b_universe __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ int b_universe __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *arg; char *arg;
register int n; int n;
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optuniverse))) switch(n) while((n = optget(argv,sh_optuniverse))) switch(n)
{ {
@ -476,10 +476,10 @@ int b_universe __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extr
#endif /* cmd_universe */ #endif /* cmd_universe */
#ifdef SHOPT_FS_3D #ifdef SHOPT_FS_3D
int b_vpath_map __PARAM__((register int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[]; __V_ *extra;){ int b_vpath_map __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register int flag, n; int flag, n;
register const char *optstr; const char *optstr;
register char *vend; char *vend;
NOT_USED(extra); NOT_USED(extra);
if(argv[0][1]=='p') if(argv[0][1]=='p')
{ {

View file

@ -149,7 +149,7 @@ static int outexceptf __PARAM__((Sfio_t* iop, int mode, Sfdisc_t* dp), (iop, mod
/* This mess is because /bin/echo on BSD is different */ /* This mess is because /bin/echo on BSD is different */
if(!sh.universe) if(!sh.universe)
{ {
register char *universe; char *universe;
if(universe=astconf("_AST_UNIVERSE",0,0)) if(universe=astconf("_AST_UNIVERSE",0,0))
bsd_univ = (strcmp(universe,"ucb")==0); bsd_univ = (strcmp(universe,"ucb")==0);
sh.universe = 1; sh.universe = 1;
@ -177,8 +177,8 @@ int b_printf __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, ext
*/ */
int b_print __PARAM__((int argc, char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[]; __V_ *extra;){ int b_print __PARAM__((int argc, char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[]; __V_ *extra;){
register Sfio_t *outfile; Sfio_t *outfile;
register int n, fd = 1; int n, fd = 1;
const char *msg = e_file+4; const char *msg = e_file+4;
char *format = 0; char *format = 0;
int sflag = 0, nflag, rflag; int sflag = 0, nflag, rflag;
@ -344,8 +344,8 @@ skip2:
*/ */
int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, raw, argv)) __OTORP__(Sfio_t *outfile; int raw; char *argv[];){ int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, raw, argv)) __OTORP__(Sfio_t *outfile; int raw; char *argv[];){
register char *cp; char *cp;
register int n; int n;
while(!cescape && (cp= *argv++)) while(!cescape && (cp= *argv++))
{ {
if(!raw && (n=fmtvecho(cp))>=0) if(!raw && (n=fmtvecho(cp))>=0)
@ -364,7 +364,7 @@ int sh_echolist __PARAM__((Sfio_t *outfile, int raw, char *argv[]), (outfile, ra
static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *format;){ static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *format;){
register char *fp; char *fp;
stakseek(0); stakseek(0);
stakputs(preformat); stakputs(preformat);
stakputs(format); stakputs(format);
@ -374,9 +374,9 @@ static char *genformat __PARAM__((char *format), (format)) __OTORP__(char *forma
} }
static int getarg __PARAM__((int format,union types_t *value), (format, value)) __OTORP__(int format;union types_t *value;){ static int getarg __PARAM__((int format,union types_t *value), (format, value)) __OTORP__(int format;union types_t *value;){
register char *argp = *nextarg; char *argp = *nextarg;
char *lastchar = ""; char *lastchar = "";
register int neg = 0; int neg = 0;
if(!argp) if(!argp)
{ {
switch(format) switch(format)
@ -488,7 +488,7 @@ static int getarg __PARAM__((int format,union types_t *value), (format, value))
* This routine adds new % escape sequences to printf * 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;){ 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;){
register int n; int n;
NOT_USED(precis); NOT_USED(precis);
switch(format) switch(format)
{ {
@ -528,9 +528,9 @@ static int extend __PARAM__((char *invalue,int format,int precis,char **outval),
static int fmtvecho __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ static int fmtvecho __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
static char *nullarg; static char *nullarg;
register const char *cp = string, *cpmax; const char *cp = string, *cpmax;
register int c; int c;
register int offset = staktell(); int offset = staktell();
int chlen; int chlen;
if (MB_CUR_MAX > 1) if (MB_CUR_MAX > 1)
{ {

View file

@ -111,8 +111,8 @@
#define D_FLAG 6 /* must be number of bits for all flags */ #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;){ int b_read __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[]; __V_ *extra;){
register char *name; char *name;
register int r, flags=0, fd=0; int r, flags=0, fd=0;
long timeout = 1000*sh.tmout; long timeout = 1000*sh.tmout;
int save_prompt; int save_prompt;
NOT_USED(argc); NOT_USED(argc);
@ -203,11 +203,11 @@ static void timedout __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;
*/ */
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 sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names, fd, flags, timeout)) __OTORP__(char **names; int fd; int flags;long timeout;){
register int c; int c;
register unsigned char *cp; unsigned char *cp;
register Namval_t *np; Namval_t *np;
register char *name, *val; char *name, *val;
register Sfio_t *iop; Sfio_t *iop;
char *ifs; char *ifs;
unsigned char *cpmax; unsigned char *cpmax;
char was_escape = 0; char was_escape = 0;
@ -437,8 +437,8 @@ int sh_readline __PARAM__((char **names, int fd, int flags,long timeout), (names
if(!name && *val) if(!name && *val)
{ {
/* strip off trailing delimiters */ /* strip off trailing delimiters */
register char *cp = val + strlen(val); char *cp = val + strlen(val);
register int n; int n;
while((n=sh.ifstable[*--cp])==S_DELIM || n==S_SPACE); while((n=sh.ifstable[*--cp])==S_DELIM || n==S_SPACE);
cp[1] = 0; cp[1] = 0;
} }

View file

@ -105,9 +105,9 @@
# undef _lib_poll # undef _lib_poll
#endif /* _lib_poll_notimer */ #endif /* _lib_poll_notimer */
int b_sleep __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[];__V_ *extra;){ int b_sleep __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *cp; char *cp;
register double d; double d;
time_t tloc = 0; time_t tloc = 0;
NOT_USED(extra); NOT_USED(extra);
while((argc = optget(argv,sh_optsleep))) switch(argc) while((argc = optget(argv,sh_optsleep))) switch(argc)
@ -181,7 +181,7 @@ unsigned sleep __PARAM__((unsigned sec), (sec)) __OTORP__(unsigned sec;){
*/ */
void sh_delay __PARAM__((double t), (t)) __OTORP__(double t;){ void sh_delay __PARAM__((double t), (t)) __OTORP__(double t;){
register int n = (int)t; int n = (int)t;
#ifdef _lib_poll #ifdef _lib_poll
struct pollfd fd; struct pollfd fd;
if(t<=0) if(t<=0)

View file

@ -131,8 +131,8 @@ static int ap, ac;
static char **av; static char **av;
int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){ int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc; char *argv[];__V_ *extra;){
register char *cp = argv[0]; char *cp = argv[0];
register int not; int not;
NOT_USED(extra); NOT_USED(extra);
av = argv; av = argv;
ap = 1; ap = 1;
@ -156,7 +156,7 @@ int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra))
/* fall through */ /* fall through */
case 4: case 4:
{ {
register int op = sh_lookup(cp=argv[2],shtab_testops); int op = sh_lookup(cp=argv[2],shtab_testops);
if(op&TEST_BINOP) if(op&TEST_BINOP)
break; break;
if(!op) if(!op)
@ -190,9 +190,9 @@ int b_test __PARAM__((int argc, char *argv[],__V_ *extra), (argc, argv, extra))
* flag is 1 when in parenthesis * flag is 1 when in parenthesis
* flag is 2 when evaluating -a * flag is 2 when evaluating -a
*/ */
static int expr __PARAM__((int register flag), (flag)) __OTORP__(int register flag;){ static int expr __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register int r; int r;
register char *p; char *p;
r = e3(); r = e3();
while(ap < ac) while(ap < ac)
{ {
@ -243,8 +243,8 @@ static char *nxtarg __PARAM__((int mt), (mt)) __OTORP__(int mt;){
static e3 __PARAM__((void), ()){ static e3 __PARAM__((void), ()){
register char *arg, *cp; char *arg, *cp;
register int op; int op;
char *binop; char *binop;
arg=nxtarg(0); arg=nxtarg(0);
if(c_eq(arg, '!')) if(c_eq(arg, '!'))
@ -298,7 +298,7 @@ skip:
return(test_binop(op,arg,cp)); return(test_binop(op,arg,cp));
} }
int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) __OTORP__(register int op;register const char *arg;){ int test_unop __PARAM__((int op,const char *arg), (op, arg)) __OTORP__(int op;const char *arg;){
switch(op) switch(op)
{ {
case 'r': case 'r':
@ -310,7 +310,7 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
case 'V': case 'V':
#ifdef SHOPT_FS_3D #ifdef SHOPT_FS_3D
{ {
register int offset = staktell(); int offset = staktell();
if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode)) if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode))
return(0); return(0);
/* add trailing / */ /* add trailing / */
@ -360,7 +360,7 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
case 'H': case 'H':
#ifdef S_ISCDF #ifdef S_ISCDF
{ {
register int offset = staktell(); int offset = staktell();
if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode)) if(test_stat(arg,&statb)>=0 && S_ISCDF(statb.st_mode))
return(1); return(1);
stakputs(arg); stakputs(arg);
@ -419,8 +419,8 @@ int test_unop __PARAM__((register int op,register const char *arg), (op, arg)) _
} }
} }
test_binop __PARAM__((register int op,const char *left,const char *right), (op, left, right)) __OTORP__(register int op;const char *left;const char *right;){ test_binop __PARAM__((int op,const char *left,const char *right), (op, left, right)) __OTORP__(int op;const char *left;const char *right;){
register double lnum,rnum; double lnum,rnum;
if(op&TEST_ARITH) if(op&TEST_ARITH)
{ {
lnum = sh_arith(left); lnum = sh_arith(left);
@ -498,7 +498,7 @@ test_inode __PARAM__((const char *file1,const char *file2), (file1, file2)) __OT
* The static buffer statb is shared with test_mode. * The static buffer statb is shared with test_mode.
*/ */
sh_access __PARAM__((register const char *name, register int mode), (name, mode)) __OTORP__(register const char *name; register int mode;){ sh_access __PARAM__((const char *name, int mode), (name, mode)) __OTORP__(const char *name; int mode;){
if(*name==0) if(*name==0)
return(-1); return(-1);
if(strmatch(name,(char*)e_devfdNN)) if(strmatch(name,(char*)e_devfdNN))
@ -550,7 +550,7 @@ skip:
{ {
static int maxgroups = 0; static int maxgroups = 0;
gid_t *groups; gid_t *groups;
register int n; int n;
if(maxgroups==0) if(maxgroups==0)
{ {
/* first time */ /* first time */
@ -584,7 +584,7 @@ skip:
* The mode bits are zero if the file doesn't exist. * The mode bits are zero if the file doesn't exist.
*/ */
static int test_mode __PARAM__((register const char *file), (file)) __OTORP__(register const char *file;){ static int test_mode __PARAM__((const char *file), (file)) __OTORP__(const char *file;){
if(file && (*file==0 || test_stat(file,&statb)<0)) if(file && (*file==0 || test_stat(file,&statb)<0))
return(0); return(0);
return(statb.st_mode); return(statb.st_mode);

View file

@ -106,8 +106,8 @@ static int sig_number __PROTO__((const char*));
static void sig_list __PROTO__((int)); 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;){ int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *arg = argv[1]; char *arg = argv[1];
register int sig, pflag = 0; int sig, pflag = 0;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
while (sig = optget(argv, sh_opttrap)) switch (sig) while (sig = optget(argv, sh_opttrap)) switch (sig)
@ -127,7 +127,7 @@ int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) _
error(ERROR_usage(2),optusage((char*)0)); error(ERROR_usage(2),optusage((char*)0));
if(arg = *argv) if(arg = *argv)
{ {
register int clear; int clear;
char *action = arg; char *action = arg;
if(!pflag) if(!pflag)
{ {
@ -210,8 +210,8 @@ int b_trap __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) _
} }
int b_kill __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_kill __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *signame; char *signame;
register int sig=SIGTERM, flag=0, n; int sig=SIGTERM, flag=0, n;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
while((n = optget(argv,sh_optkill))) switch(n) while((n = optget(argv,sh_optkill))) switch(n)
@ -281,7 +281,7 @@ endopts:
*/ */
static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int n; int n;
char *last; char *last;
if(isdigit(*string)) if(isdigit(*string))
{ {
@ -291,7 +291,7 @@ static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const
} }
else else
{ {
register int c; int c;
n = staktell(); n = staktell();
do do
{ {
@ -316,9 +316,9 @@ static int sig_number __PARAM__((const char *string), (string)) __OTORP__(const
* if <flag> is zero, then print all signal names * if <flag> is zero, then print all signal names
* if <flag> is negative, then print all traps * if <flag> is negative, then print all traps
*/ */
static void sig_list __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){ static void sig_list __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register const struct shtable2 *tp; const struct shtable2 *tp;
register int sig = sh.sigmax+1; int sig = sh.sigmax+1;
const char *names[SH_TRAP]; const char *names[SH_TRAP];
const char *traps[SH_DEBUGTRAP+1]; const char *traps[SH_DEBUGTRAP+1];
@ -353,7 +353,7 @@ static void sig_list __PARAM__((register int flag), (flag)) __OTORP__(register i
else if(flag<0) else if(flag<0)
{ {
/* print the traps */ /* print the traps */
register char *trap,*sname,**trapcom; char *trap,*sname,**trapcom;
sig = sh.st.trapmax; sig = sh.st.trapmax;
/* use parent traps if otrapcom is set (for $(trap) */ /* use parent traps if otrapcom is set (for $(trap) */
trapcom = (sh.st.otrapcom?sh.st.otrapcom:sh.st.trapcom); trapcom = (sh.st.otrapcom?sh.st.otrapcom:sh.st.trapcom);

View file

@ -145,7 +145,7 @@ static const Namdisc_t treedisc =
*/ */
int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int flag; int flag;
char *command = argv[0]; char *command = argv[0];
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
@ -178,10 +178,10 @@ int b_read_export __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv,
} }
int b_alias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ int b_alias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register unsigned flag = NV_ARRAY|NV_NOSCOPE|NV_ASSIGN; unsigned flag = NV_ARRAY|NV_NOSCOPE|NV_ASSIGN;
register Hashtab_t *troot = sh.alias_tree; Hashtab_t *troot = sh.alias_tree;
register int n; int n;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
prefix=0; prefix=0;
@ -230,9 +230,9 @@ int b_alias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, ar
} }
int b_typeset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ int b_typeset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int flag = NV_VARNAME|NV_ASSIGN; int flag = NV_VARNAME|NV_ASSIGN;
register int n; int n;
Hashtab_t *troot = sh.var_tree; Hashtab_t *troot = sh.var_tree;
int isfloat = 0; int isfloat = 0;
NOT_USED(argc); NOT_USED(argc);
@ -347,8 +347,8 @@ int b_typeset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc,
return(b_common(argv,flag,troot)); return(b_common(argv,flag,troot));
} }
static int b_common __PARAM__((char **argv,register int flag,Hashtab_t *troot), (argv, flag, troot)) __OTORP__(char **argv;register int flag;Hashtab_t *troot;){ static int b_common __PARAM__((char **argv,int flag,Hashtab_t *troot), (argv, flag, troot)) __OTORP__(char **argv;int flag;Hashtab_t *troot;){
register char *name; char *name;
int nvflags=(flag&(NV_ARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_ASSIGN)); int nvflags=(flag&(NV_ARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_ASSIGN));
int r=0, ref=0; int r=0, ref=0;
#ifdef SHOPT_OO #ifdef SHOPT_OO
@ -376,8 +376,8 @@ static int b_common __PARAM__((char **argv,register int flag,Hashtab_t *troo
} }
while(name = *++argv) while(name = *++argv)
{ {
register unsigned newflag; unsigned newflag;
register Namval_t *np; Namval_t *np;
unsigned curflag; unsigned curflag;
if(troot == sh.fun_tree) if(troot == sh.fun_tree)
{ {
@ -537,9 +537,9 @@ __V_ **sh_getliblist __PARAM__((void), ()){
* adding builtins requires dlopen() interface * 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;){ int b_builtin __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *arg=0, *name; char *arg=0, *name;
register int n, r=0, flag=0; int n, r=0, flag=0;
register Namval_t *np; Namval_t *np;
int dlete=0; int dlete=0;
static int maxlib, nlib; static int maxlib, nlib;
Fptr_t addr; Fptr_t addr;
@ -659,7 +659,7 @@ int b_builtin __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)
return(r); return(r);
} }
int b_set __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ int b_set __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra); NOT_USED(extra);
prefix=0; prefix=0;
if(argv[1]) if(argv[1])
@ -682,21 +682,21 @@ int b_set __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv
* Non-existent items being deleted give non-zero exit status * Non-existent items being deleted give non-zero exit status
*/ */
int b_unalias __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ int b_unalias __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra); NOT_USED(extra);
return(b_unall(argc,argv,sh.alias_tree)); return(b_unall(argc,argv,sh.alias_tree));
} }
int b_unset __PARAM__((int argc,register char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;register char *argv[];__V_ *extra;){ int b_unset __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
NOT_USED(extra); NOT_USED(extra);
return(b_unall(argc,argv,sh.var_tree)); return(b_unall(argc,argv,sh.var_tree));
} }
static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot), (argc, argv, troot)) __OTORP__(int argc; char **argv; register Hashtab_t *troot;){ static int b_unall __PARAM__((int argc, char **argv, Hashtab_t *troot), (argc, argv, troot)) __OTORP__(int argc; char **argv; Hashtab_t *troot;){
register Namval_t *np; Namval_t *np;
register struct slnod *slp; struct slnod *slp;
register const char *name; const char *name;
register int r; int r;
int nflag = 0; int nflag = 0;
int all=0; int all=0;
NOT_USED(argc); NOT_USED(argc);
@ -751,7 +751,7 @@ static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot),
else if(slp=(struct slnod*)(np->nvenv)) else if(slp=(struct slnod*)(np->nvenv))
{ {
/* free function definition */ /* free function definition */
register char *cp= strrchr(name,'.'); char *cp= strrchr(name,'.');
if(cp) if(cp)
{ {
Namval_t *npv; Namval_t *npv;
@ -785,8 +785,8 @@ static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot),
* print out the name and value of a name-value pair <np> * print out the name and value of a name-value pair <np>
*/ */
static int print_namval __PARAM__((Sfio_t *file,register Namval_t *np,register int flag), (file, np, flag)) __OTORP__(Sfio_t *file;register Namval_t *np;register int flag;){ 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;){
register char *cp; char *cp;
sh_sigcheck(); sh_sigcheck();
if(flag) if(flag)
flag = '\n'; flag = '\n';
@ -816,7 +816,7 @@ static int print_namval __PARAM__((Sfio_t *file,register Namval_t *np,register i
} }
if(cp=nv_getval(np)) if(cp=nv_getval(np))
{ {
register Namarr_t *ap; Namarr_t *ap;
sfputr(file,sh_fmtq(nv_name(np)),-1); sfputr(file,sh_fmtq(nv_name(np)),-1);
if(!flag) if(!flag)
{ {
@ -850,9 +850,9 @@ static void print_all __PARAM__((Sfio_t *file,Hashtab_t *root), (file, root)) __
* format initialization list given a list of assignments <argp> * format initialization list given a list of assignments <argp>
*/ */
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;){ 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;){
register struct argnod *ap; struct argnod *ap;
register char *cp,*nextcp; char *cp,*nextcp;
register int m,isarray; int m,isarray;
Namval_t *np; Namval_t *np;
if(n==0) if(n==0)
m = strlen(prefix); m = strlen(prefix);
@ -947,13 +947,13 @@ static void genvalue __PARAM__((struct argnod *argp, const char *prefix, int n,
/* /*
* walk the virtual tree and print or delete name-value pairs * walk the virtual tree and print or delete name-value pairs
*/ */
static char *walk_tree __PARAM__((register Namval_t *np, int dlete), (np, dlete)) __OTORP__(register Namval_t *np; int dlete;){ static char *walk_tree __PARAM__((Namval_t *np, int dlete), (np, dlete)) __OTORP__(Namval_t *np; int dlete;){
static Sfio_t *out; static Sfio_t *out;
int n; int n;
Fcin_t save; Fcin_t save;
int savtop = staktell(); int savtop = staktell();
char *savptr = stakfreeze(0); char *savptr = stakfreeze(0);
register struct argnod *ap; struct argnod *ap;
struct argnod *arglist=0; struct argnod *arglist=0;
char *name = nv_name(np); char *name = nv_name(np);
stakseek(ARGVAL); stakseek(ARGVAL);
@ -985,7 +985,7 @@ static char *walk_tree __PARAM__((register Namval_t *np, int dlete), (np, dlete)
/* /*
* get discipline for compound initializations * get discipline for compound initializations
*/ */
static char *get_tree __PARAM__((register Namval_t *np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t *np; Namfun_t *fp;){ static char *get_tree __PARAM__((Namval_t *np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t *np; Namfun_t *fp;){
NOT_USED(fp); NOT_USED(fp);
return(walk_tree(np,0)); return(walk_tree(np,0));
} }
@ -993,7 +993,7 @@ static char *get_tree __PARAM__((register Namval_t *np, Namfun_t *fp), (np, fp))
/* /*
* put discipline for compound initializations * put discipline for compound initializations
*/ */
static void put_tree __PARAM__((register Namval_t *np, const char *val, int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t *np; const char *val; int flags;Namfun_t *fp;){ 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); walk_tree(np,1);
if(fp = nv_stack(np,NIL(Namfun_t*))) if(fp = nv_stack(np,NIL(Namfun_t*)))
{ {
@ -1008,8 +1008,8 @@ static void put_tree __PARAM__((register Namval_t *np, const char *val, int flag
/* /*
* Insert discipline to cause $x to print current tree * Insert discipline to cause $x to print current tree
*/ */
void nv_setvtree __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ void nv_setvtree __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register Namfun_t *nfp = newof(NIL(__V_*),Namfun_t,1,0); Namfun_t *nfp = newof(NIL(__V_*),Namfun_t,1,0);
nfp->disc = &treedisc; nfp->disc = &treedisc;
nv_stack(np, nfp); nv_stack(np, nfp);
} }
@ -1017,11 +1017,11 @@ void nv_setvtree __PARAM__((register Namval_t *np), (np)) __OTORP__(register Nam
/* /*
* print the attributes of name value pair give by <np> * print the attributes of name value pair give by <np>
*/ */
static void print_attribute __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ static void print_attribute __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register const Shtable_t *tp; const Shtable_t *tp;
register char *cp; char *cp;
register unsigned val; unsigned val;
register unsigned mask; unsigned mask;
#ifdef SHOPT_OO #ifdef SHOPT_OO
Namval_t *nq; Namval_t *nq;
char *cclass=0; char *cclass=0;
@ -1099,9 +1099,9 @@ static void print_attribute __PARAM__((register Namval_t *np), (np)) __OTORP__(r
*/ */
static void print_scan __PARAM__((Sfio_t *file, int flag, Hashtab_t *root, int option), (file, flag, root, option)) __OTORP__(Sfio_t *file; int flag; Hashtab_t *root; int option;){ static void print_scan __PARAM__((Sfio_t *file, int flag, Hashtab_t *root, int option), (file, flag, root, option)) __OTORP__(Sfio_t *file; int flag; Hashtab_t *root; int option;){
register char **argv; char **argv;
register Namval_t *np; Namval_t *np;
register int namec; int namec;
Namval_t *onp = 0; Namval_t *onp = 0;
flag &= ~NV_ASSIGN; flag &= ~NV_ASSIGN;
scanmask = flag; scanmask = flag;
@ -1148,7 +1148,7 @@ static void pushname __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
/* /*
* The inverse of creating a reference node * The inverse of creating a reference node
*/ */
static void unref __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ static void unref __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(!nv_isattr(np,NV_REF)) if(!nv_isattr(np,NV_REF))
return; return;
nv_offattr(np,NV_NOFREE|NV_REF); nv_offattr(np,NV_NOFREE|NV_REF);

View file

@ -113,8 +113,8 @@
#define SOFT 2 #define SOFT 2
int b_ulimit __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_ulimit __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *limit; char *limit;
register int flag = 0, mode=0, n; int flag = 0, mode=0, n;
#ifdef _lib_getrlimit #ifdef _lib_getrlimit
struct rlimit rlp; struct rlimit rlp;
#endif /* _lib_getrlimit */ #endif /* _lib_getrlimit */

View file

@ -101,8 +101,8 @@
#include "builtins.h" #include "builtins.h"
int b_umask __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_umask __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register char *mask; char *mask;
register int flag = 0, sflag = 0; int flag = 0, sflag = 0;
NOT_USED(extra); NOT_USED(extra);
while((argc = optget(argv,sh_optumask))) switch(argc) while((argc = optget(argv,sh_optumask))) switch(argc)
{ {
@ -121,7 +121,7 @@ int b_umask __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
argv += opt_index; argv += opt_index;
if(mask = *argv) if(mask = *argv)
{ {
register int c; int c;
if(isdigit(*mask)) if(isdigit(*mask))
{ {
while(c = *mask++) while(c = *mask++)

View file

@ -113,8 +113,8 @@ static int whence __PROTO__((char**, int));
* In this case return 0 when -v or -V or unknown option, otherwise * In this case return 0 when -v or -V or unknown option, otherwise
* the shift count to the command is returned * the shift count to the command is returned
*/ */
int b_command __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(register int argc;char *argv[];__V_ *extra;){ int b_command __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int n, flags=0; int n, flags=0;
NOT_USED(extra); NOT_USED(extra);
opt_index = opt_char = 0; opt_index = opt_char = 0;
while((n = optget(argv,sh_optcommand))) switch(n) while((n = optget(argv,sh_optcommand))) switch(n)
@ -151,7 +151,7 @@ int b_command __PARAM__((register int argc,char *argv[],__V_ *extra), (argc, arg
* for the whence command * for the whence command
*/ */
int b_whence __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){ int b_whence __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra)) __OTORP__(int argc;char *argv[];__V_ *extra;){
register int flags=0, n; int flags=0, n;
NOT_USED(argc); NOT_USED(argc);
NOT_USED(extra); NOT_USED(extra);
if(*argv[0]=='t') if(*argv[0]=='t')
@ -183,12 +183,12 @@ int b_whence __PARAM__((int argc,char *argv[],__V_ *extra), (argc, argv, extra))
return(whence(argv, flags)); return(whence(argv, flags));
} }
static int whence __PARAM__((char **argv, register int flags), (argv, flags)) __OTORP__(char **argv; register int flags;){ static int whence __PARAM__((char **argv, int flags), (argv, flags)) __OTORP__(char **argv; int flags;){
register const char *name; const char *name;
register Namval_t *np; Namval_t *np;
register const char *cp; const char *cp;
register aflag,r=0; int aflag,r=0;
register const char *msg; const char *msg;
int notrack = 1; int notrack = 1;
while(name= *argv++) while(name= *argv++)
{ {

View file

@ -107,7 +107,7 @@ static char macro[] = "_??";
* if <str> is equal to <newstr> returns <str>+strlen(<str>)+1 * if <str> is equal to <newstr> returns <str>+strlen(<str>)+1
* otherwise returns <str>+strlen(<str>) * otherwise returns <str>+strlen(<str>)
*/ */
static char *overlay __PARAM__((register char *str,register const char *newstr), (str, newstr)) __OTORP__(register char *str;register const char *newstr;){ static char *overlay __PARAM__((char *str,const char *newstr), (str, newstr)) __OTORP__(char *str;const char *newstr;){
while(*str && *str == *newstr++) while(*str && *str == *newstr++)
str++; str++;
if(*str) if(*str)
@ -132,7 +132,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
char *staksav = stakptr(0); char *staksav = stakptr(0);
struct comnod *comptr = (struct comnod*)stakalloc(sizeof(struct comnod)); struct comnod *comptr = (struct comnod*)stakalloc(sizeof(struct comnod));
struct argnod *ap = (struct argnod*)stakseek(ARGVAL); struct argnod *ap = (struct argnod*)stakseek(ARGVAL);
register char *out; char *out;
char *begin; char *begin;
int addstar; int addstar;
int rval = 0; int rval = 0;
@ -140,8 +140,8 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
int nomarkdirs = !sh_isoption(SH_MARKDIRS); int nomarkdirs = !sh_isoption(SH_MARKDIRS);
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
{ {
register int c = *cur; int c = *cur;
register genchar *cp; genchar *cp;
/* adjust cur */ /* adjust cur */
cp = (genchar *)outbuff + *cur; cp = (genchar *)outbuff + *cur;
c = *cp; c = *cp;
@ -157,7 +157,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
ap->argflag = (ARG_MAC|ARG_EXP); ap->argflag = (ARG_MAC|ARG_EXP);
ap->argnxt.ap = 0; ap->argnxt.ap = 0;
{ {
register int c; int c;
if(out>outbuff) if(out>outbuff)
{ {
/* go to beginning of word */ /* go to beginning of word */
@ -201,10 +201,10 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
if(mode!='*') if(mode!='*')
sh_onoption(SH_MARKDIRS); sh_onoption(SH_MARKDIRS);
{ {
register char **com; char **com;
char *cp=begin; char *cp=begin;
int narg,cmd_completion=0; int narg,cmd_completion=0;
register int size; int size;
while(cp>outbuff && ((size=cp[-1])==' ' || size=='\t')) while(cp>outbuff && ((size=cp[-1])==' ' || size=='\t'))
cp--; cp--;
if((cp==outbuff || strchr(";&|(",size)) && *begin!='~' && !strchr(ap->argval,'/')) if((cp==outbuff || strchr(";&|(",size)) && *begin!='~' && !strchr(ap->argval,'/'))
@ -230,7 +230,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
{ {
if (strip && !cmd_completion) if (strip && !cmd_completion)
{ {
register char **ptrcom; char **ptrcom;
for(ptrcom=com;*ptrcom;ptrcom++) for(ptrcom=com;*ptrcom;ptrcom++)
/* trim directory prefix */ /* trim directory prefix */
*ptrcom = path_basename(*ptrcom); *ptrcom = path_basename(*ptrcom);
@ -317,7 +317,7 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
sh_offoption(SH_MARKDIRS); sh_offoption(SH_MARKDIRS);
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
{ {
register int c; int c;
/* first re-adjust cur */ /* first re-adjust cur */
out = outbuff + *cur; out = outbuff + *cur;
c = *out; c = *out;
@ -335,8 +335,8 @@ ed_expand __PARAM__((char outbuff[],int *cur,int *eol,int mode), (outbuff, cur,
* look for edit macro named _i * look for edit macro named _i
* if found, puts the macro definition into lookahead buffer and returns 1 * if found, puts the macro definition into lookahead buffer and returns 1
*/ */
ed_macro __PARAM__((register int i), (i)) __OTORP__(register int i;){ ed_macro __PARAM__((int i), (i)) __OTORP__(int i;){
register char *out; char *out;
Namval_t *np; Namval_t *np;
genchar buff[LOOKAHEAD+1]; genchar buff[LOOKAHEAD+1];
if(i != '@') if(i != '@')
@ -369,7 +369,7 @@ ed_macro __PARAM__((register int i), (i)) __OTORP__(register int i;){
* Enter the fc command on the current history line * Enter the fc command on the current history line
*/ */
ed_fulledit __PARAM__((void), ()){ ed_fulledit __PARAM__((void), ()){
register char *cp; char *cp;
if(!sh.hist_ptr) if(!sh.hist_ptr)
return(-1); return(-1);
/* use EDITOR on current command */ /* use EDITOR on current command */

View file

@ -190,7 +190,7 @@ int tty_check __PARAM__((int fd), (fd)) __OTORP__(int fd;){
* is called again without an intervening tty_set() * is called again without an intervening tty_set()
*/ */
int tty_get __PARAM__((register int fd, register struct termios *tty), (fd, tty)) __OTORP__(register int fd; register struct termios *tty;){ int tty_get __PARAM__((int fd, struct termios *tty), (fd, tty)) __OTORP__(int fd; struct termios *tty;){
if(fd == savefd) if(fd == savefd)
*tty = savetty; *tty = savetty;
else else
@ -243,7 +243,7 @@ int tty_set __PARAM__((int fd, int action, struct termios *tty), (fd, action, tt
* *
}*/ }*/
void tty_cooked __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ void tty_cooked __PARAM__((int fd), (fd)) __OTORP__(int fd;){
if(editb.e_raw==0) if(editb.e_raw==0)
return; return;
@ -274,7 +274,7 @@ void tty_cooked __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
* *
}*/ }*/
tty_raw __PARAM__((register int fd, int echo), (fd, echo)) __OTORP__(register int fd; int echo;){ tty_raw __PARAM__((int fd, int echo), (fd, echo)) __OTORP__(int fd; int echo;){
#ifdef L_MASK #ifdef L_MASK
struct ltchars lchars; struct ltchars lchars;
#endif /* L_MASK */ #endif /* L_MASK */
@ -385,7 +385,7 @@ tty_raw __PARAM__((register int fd, int echo), (fd, echo)) __OTORP__(register in
*/ */
# ifdef TIOCGETC # ifdef TIOCGETC
tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ tty_alt __PARAM__((int fd), (fd)) __OTORP__(int fd;){
int mask; int mask;
struct tchars ttychars; struct tchars ttychars;
switch(editb.e_raw) switch(editb.e_raw)
@ -431,7 +431,7 @@ tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
# define IEXTEN 0 # define IEXTEN 0
# endif /* IEXTEN */ # endif /* IEXTEN */
tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ tty_alt __PARAM__((int fd), (fd)) __OTORP__(int fd;){
switch(editb.e_raw) switch(editb.e_raw)
{ {
case ECHOMODE: case ECHOMODE:
@ -498,7 +498,7 @@ tty_alt __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
*/ */
int ed_window __PARAM__((void), ()){ int ed_window __PARAM__((void), ()){
int rows,cols; int rows,cols;
register char *cp = nv_getval(COLUMNS); char *cp = nv_getval(COLUMNS);
if(cp) if(cp)
cols = atoi(cp)-1; cols = atoi(cp)-1;
else else
@ -521,8 +521,8 @@ int ed_window __PARAM__((void), ()){
*/ */
void ed_flush __PARAM__((void), ()){ void ed_flush __PARAM__((void), ()){
register int n = editb.e_outptr-editb.e_outbase; int n = editb.e_outptr-editb.e_outbase;
register int fd = ERRIO; int fd = ERRIO;
if(n<=0) if(n<=0)
return; return;
write(fd,editb.e_outbase,(unsigned)n); write(fd,editb.e_outbase,(unsigned)n);
@ -568,11 +568,11 @@ void ed_crlf __PARAM__((void), ()){
*/ */
void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
register char *pp; char *pp;
register char *last; char *last;
char *ppmax; char *ppmax;
int myquote = 0; int myquote = 0;
register int qlen = 1; int qlen = 1;
char inquote = 0; char inquote = 0;
editb.e_fd = fd; editb.e_fd = fd;
#ifdef KSHELL #ifdef KSHELL
@ -584,7 +584,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
#endif /* KSHELL */ #endif /* KSHELL */
if(sh.hist_ptr) if(sh.hist_ptr)
{ {
register History_t *hp = sh.hist_ptr; History_t *hp = sh.hist_ptr;
editb.e_hismax = hist_max(hp); editb.e_hismax = hist_max(hp);
editb.e_hismin = hist_min(hp); editb.e_hismin = hist_min(hp);
} }
@ -599,7 +599,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
ppmax = pp+PRSIZE-1; ppmax = pp+PRSIZE-1;
*pp++ = '\r'; *pp++ = '\r';
{ {
register int c; int c;
while(c= *last++) switch(c) while(c= *last++) switch(c)
{ {
case '\r': case '\r':
@ -648,7 +648,7 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
*pp = 0; *pp = 0;
if((editb.e_wsize -= editb.e_plen) < 7) if((editb.e_wsize -= editb.e_plen) < 7)
{ {
register int shift = 7-editb.e_wsize; int shift = 7-editb.e_wsize;
editb.e_wsize = 7; editb.e_wsize = 7;
pp = editb.e_prompt+1; pp = editb.e_prompt+1;
strcpy(pp,pp+shift); strcpy(pp,pp+shift);
@ -675,8 +675,8 @@ void ed_setup __PARAM__((int fd), (fd)) __OTORP__(int fd;){
* sfpkrd() correctly (i,e., those that support poll() or select() * sfpkrd() correctly (i,e., those that support poll() or select()
*/ */
int ed_read __PARAM__((int fd, char *buff, int size), (fd, buff, size)) __OTORP__(int fd; char *buff; int size;){ int ed_read __PARAM__((int fd, char *buff, int size), (fd, buff, size)) __OTORP__(int fd; char *buff; int size;){
register int rv= -1; int rv= -1;
register int delim = (editb.e_raw==RAWMODE?'\r':'\n'); int delim = (editb.e_raw==RAWMODE?'\r':'\n');
sh_onstate(SH_TTYWAIT); sh_onstate(SH_TTYWAIT);
errno = EINTR; errno = EINTR;
while(rv<0 && errno==EINTR) while(rv<0 && errno==EINTR)
@ -740,10 +740,10 @@ done:
* onto the stack so that it can be checked for KEYTRAP * onto the stack so that it can be checked for KEYTRAP
* putstack() returns 1 except when in the middle of a multi-byte char * putstack() returns 1 except when in the middle of a multi-byte char
*/ */
static int putstack __PARAM__((char string[], register int nbyte, int type), (string, nbyte, type)) __OTORP__(char string[]; register int nbyte; int type;){ static int putstack __PARAM__((char string[], int nbyte, int type), (string, nbyte, type)) __OTORP__(char string[]; int nbyte; int type;){
register int c; int c;
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
register int max,last; int max,last;
static int curchar, cursize=0; static int curchar, cursize=0;
last = max = nbyte; last = max = nbyte;
nbyte = 0; nbyte = 0;
@ -829,7 +829,7 @@ static int putstack __PARAM__((char string[], register int nbyte, int type), (st
* 2 Next key is literal * 2 Next key is literal
*/ */
int ed_getchar __PARAM__((int mode), (mode)) __OTORP__(int mode;){ int ed_getchar __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int n, c; int n, c;
char readin[LOOKAHEAD+1]; char readin[LOOKAHEAD+1];
if(!lookahead) if(!lookahead)
{ {
@ -887,7 +887,7 @@ int ed_getchar __PARAM__((int mode), (mode)) __OTORP__(int mode;){
return(c); return(c);
} }
void ed_ungetchar __PARAM__((register int c), (c)) __OTORP__(register int c;){ void ed_ungetchar __PARAM__((int c), (c)) __OTORP__(int c;){
if (lookahead < LOOKAHEAD) if (lookahead < LOOKAHEAD)
previous[lookahead++] = c; previous[lookahead++] = c;
return; return;
@ -897,10 +897,10 @@ void ed_ungetchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
* put a character into the output buffer * put a character into the output buffer
*/ */
void ed_putchar __PARAM__((register int c), (c)) __OTORP__(register int c;){ void ed_putchar __PARAM__((int c), (c)) __OTORP__(int c;){
register char *dp = editb.e_outptr; char *dp = editb.e_outptr;
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
register int d; int d;
/* check for place holder */ /* check for place holder */
if(c == MARKER) if(c == MARKER)
return; return;
@ -934,9 +934,9 @@ void ed_putchar __PARAM__((register int c), (c)) __OTORP__(register int c;){
*/ */
ed_virt_to_phys __PARAM__((genchar *virt,genchar *phys,int cur,int voff,int poff), (virt, phys, cur, voff, poff)) __OTORP__(genchar *virt;genchar *phys;int cur;int voff;int poff;){ ed_virt_to_phys __PARAM__((genchar *virt,genchar *phys,int cur,int voff,int poff), (virt, phys, cur, voff, poff)) __OTORP__(genchar *virt;genchar *phys;int cur;int voff;int poff;){
register genchar *sp = virt; genchar *sp = virt;
register genchar *dp = phys; genchar *dp = phys;
register int c; int c;
genchar *curp = sp + cur; genchar *curp = sp + cur;
genchar *dpmax = phys+MAXLINE; genchar *dpmax = phys+MAXLINE;
int r; int r;
@ -1001,11 +1001,11 @@ ed_virt_to_phys __PARAM__((genchar *virt,genchar *phys,int cur,int voff,int poff
*/ */
int ed_internal __PARAM__((const char *src, genchar *dest), (src, dest)) __OTORP__(const char *src; genchar *dest;){ int ed_internal __PARAM__((const char *src, genchar *dest), (src, dest)) __OTORP__(const char *src; genchar *dest;){
register const unsigned char *cp = (unsigned char *)src; const unsigned char *cp = (unsigned char *)src;
register int c; int c;
register genchar *dp = dest; genchar *dp = dest;
register int d; int d;
register int size; int size;
if((unsigned char*)dest == cp) if((unsigned char*)dest == cp)
{ {
genchar buffer[MAXLINE]; genchar buffer[MAXLINE];
@ -1042,9 +1042,9 @@ int ed_internal __PARAM__((const char *src, genchar *dest), (src, dest)) __OTORP
*/ */
int ed_external __PARAM__((const genchar *src, char *dest), (src, dest)) __OTORP__(const genchar *src; char *dest;){ int ed_external __PARAM__((const genchar *src, char *dest), (src, dest)) __OTORP__(const genchar *src; char *dest;){
register int c; int c;
register char *dp = dest; char *dp = dest;
register int d; int d;
char *dpmax = dp+sizeof(genchar)*MAXLINE-2; char *dpmax = dp+sizeof(genchar)*MAXLINE-2;
if((char*)src == dp) if((char*)src == dp)
{ {
@ -1084,7 +1084,7 @@ void ed_gencpy __PARAM__((genchar *dp,const genchar *sp), (dp, sp)) __OTORP__(ge
* copy at most <n> items from <sp> to <dp> * copy at most <n> items from <sp> to <dp>
*/ */
void ed_genncpy __PARAM__((register genchar *dp,register const genchar *sp, int n), (dp, sp, n)) __OTORP__(register genchar *dp;register const genchar *sp; int n;){ void ed_genncpy __PARAM__((genchar *dp,const genchar *sp, int n), (dp, sp, n)) __OTORP__(genchar *dp;const genchar *sp; int n;){
while(n-->0 && (*dp++ = *sp++)); while(n-->0 && (*dp++ = *sp++));
} }
@ -1092,8 +1092,8 @@ void ed_genncpy __PARAM__((register genchar *dp,register const genchar *sp, int
* find the string length of <str> * find the string length of <str>
*/ */
int ed_genlen __PARAM__((register const genchar *str), (str)) __OTORP__(register const genchar *str;){ int ed_genlen __PARAM__((const genchar *str), (str)) __OTORP__(const genchar *str;){
register const genchar *sp = str; const genchar *sp = str;
while(*sp++); while(*sp++);
return(sp-str-1); return(sp-str-1);
} }
@ -1108,10 +1108,10 @@ int ed_genlen __PARAM__((register const genchar *str), (str)) __OTORP__(register
*/ */
ed_setwidth __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ ed_setwidth __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int indx = 0; int indx = 0;
register int state = 0; int state = 0;
register int c; int c;
register int n = 0; int n = 0;
static char widths[6] = {1,1}; static char widths[6] = {1,1};
while(1) switch(c = *string++) while(1) switch(c = *string++)
{ {
@ -1160,7 +1160,7 @@ ed_setwidth __PARAM__((const char *string), (string)) __OTORP__(const char *stri
/* /*
* returns 1 when <n> bytes starting at <a> and <b> are equal * returns 1 when <n> bytes starting at <a> and <b> are equal
*/ */
static int compare __PARAM__((register const char *a,register const char *b,register int n), (a, b, n)) __OTORP__(register const char *a;register const char *b;register int n;){ static int compare __PARAM__((const char *a,const char *b,int n), (a, b, n)) __OTORP__(const char *a;const char *b;int n;){
while(n-->0) while(n-->0)
{ {
if(*a++ != *b++) if(*a++ != *b++)
@ -1188,8 +1188,8 @@ static struct termio ott;
tcgetattr __PARAM__((int fd, struct termios *tt), (fd, tt)) __OTORP__(int fd; struct termios *tt;){ tcgetattr __PARAM__((int fd, struct termios *tt), (fd, tt)) __OTORP__(int fd; struct termios *tt;){
register int r; int r;
register int i; int i;
tcgeta = 0; tcgeta = 0;
echoctl = (ECHOCTL!=0); echoctl = (ECHOCTL!=0);
if((r=ioctl(fd,TCGETS,tt))>=0 || errno!=EINVAL) if((r=ioctl(fd,TCGETS,tt))>=0 || errno!=EINVAL)
@ -1209,10 +1209,10 @@ tcgetattr __PARAM__((int fd, struct termios *tt), (fd, tt)) __OTORP__(int fd; st
} }
tcsetattr __PARAM__((int fd,int mode,struct termios *tt), (fd, mode, tt)) __OTORP__(int fd;int mode;struct termios *tt;){ tcsetattr __PARAM__((int fd,int mode,struct termios *tt), (fd, mode, tt)) __OTORP__(int fd;int mode;struct termios *tt;){
register int r; int r;
if(tcgeta) if(tcgeta)
{ {
register int i; int i;
ott.c_lflag = tt->c_lflag; ott.c_lflag = tt->c_lflag;
ott.c_oflag = tt->c_oflag; ott.c_oflag = tt->c_oflag;
ott.c_iflag = tt->c_iflag; ott.c_iflag = tt->c_iflag;
@ -1250,10 +1250,10 @@ tcsetattr __PARAM__((int fd,int mode,struct termios *tt), (fd, mode, tt)) __OTOR
* Execute keyboard trap on given buffer <inbuff> of given size <isize> * Execute keyboard trap on given buffer <inbuff> of given size <isize>
* <mode> < 0 for vi insert mode * <mode> < 0 for vi insert mode
*/ */
static int keytrap __PARAM__((char *inbuff,register int insize, int bufsize, int mode), (inbuff, insize, bufsize, mode)) __OTORP__(char *inbuff;register int insize; int bufsize; int mode;){ static int keytrap __PARAM__((char *inbuff,int insize, int bufsize, int mode), (inbuff, insize, bufsize, mode)) __OTORP__(char *inbuff;int insize; int bufsize; int mode;){
static char vi_insert[2]; static char vi_insert[2];
static long col; static long col;
register char *cp; char *cp;
inbuff[insize] = 0; inbuff[insize] = 0;
col = editb.e_cur; col = editb.e_cur;
if(mode== -2) if(mode== -2)

View file

@ -190,10 +190,10 @@ static int cr_ok;
static Histloc_t location = { -5, 0 }; static Histloc_t location = { -5, 0 };
ed_emacsread __PARAM__((int fd,char *buff,int scend), (fd, buff, scend)) __OTORP__(int fd;char *buff;int scend;){ ed_emacsread __PARAM__((int fd,char *buff,int scend), (fd, buff, scend)) __OTORP__(int fd;char *buff;int scend;){
register int c; int c;
register int i; int i;
register genchar *out; genchar *out;
register int count; int count;
int adjust,oadjust; int adjust,oadjust;
char backslash; char backslash;
genchar *kptr; genchar *kptr;
@ -667,8 +667,8 @@ process:
} }
static void show_info __PARAM__((const char *str), (str)) __OTORP__(const char *str;){ static void show_info __PARAM__((const char *str), (str)) __OTORP__(const char *str;){
register genchar *out = drawbuff; genchar *out = drawbuff;
register int c; int c;
genchar string[LBUF]; genchar string[LBUF];
int sav_cur = cur; int sav_cur = cur;
/* save current line */ /* save current line */
@ -690,15 +690,15 @@ static void show_info __PARAM__((const char *str), (str)) __OTORP__(const char *
draw(UPDATE); draw(UPDATE);
} }
static void putstring __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){ static void putstring __PARAM__((char *sp), (sp)) __OTORP__(char *sp;){
register int c; int c;
while (c= *sp++) while (c= *sp++)
putchar(c); putchar(c);
} }
static int escape __PARAM__((register genchar *out,int count), (out, count)) __OTORP__(register genchar *out;int count;){ static int escape __PARAM__((genchar *out,int count), (out, count)) __OTORP__(genchar *out;int count;){
register int i,value; int i,value;
int digit,ch; int digit,ch;
digit = 0; digit = 0;
value = 0; value = 0;
@ -965,7 +965,7 @@ static int escape __PARAM__((register genchar *out,int count), (out, count)) __O
*/ */
static void xcommands __PARAM__((int count), (count)) __OTORP__(int count;){ static void xcommands __PARAM__((int count), (count)) __OTORP__(int count;){
register int i = ed_getchar(0); int i = ed_getchar(0);
NOT_USED(count); NOT_USED(count);
switch(i) switch(i)
{ {
@ -1052,9 +1052,9 @@ static void search __PARAM__((genchar *out,int direction), (out, direction)) __O
#ifndef ESH_NFIRST #ifndef ESH_NFIRST
Histloc_t location; Histloc_t location;
#endif #endif
register int i,sl; int i,sl;
genchar str_buff[LBUF]; genchar str_buff[LBUF];
register genchar *string = drawbuff; genchar *string = drawbuff;
/* save current line */ /* save current line */
char sav_cur = cur; char sav_cur = cur;
genncpy(str_buff,string,sizeof(str_buff)/CHARSIZE-1); genncpy(str_buff,string,sizeof(str_buff)/CHARSIZE-1);
@ -1161,18 +1161,18 @@ static void draw __PARAM__((Draw_t option), (option)) __OTORP__(Draw_t option;){
#define UPPER '>' #define UPPER '>'
static char overflow; /* Screen overflow flag set */ static char overflow; /* Screen overflow flag set */
register genchar *sptr; /* Pointer within screen */ genchar *sptr; /* Pointer within screen */
static int offset; /* Screen offset */ static int offset; /* Screen offset */
static char scvalid; /* Screen is up to date */ static char scvalid; /* Screen is up to date */
genchar nscreen[2*MAXLINE]; /* New entire screen */ genchar nscreen[2*MAXLINE]; /* New entire screen */
genchar *ncursor; /* New cursor */ genchar *ncursor; /* New cursor */
register genchar *nptr; /* Pointer to New screen */ genchar *nptr; /* Pointer to New screen */
char longline; /* Line overflow */ char longline; /* Line overflow */
genchar *logcursor; genchar *logcursor;
genchar *nscend; /* end of logical screen */ genchar *nscend; /* end of logical screen */
register int i; int i;
nptr = nscreen; nptr = nscreen;
sptr = drawbuff; sptr = drawbuff;
@ -1330,8 +1330,8 @@ static void draw __PARAM__((Draw_t option), (option)) __OTORP__(Draw_t option;){
* cursor is set to reflect the change * cursor is set to reflect the change
*/ */
static void setcursor __PARAM__((register int newp,int c), (newp, c)) __OTORP__(register int newp;int c;){ static void setcursor __PARAM__((int newp,int c), (newp, c)) __OTORP__(int newp;int c;){
register int oldp = cursor - screen; int oldp = cursor - screen;
if (oldp > newp) if (oldp > newp)
{ {
if (!cr_ok || (2*(newp+plen)>(oldp+plen))) if (!cr_ok || (2*(newp+plen)>(oldp+plen)))
@ -1359,12 +1359,12 @@ skip:
} }
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
static int print __PARAM__((register int c), (c)) __OTORP__(register int c;){ static int print __PARAM__((int c), (c)) __OTORP__(int c;){
return((c&~STRIP)==0 && isprint(c)); return((c&~STRIP)==0 && isprint(c));
} }
static int isword __PARAM__((register int i), (i)) __OTORP__(register int i;){ static int isword __PARAM__((int i), (i)) __OTORP__(int i;){
register int c = drawbuff[i]; int c = drawbuff[i];
return((c&~STRIP) || isalnum(c)); return((c&~STRIP) || isalnum(c));
} }
#endif /* SHOPT_MULTIBYTE */ #endif /* SHOPT_MULTIBYTE */

View file

@ -171,7 +171,7 @@ static History_t *hist_ptr;
# include <pwd.h> # include <pwd.h>
int acctinit __PARAM__((void), ()){ int acctinit __PARAM__((void), ()){
register char *cp, *acctfile; char *cp, *acctfile;
Namval_t *np = nv_search("ACCTFILE",sh.var_tree,0); Namval_t *np = nv_search("ACCTFILE",sh.var_tree,0);
if(!np || !(acctfile=nv_getval(np))) if(!np || !(acctfile=nv_getval(np)))
@ -229,13 +229,13 @@ static void hist_touch __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handl
* hist_open() returns 1, if history file is open * hist_open() returns 1, if history file is open
*/ */
int sh_histinit __PARAM__((void), ()){ int sh_histinit __PARAM__((void), ()){
register int fd; int fd;
register History_t *hp; History_t *hp;
register char *histname; char *histname;
char *fname=0; char *fname=0;
int histmask, maxlines, hist_start; int histmask, maxlines, hist_start;
register char *cp; char *cp;
register off_t hsize = 0; off_t hsize = 0;
if(sh.hist_ptr=hist_ptr) if(sh.hist_ptr=hist_ptr)
return(1); return(1);
@ -384,7 +384,7 @@ retry:
* close the history file and free the space * close the history file and free the space
*/ */
void hist_close __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){ void hist_close __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
sfclose(hp->histfp); sfclose(hp->histfp);
free((char*)hp); free((char*)hp);
hist_ptr = 0; hist_ptr = 0;
@ -401,7 +401,7 @@ void hist_close __PARAM__((register History_t *hp), (hp)) __OTORP__(register His
/* /*
* check history file format to see if it begins with special byte * check history file format to see if it begins with special byte
*/ */
static int hist_check __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ static int hist_check __PARAM__((int fd), (fd)) __OTORP__(int fd;){
unsigned char magic[2]; unsigned char magic[2];
lseek(fd,(off_t)0,SEEK_SET); lseek(fd,(off_t)0,SEEK_SET);
if((read(fd,(char*)magic,2)!=2) || (magic[0]!=HIST_UNDO)) if((read(fd,(char*)magic,2)!=2) || (magic[0]!=HIST_UNDO))
@ -422,9 +422,9 @@ static int hist_clean __PARAM__((int fd), (fd)) __OTORP__(int fd;){
*/ */
static void hist_trim __PARAM__((int n), (n)) __OTORP__(int n;){ static void hist_trim __PARAM__((int n), (n)) __OTORP__(int n;){
register char *cp; char *cp;
register int incmd=1, c=0; int incmd=1, c=0;
register History_t *hist_new, *hist_old = hist_ptr; History_t *hist_new, *hist_old = hist_ptr;
char *buff, *endbuff; char *buff, *endbuff;
off_t oldp,newp; off_t oldp,newp;
struct stat statb; struct stat statb;
@ -490,9 +490,9 @@ static void hist_trim __PARAM__((int n), (n)) __OTORP__(int n;){
/* /*
* position history file at size and find next command number * position history file at size and find next command number
*/ */
static int hist_nearend __PARAM__((Sfio_t *iop, register off_t size), (iop, size)) __OTORP__(Sfio_t *iop; register off_t size;){ static int hist_nearend __PARAM__((Sfio_t *iop, off_t size), (iop, size)) __OTORP__(Sfio_t *iop; off_t size;){
register unsigned char *cp, *endbuff; unsigned char *cp, *endbuff;
register int n, incmd=1; int n, incmd=1;
unsigned char *buff, marker[4]; unsigned char *buff, marker[4];
if(size <= 2L || sfseek(iop,size,SEEK_SET)<0) if(size <= 2L || sfseek(iop,size,SEEK_SET)<0)
goto begin; goto begin;
@ -556,10 +556,10 @@ begin:
* the previous command. * the previous command.
*/ */
void hist_eof __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){ void hist_eof __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
register char *cp,*first,*endbuff; char *cp,*first,*endbuff;
register int incmd = 0; int incmd = 0;
register off_t count = hp->histcnt; off_t count = hp->histcnt;
int n,skip=0; int n,skip=0;
char *buff; char *buff;
sfseek(hp->histfp,count,SEEK_SET); sfseek(hp->histfp,count,SEEK_SET);
@ -652,8 +652,8 @@ void hist_eof __PARAM__((register History_t *hp), (hp)) __OTORP__(register Histo
* This routine will cause the previous command to be cancelled * This routine will cause the previous command to be cancelled
*/ */
void hist_cancel __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){ void hist_cancel __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
register int c; int c;
if(!hp) if(!hp)
return; return;
sfputc(hp->histfp,HIST_UNDO); sfputc(hp->histfp,HIST_UNDO);
@ -668,8 +668,8 @@ void hist_cancel __PARAM__((register History_t *hp), (hp)) __OTORP__(register Hi
* flush the current history command * flush the current history command
*/ */
void hist_flush __PARAM__((register History_t *hp), (hp)) __OTORP__(register History_t *hp;){ void hist_flush __PARAM__((History_t *hp), (hp)) __OTORP__(History_t *hp;){
register char *buff; char *buff;
if(hp) if(hp)
{ {
if(buff=(char*)sfreserve(hp->histfp,0,1)) if(buff=(char*)sfreserve(hp->histfp,0,1))
@ -695,11 +695,11 @@ void hist_flush __PARAM__((register History_t *hp), (hp)) __OTORP__(register His
* a zero byte. Line sequencing is added as required * a zero byte. Line sequencing is added as required
*/ */
static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,register int insize,Sfdisc_t* handle), (iop, buff, insize, handle)) __OTORP__(Sfio_t *iop;const __V_ *buff;register int insize;Sfdisc_t* handle;){ static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,int insize,Sfdisc_t* handle), (iop, buff, insize, handle)) __OTORP__(Sfio_t *iop;const __V_ *buff;int insize;Sfdisc_t* handle;){
register char *bufptr = ((char*)buff)+insize; char *bufptr = ((char*)buff)+insize;
register History_t *hp = hist_ptr; History_t *hp = hist_ptr;
register int c,size = insize; int c,size = insize;
register off_t cur; off_t cur;
NOT_USED(handle); NOT_USED(handle);
if(!histflush) if(!histflush)
return(write(sffileno(iop),(char*)buff,size)); return(write(sffileno(iop),(char*)buff,size));
@ -769,7 +769,7 @@ static int hist_write __PARAM__((Sfio_t *iop,const __V_ *buff,register int insiz
* The buffer must be large enough to hold HIST_MARKSZ chars * The buffer must be large enough to hold HIST_MARKSZ chars
*/ */
static void hist_marker __PARAM__((register char *buff,register long cmdno), (buff, cmdno)) __OTORP__(register char *buff;register long cmdno;){ static void hist_marker __PARAM__((char *buff,long cmdno), (buff, cmdno)) __OTORP__(char *buff;long cmdno;){
*buff++ = HIST_CMDNO; *buff++ = HIST_CMDNO;
*buff++ = 0; *buff++ = 0;
*buff++ = (cmdno>>16); *buff++ = (cmdno>>16);
@ -781,14 +781,14 @@ static void hist_marker __PARAM__((register char *buff,register long cmdno), (bu
/* /*
* return byte offset in history file for command <n> * return byte offset in history file for command <n>
*/ */
off_t hist_tell __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(register History_t *hp; int n;){ off_t hist_tell __PARAM__((History_t *hp, int n), (hp, n)) __OTORP__(History_t *hp; int n;){
return(hp->histcmds[hist_ind(hp,n)]); return(hp->histcmds[hist_ind(hp,n)]);
} }
/* /*
* seek to the position of command <n> * seek to the position of command <n>
*/ */
off_t hist_seek __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(register History_t *hp; int n;){ off_t hist_seek __PARAM__((History_t *hp, int n), (hp, n)) __OTORP__(History_t *hp; int n;){
return(sfseek(hp->histfp,hp->histcmds[hist_ind(hp,n)],SEEK_SET)); return(sfseek(hp->histfp,hp->histcmds[hist_ind(hp,n)],SEEK_SET));
} }
@ -798,9 +798,9 @@ off_t hist_seek __PARAM__((register History_t *hp, int n), (hp, n)) __OTORP__(re
* each new-line character is replaced with string <nl>. * each new-line character is replaced with string <nl>.
*/ */
void hist_list __PARAM__((register History_t *hp,Sfio_t *outfile, off_t offset,int last, char *nl), (hp, outfile, offset, last, nl)) __OTORP__(register History_t *hp;Sfio_t *outfile; off_t offset;int last; char *nl;){ void hist_list __PARAM__((History_t *hp,Sfio_t *outfile, off_t offset,int last, char *nl), (hp, outfile, offset, last, nl)) __OTORP__(History_t *hp;Sfio_t *outfile; off_t offset;int last; char *nl;){
register int oldc=0; int oldc=0;
register int c; int c;
if(offset<0 || !hp) if(offset<0 || !hp)
{ {
sfputr(outfile,e_unknown,'\n'); sfputr(outfile,e_unknown,'\n');
@ -828,8 +828,8 @@ void hist_list __PARAM__((register History_t *hp,Sfio_t *outfile, off_t offset,i
* direction < 1 for backwards search * direction < 1 for backwards search
*/ */
Histloc_t hist_find __PARAM__((register History_t*hp,char *string,register int index1,int flag,int direction), (hp, string, index1, flag, direction)) __OTORP__(register History_t*hp;char *string;register int index1;int flag;int direction;){ Histloc_t hist_find __PARAM__((History_t*hp,char *string,int index1,int flag,int direction), (hp, string, index1, flag, direction)) __OTORP__(History_t*hp;char *string;int index1;int flag;int direction;){
register int index2; int index2;
off_t offset; off_t offset;
int *coffset=0; int *coffset=0;
Histloc_t location; Histloc_t location;
@ -886,10 +886,10 @@ Histloc_t hist_find __PARAM__((register History_t*hp,char *string,register int i
* returns the line number of the match if successful, otherwise -1 * returns the line number of the match if successful, otherwise -1
*/ */
int hist_match __PARAM__((register History_t *hp,off_t offset,char *string,int *coffset), (hp, offset, string, coffset)) __OTORP__(register History_t *hp;off_t offset;char *string;int *coffset;){ int hist_match __PARAM__((History_t *hp,off_t offset,char *string,int *coffset), (hp, offset, string, coffset)) __OTORP__(History_t *hp;off_t offset;char *string;int *coffset;){
register unsigned char *cp; unsigned char *cp;
register int c; int c;
register off_t count; off_t count;
int line = 0; int line = 0;
int chrs=0; int chrs=0;
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
@ -960,10 +960,10 @@ int hist_match __PARAM__((register History_t *hp,off_t offset,char *string,int *
*/ */
int hist_copy __PARAM__((char *s1,int size,int command,int line), (s1, size, command, line)) __OTORP__(char *s1;int size;int command;int line;){ int hist_copy __PARAM__((char *s1,int size,int command,int line), (s1, size, command, line)) __OTORP__(char *s1;int size;int command;int line;){
register int c; int c;
register History_t *hp = hist_ptr; History_t *hp = hist_ptr;
register int count = 0; int count = 0;
register char *s1max = s1+size; char *s1max = s1+size;
off_t offset; off_t offset;
if(!hp) if(!hp)
return(-1); return(-1);
@ -1002,10 +1002,10 @@ int hist_copy __PARAM__((char *s1,int size,int command,int line), (s1, size, com
*/ */
char *hist_word __PARAM__((char *string,int size,int word), (string, size, word)) __OTORP__(char *string;int size;int word;){ char *hist_word __PARAM__((char *string,int size,int word), (string, size, word)) __OTORP__(char *string;int size;int word;){
register int c; int c;
register char *s1 = string; char *s1 = string;
register unsigned char *cp = (unsigned char*)s1; unsigned char *cp = (unsigned char*)s1;
register int flag = 0; int flag = 0;
if(!hist_ptr) if(!hist_ptr)
#ifdef KSHELL #ifdef KSHELL
{ {
@ -1047,7 +1047,7 @@ char *hist_word __PARAM__((char *string,int size,int word), (string, size, word)
* compute the new command and line number. * compute the new command and line number.
*/ */
Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int line,int lines), (hp, command, line, lines)) __OTORP__(History_t *hp;register int command;register int line;int lines;){ Histloc_t hist_locate __PARAM__((History_t *hp,int command,int line,int lines), (hp, command, line, lines)) __OTORP__(History_t *hp;int command;int line;int lines;){
Histloc_t next; Histloc_t next;
line += lines; line += lines;
if(!hp) if(!hp)
@ -1057,7 +1057,7 @@ Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int
} }
if(lines > 0) if(lines > 0)
{ {
register int count; int count;
while(command <= hp->histind) while(command <= hp->histind)
{ {
count = hist_copy(NIL(char*),0, command,-1); count = hist_copy(NIL(char*),0, command,-1);
@ -1069,7 +1069,7 @@ Histloc_t hist_locate __PARAM__((History_t *hp,register int command,register int
} }
else else
{ {
register int least = (int)hp->histind-hp->histsize; int least = (int)hp->histind-hp->histsize;
while(1) while(1)
{ {
if(line >=0) if(line >=0)
@ -1094,7 +1094,7 @@ done:
* Handle history file exceptions * Handle history file exceptions
*/ */
static int hist_exceptf __PARAM__((Sfio_t* fp, int type, Sfdisc_t *handle), (fp, type, handle)) __OTORP__(Sfio_t* fp; int type; Sfdisc_t *handle;){ static int hist_exceptf __PARAM__((Sfio_t* fp, int type, Sfdisc_t *handle), (fp, type, handle)) __OTORP__(Sfio_t* fp; int type; Sfdisc_t *handle;){
register int newfd,oldfd; int newfd,oldfd;
History_t *hp = (History_t*)handle; History_t *hp = (History_t*)handle;
if(type==SF_WRITE) if(type==SF_WRITE)
{ {
@ -1110,7 +1110,7 @@ static int hist_exceptf __PARAM__((Sfio_t* fp, int type, Sfdisc_t *handle), (fp,
close(newfd); close(newfd);
if(lseek(oldfd,(off_t)0,SEEK_END) < hp->histcnt) if(lseek(oldfd,(off_t)0,SEEK_END) < hp->histcnt)
{ {
register int index = hp->histind; int index = hp->histind;
lseek(oldfd,(off_t)2,SEEK_SET); lseek(oldfd,(off_t)2,SEEK_SET);
hp->histcnt = 2; hp->histcnt = 2;
hp->histind = 1; hp->histind = 1;

View file

@ -247,9 +247,9 @@ static int textmod __PROTO__((int,int));
* *
-*/ -*/
ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar)) __OTORP__(int fd; register char *shbuf; int nchar;){ ed_viread __PARAM__((int fd, char *shbuf, int nchar), (fd, shbuf, nchar)) __OTORP__(int fd; char *shbuf; int nchar;){
register int i; /* general variable */ int i; /* general variable */
register int term_char; /* read() termination character */ int term_char; /* read() termination character */
char prompt[PRSIZE+2]; /* prompt */ char prompt[PRSIZE+2]; /* prompt */
genchar Physical[2*MAXLINE]; /* physical image */ genchar Physical[2*MAXLINE]; /* physical image */
genchar Ubuf[MAXLINE]; /* used for U command */ genchar Ubuf[MAXLINE]; /* used for U command */
@ -316,7 +316,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
} }
else else
{ {
register int c = shbuf[0]; int c = shbuf[0];
/*** Save and remove the last character if its an eol, ***/ /*** Save and remove the last character if its an eol, ***/
/* changing '\r' to '\n' */ /* changing '\r' to '\n' */
@ -448,7 +448,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
virtual[i] = '\n'; virtual[i] = '\n';
if(!echoctl) if(!echoctl)
{ {
register int c = virtual[i]; int c = virtual[i];
if( c<=usrerase) if( c<=usrerase)
{ {
/*** user typed escaped erase or kill char ***/ /*** user typed escaped erase or kill char ***/
@ -652,7 +652,7 @@ ed_viread __PARAM__((int fd, register char *shbuf, int nchar), (fd, shbuf, nchar
#define virtual editb.e_inbuf /* pointer to virtual image buffer */ #define virtual editb.e_inbuf /* pointer to virtual image buffer */
static void append __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int mode;){ static void append __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int mode;){
register int i,j; int i,j;
if( last_virt<max_col && last_phys<max_col ) if( last_virt<max_col && last_phys<max_col )
{ {
@ -675,8 +675,8 @@ static void append __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int
* *
}*/ }*/
static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __OTORP__(int nwords; register int cmd;){ static void backword __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
register int tcur_virt = cur_virt; int tcur_virt = cur_virt;
while( nwords-- && tcur_virt > first_virt ) while( nwords-- && tcur_virt > first_virt )
{ {
if( !kshisblank(tcur_virt) && kshisblank(tcur_virt-1) if( !kshisblank(tcur_virt) && kshisblank(tcur_virt-1)
@ -684,8 +684,8 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
--tcur_virt; --tcur_virt;
else if(cmd != 'B') else if(cmd != 'B')
{ {
register int last = isalph(tcur_virt-1); int last = isalph(tcur_virt-1);
register int cur = isalph(tcur_virt); int cur = isalph(tcur_virt);
if((!cur && last) || (cur && !last)) if((!cur && last) || (cur && !last))
--tcur_virt; --tcur_virt;
} }
@ -719,8 +719,8 @@ static void backword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __
}*/ }*/
static int cntlmode __PARAM__((void), ()){ static int cntlmode __PARAM__((void), ()){
register int c; int c;
register int i; int i;
genchar tmp_u_space[MAXLINE]; /* temporary u_space */ genchar tmp_u_space[MAXLINE]; /* temporary u_space */
genchar *real_u_space; /* points to real u_space */ genchar *real_u_space; /* points to real u_space */
int tmp_u_column = INVALID; /* temporary u_column */ int tmp_u_column = INVALID; /* temporary u_column */
@ -829,7 +829,7 @@ static int cntlmode __PARAM__((void), ()){
case cntl('V'): case cntl('V'):
{ {
register const char *p = &e_version[5]; const char *p = &e_version[5];
save_v(); save_v();
del_line(BAD); del_line(BAD);
while(c = *p++) while(c = *p++)
@ -971,7 +971,7 @@ static int cntlmode __PARAM__((void), ()){
case '#': /** insert(delete) # to (no)comment command **/ case '#': /** insert(delete) # to (no)comment command **/
if( cur_virt != INVALID ) if( cur_virt != INVALID )
{ {
register genchar *p = &virtual[last_virt+1]; genchar *p = &virtual[last_virt+1];
*p = 0; *p = 0;
/*** see whether first char is comment char ***/ /*** see whether first char is comment char ***/
c = (virtual[0]=='#'); c = (virtual[0]=='#');
@ -1026,8 +1026,8 @@ static int cntlmode __PARAM__((void), ()){
* *
}*/ }*/
static void cursor __PARAM__((register int x), (x)) __OTORP__(register int x;){ static void cursor __PARAM__((int x), (x)) __OTORP__(int x;){
register int delta; int delta;
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
while(physical[x]==MARKER) while(physical[x]==MARKER)
@ -1076,9 +1076,9 @@ static void cursor __PARAM__((register int x), (x)) __OTORP__(register int x;){
* *
}*/ }*/
static void cdelete __PARAM__((register int nchars, int mode), (nchars, mode)) __OTORP__(register int nchars; int mode;){ static void cdelete __PARAM__((int nchars, int mode), (nchars, mode)) __OTORP__(int nchars; int mode;){
register int i; int i;
register genchar *vp; genchar *vp;
if( cur_virt < first_virt ) if( cur_virt < first_virt )
{ {
@ -1162,8 +1162,8 @@ static void del_line __PARAM__((int mode), (mode)) __OTORP__(int mode;){
}*/ }*/
static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__(int motion; int mode;){ static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__(int motion; int mode;){
register int begin, end, delta; int begin, end, delta;
/* the following saves a register */ /* the following saves a */
if( cur_virt == INVALID ) if( cur_virt == INVALID )
return(0); return(0);
@ -1215,8 +1215,8 @@ static int delmotion __PARAM__((int motion, int mode), (motion, mode)) __OTORP__
* *
}*/ }*/
static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __OTORP__(int nwords; register int cmd;){ static void endword __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
register int tcur_virt = cur_virt; int tcur_virt = cur_virt;
while( nwords-- ) while( nwords-- )
{ {
if( !kshisblank(tcur_virt) && tcur_virt<=last_virt ) if( !kshisblank(tcur_virt) && tcur_virt<=last_virt )
@ -1251,8 +1251,8 @@ static void endword __PARAM__((int nwords, register int cmd), (nwords, cmd)) __O
* *
}*/ }*/
static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __OTORP__(register int nwords; int cmd;){ static void forward __PARAM__((int nwords, int cmd), (nwords, cmd)) __OTORP__(int nwords; int cmd;){
register int tcur_virt = cur_virt; int tcur_virt = cur_virt;
while( nwords-- ) while( nwords-- )
{ {
if( cmd == 'W' ) if( cmd == 'W' )
@ -1290,8 +1290,8 @@ static void forward __PARAM__((register int nwords, int cmd), (nwords, cmd)) __O
* *
}*/ }*/
static int getcount __PARAM__((register int c), (c)) __OTORP__(register int c;){ static int getcount __PARAM__((int c), (c)) __OTORP__(int c;){
register int i; int i;
/*** get any repeat count ***/ /*** get any repeat count ***/
@ -1330,9 +1330,9 @@ static int getcount __PARAM__((register int c), (c)) __OTORP__(register int c;){
* *
}*/ }*/
static void getline __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){ static void getline __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int c; int c;
register int tmp; int tmp;
addnl = 1; addnl = 1;
@ -1494,11 +1494,11 @@ static void getline __PARAM__((register int mode), (mode)) __OTORP__(register in
* *
}*/ }*/
static int mvcursor __PARAM__((register int motion), (motion)) __OTORP__(register int motion;){ static int mvcursor __PARAM__((int motion), (motion)) __OTORP__(int motion;){
register int count; int count;
register int tcur_virt; int tcur_virt;
register int incr = -1; int incr = -1;
register int bound = 0; int bound = 0;
static int last_find = 0; /* last find command */ static int last_find = 0; /* last find command */
switch(motion) switch(motion)
@ -1669,9 +1669,9 @@ find_b:
* print a string * print a string
*/ */
static void pr_string __PARAM__((register const char *sp), (sp)) __OTORP__(register const char *sp;){ static void pr_string __PARAM__((const char *sp), (sp)) __OTORP__(const char *sp;){
/*** copy string sp ***/ /*** copy string sp ***/
register char *ptr = editb.e_outptr; char *ptr = editb.e_outptr;
while(*sp) while(*sp)
*ptr++ = *sp++; *ptr++ = *sp++;
editb.e_outptr = ptr; editb.e_outptr = ptr;
@ -1685,7 +1685,7 @@ static void pr_string __PARAM__((register const char *sp), (sp)) __OTORP__(regis
* *
}*/ }*/
static void putstring __PARAM__((register int col, register int nchars), (col, nchars)) __OTORP__(register int col; register int nchars;){ static void putstring __PARAM__((int col, int nchars), (col, nchars)) __OTORP__(int col; int nchars;){
while( nchars-- ) while( nchars-- )
putchar(physical[col++]); putchar(physical[col++]);
return; return;
@ -1721,9 +1721,9 @@ static void putstring __PARAM__((register int col, register int nchars), (col, n
}*/ }*/
static void refresh __PARAM__((int mode), (mode)) __OTORP__(int mode;){ static void refresh __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int p; int p;
register int regb; int regb;
register int first_w = first_wind; int first_w = first_wind;
int p_differ; int p_differ;
int new_lw; int new_lw;
int ncur_phys; int ncur_phys;
@ -1890,8 +1890,8 @@ static void refresh __PARAM__((int mode), (mode)) __OTORP__(int mode;){
* *
}*/ }*/
static void replace __PARAM__((register int c, register int increment), (c, increment)) __OTORP__(register int c; register int increment;){ static void replace __PARAM__((int c, int increment), (c, increment)) __OTORP__(int c; int increment;){
register int cur_window; int cur_window;
if( cur_virt == INVALID ) if( cur_virt == INVALID )
{ {
@ -1945,7 +1945,7 @@ static void replace __PARAM__((register int c, register int increment), (c, incr
}*/ }*/
static void restore_v __PARAM__((void), ()){ static void restore_v __PARAM__((void), ()){
register int tmpcol; int tmpcol;
genchar tmpspace[MAXLINE]; genchar tmpspace[MAXLINE];
if( u_column == INVALID-1 ) if( u_column == INVALID-1 )
@ -1971,7 +1971,7 @@ static void restore_v __PARAM__((void), ()){
}*/ }*/
static void save_last __PARAM__((void), ()){ static void save_last __PARAM__((void), ()){
register int i; int i;
if( (i = cur_virt - first_virt + 1) > 0 ) if( (i = cur_virt - first_virt + 1) > 0 )
{ {
@ -2015,8 +2015,8 @@ static void save_v __PARAM__((void), ()){
* search for <string> in the current command * search for <string> in the current command
*/ */
static int curline_search __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ static int curline_search __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register int len=strlen(string); int len=strlen(string);
register const char *dp,*cp=string, *dpmax; const char *dp,*cp=string, *dpmax;
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
ed_external(u_space,(char*)u_space); ed_external(u_space,(char*)u_space);
#endif /* SHOPT_MULTIBYTE */ #endif /* SHOPT_MULTIBYTE */
@ -2031,10 +2031,10 @@ static int curline_search __PARAM__((const char *string), (string)) __OTORP__(co
return(-1); return(-1);
} }
static int search __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){ static int search __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register int new_direction; int new_direction;
register int oldcurhline; int oldcurhline;
register int i; int i;
static int direction = -1; static int direction = -1;
Histloc_t location; Histloc_t location;
@ -2114,9 +2114,9 @@ static int search __PARAM__((register int mode), (mode)) __OTORP__(register int
}*/ }*/
static void sync_cursor __PARAM__((void), ()){ static void sync_cursor __PARAM__((void), ()){
register int p; int p;
register int v; int v;
register int c; int c;
int new_phys; int new_phys;
if( cur_virt == INVALID ) if( cur_virt == INVALID )
@ -2199,10 +2199,10 @@ static void sync_cursor __PARAM__((void), ()){
* *
}*/ }*/
static int textmod __PARAM__((register int c, int mode), (c, mode)) __OTORP__(register int c; int mode;){ static int textmod __PARAM__((int c, int mode), (c, mode)) __OTORP__(int c; int mode;){
register int i; int i;
register genchar *p = lastline; genchar *p = lastline;
register int trepeat = repeat; int trepeat = repeat;
static int lastmacro; static int lastmacro;
genchar *savep; genchar *savep;
@ -2521,19 +2521,19 @@ yankeol:
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
static int isalph __PARAM__((register int c), (c)) __OTORP__(register int c;){ static int isalph __PARAM__((int c), (c)) __OTORP__(int c;){
register int v = virtual[c]; int v = virtual[c];
return((v&~STRIP) || isalnum(v) || v=='_'); return((v&~STRIP) || isalnum(v) || v=='_');
} }
static int kshisblank __PARAM__((register int c), (c)) __OTORP__(register int c;){ static int kshisblank __PARAM__((int c), (c)) __OTORP__(int c;){
register int v = virtual[c]; int v = virtual[c];
return((v&~STRIP)==0 && isspace(v)); return((v&~STRIP)==0 && isspace(v));
} }
static int ismetach __PARAM__((register int c), (c)) __OTORP__(register int c;){ static int ismetach __PARAM__((int c), (c)) __OTORP__(int c;){
register int v = virtual[c]; int v = virtual[c];
return((v&~STRIP)==0 && ismeta(v)); return((v&~STRIP)==0 && ismeta(v));
} }
@ -2544,7 +2544,7 @@ yankeol:
*/ */
static int getrchar() static int getrchar()
{ {
register int c; int c;
if((c=ed_getchar(1))== usrlnext) if((c=ed_getchar(1))== usrlnext)
c = ed_getchar(2); c = ed_getchar(2);
return(c); return(c);

View file

@ -66,10 +66,10 @@ static char id[] = "\n@(#)mamstate (AT&T Bell Laboratories) 06/26/89\0\n";
main(argc, argv) main(argc, argv)
int argc; int argc;
register char** argv; char** argv;
{ {
register char* s; char* s;
register int c; int c;
long ref; long ref;
struct stat st; struct stat st;
char buf[1024]; char buf[1024];

View file

@ -133,9 +133,9 @@ static char flagadr[NUM_OPTS+1];
* The -o option is used to set option by name * The -o option is used to set option by name
* This routine returns the number of non-option arguments * This routine returns the number of non-option arguments
*/ */
int sh_argopts __PARAM__((int argc,register char *argv[]), (argc, argv)) __OTORP__(int argc;register char *argv[];){ int sh_argopts __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
register int n; int n;
register Shopt_t newflags=sh.options, opt; Shopt_t newflags=sh.options, opt;
int setflag=0, action=0, trace=(int)sh_isoption(SH_XTRACE); int setflag=0, action=0, trace=(int)sh_isoption(SH_XTRACE);
Namval_t *np = NIL(Namval_t*); Namval_t *np = NIL(Namval_t*);
const char *cp; const char *cp;
@ -296,8 +296,8 @@ int sh_argopts __PARAM__((int argc,register char *argv[]), (argc, argv)) __OTORP
* returns the value of $- * returns the value of $-
*/ */
char *sh_argdolminus __PARAM__((void), ()){ char *sh_argdolminus __PARAM__((void), ()){
register const char *cp=sh_optksh; const char *cp=sh_optksh;
register char *flagp=flagadr; char *flagp=flagadr;
while(cp< &sh_optksh[NUM_OPTS]) while(cp< &sh_optksh[NUM_OPTS])
{ {
if(sh.options&flagval[cp-sh_optksh]) if(sh.options&flagval[cp-sh_optksh])
@ -329,8 +329,8 @@ void sh_argset __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
* If flag is set, then the block dolh is not freed * If flag is set, then the block dolh is not freed
*/ */
struct dolnod *sh_argfree __PARAM__((struct dolnod *blk,int flag), (blk, flag)) __OTORP__(struct dolnod *blk;int flag;){ struct dolnod *sh_argfree __PARAM__((struct dolnod *blk,int flag), (blk, flag)) __OTORP__(struct dolnod *blk;int flag;){
register struct dolnod* argr=blk; struct dolnod* argr=blk;
register struct dolnod* argblk; struct dolnod* argblk;
if(argblk=argr) if(argblk=argr)
{ {
if((--argblk->dolrefcnt)==0) if((--argblk->dolrefcnt)==0)
@ -364,10 +364,10 @@ struct dolnod *sh_argfree __PARAM__((struct dolnod *blk,int flag), (blk, flag))
* grab space for arglist and copy args * grab space for arglist and copy args
* The strings are copied after the argument vector * The strings are copied after the argument vector
*/ */
struct dolnod *sh_argcreate __PARAM__((register char *argv[]), (argv)) __OTORP__(register char *argv[];){ struct dolnod *sh_argcreate __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
register struct dolnod *dp; struct dolnod *dp;
register char **pp=argv, *sp; char **pp=argv, *sp;
register int size=0,n; int size=0,n;
/* count args and number of bytes of arglist */ /* count args and number of bytes of arglist */
while(sp= *pp++) while(sp= *pp++)
size += strlen(sp); size += strlen(sp);
@ -391,7 +391,7 @@ struct dolnod *sh_argcreate __PARAM__((register char *argv[]), (argv)) __OTORP__
* used to set new arguments for functions * used to set new arguments for functions
*/ */
struct dolnod *sh_argnew __PARAM__((char *argi[], struct dolnod **savargfor), (argi, savargfor)) __OTORP__(char *argi[]; struct dolnod **savargfor;){ struct dolnod *sh_argnew __PARAM__((char *argi[], struct dolnod **savargfor), (argi, savargfor)) __OTORP__(char *argi[]; struct dolnod **savargfor;){
register struct dolnod *olddolh = dolh; struct dolnod *olddolh = dolh;
*savargfor = argfor; *savargfor = argfor;
dolh = 0; dolh = 0;
argfor = 0; argfor = 0;
@ -416,7 +416,7 @@ void sh_argreset __PARAM__((struct dolnod *blk, struct dolnod *afor), (blk, afor
* increase the use count so that an sh_argset will not make it go away * increase the use count so that an sh_argset will not make it go away
*/ */
struct dolnod *sh_arguse __PARAM__((void), ()){ struct dolnod *sh_arguse __PARAM__((void), ()){
register struct dolnod *dh; struct dolnod *dh;
if(dh=dolh) if(dh=dolh)
dh->dolrefcnt++; dh->dolrefcnt++;
return(dh); return(dh);
@ -426,8 +426,8 @@ struct dolnod *sh_arguse __PARAM__((void), ()){
* Print option settings on standard output * Print option settings on standard output
* if mode==1 for -o format, otherwise +o format * if mode==1 for -o format, otherwise +o format
*/ */
static void print_opts __PARAM__((Shopt_t oflags,register int mode), (oflags, mode)) __OTORP__(Shopt_t oflags;register int mode;){ static void print_opts __PARAM__((Shopt_t oflags,int mode), (oflags, mode)) __OTORP__(Shopt_t oflags;int mode;){
register const Shtable_t *tp = shtab_options; const Shtable_t *tp = shtab_options;
Shopt_t value; Shopt_t value;
if(mode) if(mode)
sfputr(sfstdout,ERROR_translate(e_heading,1),'\n'); sfputr(sfstdout,ERROR_translate(e_heading,1),'\n');
@ -459,10 +459,10 @@ static void print_opts __PARAM__((Shopt_t oflags,register int mode), (oflags, mo
* build an argument list * build an argument list
*/ */
char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs, comptr)) __OTORP__(int *nargs; const struct comnod *comptr;){ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs, comptr)) __OTORP__(int *nargs; const struct comnod *comptr;){
register struct argnod *argp; struct argnod *argp;
struct argnod *arghead=0; struct argnod *arghead=0;
{ {
register const struct comnod *ac = comptr; const struct comnod *ac = comptr;
/* see if the arguments have already been expanded */ /* see if the arguments have already been expanded */
if(!ac->comarg) if(!ac->comarg)
{ {
@ -471,7 +471,7 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
} }
else if(!(ac->comtyp&COMSCAN)) else if(!(ac->comtyp&COMSCAN))
{ {
register struct dolnod *ap = (struct dolnod*)ac->comarg; struct dolnod *ap = (struct dolnod*)ac->comarg;
*nargs = ap->dolnum; *nargs = ap->dolnum;
return(ap->dolval+ap->dolbot); return(ap->dolval+ap->dolbot);
} }
@ -489,9 +489,9 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
} }
} }
{ {
register char **comargn; char **comargn;
register int argn; int argn;
register char **comargm; char **comargm;
argn = *nargs; argn = *nargs;
/* allow room to prepend args */ /* allow room to prepend args */
#ifdef SHOPT_VPIX #ifdef SHOPT_VPIX
@ -528,14 +528,14 @@ char **sh_argbuild __PARAM__((int *nargs, const struct comnod *comptr), (nargs,
} }
/* Argument expansion */ /* Argument expansion */
static int arg_expand __PARAM__((register struct argnod *argp, struct argnod **argchain), (argp, argchain)) __OTORP__(register struct argnod *argp; struct argnod **argchain;){ static int arg_expand __PARAM__((struct argnod *argp, struct argnod **argchain), (argp, argchain)) __OTORP__(struct argnod *argp; struct argnod **argchain;){
register int count = 0; int count = 0;
argp->argflag &= ~ARG_MAKE; argp->argflag &= ~ARG_MAKE;
#ifdef SHOPT_DEVFD #ifdef SHOPT_DEVFD
if(*argp->argval==0 && (argp->argflag&ARG_EXP)) if(*argp->argval==0 && (argp->argflag&ARG_EXP))
{ {
/* argument of the form (cmd) */ /* argument of the form (cmd) */
register struct argnod *ap; struct argnod *ap;
int monitor, fd, pv[2]; int monitor, fd, pv[2];
ap = (struct argnod*)stakseek(ARGVAL); ap = (struct argnod*)stakseek(ARGVAL);
ap->argflag |= ARG_MAKE; ap->argflag |= ARG_MAKE;

View file

@ -101,14 +101,14 @@
static int level; static int level;
static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type, double n), (ptr, lvalue, type, n)) __OTORP__(const char **ptr; struct lval *lvalue; int type; double n;){ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type, double n), (ptr, lvalue, type, n)) __OTORP__(const char **ptr; struct lval *lvalue; int type; double n;){
register double r= 0; double r= 0;
char *str = (char*)*ptr; char *str = (char*)*ptr;
switch(type) switch(type)
{ {
case ASSIGN: case ASSIGN:
{ {
register Namval_t *np = (Namval_t*)(lvalue->value); Namval_t *np = (Namval_t*)(lvalue->value);
register Namarr_t *ap; Namarr_t *ap;
if(ap = nv_arrayptr(np)) if(ap = nv_arrayptr(np))
{ {
if(!array_assoc(ap)) if(!array_assoc(ap))
@ -119,13 +119,13 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
} }
case LOOKUP: case LOOKUP:
{ {
register int c = *str; int c = *str;
lvalue->value = (char*)0; lvalue->value = (char*)0;
if(c=='.') if(c=='.')
c = str[1]; c = str[1];
if(isaletter(c)) if(isaletter(c))
{ {
register Namval_t *np; Namval_t *np;
while(c= *++str, isaname(c)||c=='.'); while(c= *++str, isaname(c)||c=='.');
if(c=='(') if(c=='(')
{ {
@ -177,7 +177,7 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
} }
case VALUE: case VALUE:
{ {
register Namval_t *np = (Namval_t*)(lvalue->value); Namval_t *np = (Namval_t*)(lvalue->value);
if(sh_isoption(SH_NOEXEC)) if(sh_isoption(SH_NOEXEC))
return(0); return(0);
if((level || sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER)) if((level || sh_isoption(SH_NOUNSET)) && nv_isnull(np) && !nv_isattr(np,NV_INTEGER))
@ -200,13 +200,13 @@ static double arith __PARAM__((const char **ptr, struct lval *lvalue, int type,
return(r); return(r);
} }
double sh_strnum __PARAM__((register const char *str, char** ptr), (str, ptr)) __OTORP__(register const char *str; char** ptr;){ double sh_strnum __PARAM__((const char *str, char** ptr), (str, ptr)) __OTORP__(const char *str; char** ptr;){
return(strval(str,(char**)ptr, arith)); return(strval(str,(char**)ptr, arith));
} }
double sh_arith __PARAM__((register const char *str), (str)) __OTORP__(register const char *str;){ double sh_arith __PARAM__((const char *str), (str)) __OTORP__(const char *str;){
const char *ptr = str; const char *ptr = str;
register double d; double d;
if(*str==0) if(*str==0)
return(0); return(0);
d = strval(str,(char**)&ptr,arith); d = strval(str,(char**)&ptr,arith);

View file

@ -114,8 +114,8 @@ struct index_array
* but <= ARRAY_MAX) is returned. * but <= ARRAY_MAX) is returned.
* *
*/ */
static int arsize __PARAM__((register int maxi), (maxi)) __OTORP__(register int maxi;){ static int arsize __PARAM__((int maxi), (maxi)) __OTORP__(int maxi;){
register int i = roundof(maxi,ARRAY_INCR); int i = roundof(maxi,ARRAY_INCR);
return (i>ARRAY_MAX?ARRAY_MAX:i); return (i>ARRAY_MAX?ARRAY_MAX:i);
} }
@ -126,10 +126,10 @@ static int arsize __PARAM__((register int maxi), (maxi)) __OTORP__(register int
* allocated Namarr_t structure is returned. * allocated Namarr_t structure is returned.
* <maxi> becomes the current index of the array. * <maxi> becomes the current index of the array.
*/ */
static struct index_array *array_grow __PARAM__((register struct index_array *arp,int maxi), (arp, maxi)) __OTORP__(register struct index_array *arp;int maxi;){ static struct index_array *array_grow __PARAM__((struct index_array *arp,int maxi), (arp, maxi)) __OTORP__(struct index_array *arp;int maxi;){
register struct index_array *ap; struct index_array *ap;
register int i=0; int i=0;
register int newsize = arsize(maxi+1); int newsize = arsize(maxi+1);
if (maxi >= ARRAY_MAX) if (maxi >= ARRAY_MAX)
error(ERROR_exit(1),e_subscript, fmtbase((long)maxi,10,0)); error(ERROR_exit(1),e_subscript, fmtbase((long)maxi,10,0));
ap = new_of(struct index_array,(newsize-1)*sizeof(union Value*)); ap = new_of(struct index_array,(newsize-1)*sizeof(union Value*));
@ -158,7 +158,7 @@ static struct index_array *array_grow __PARAM__((register struct index_array *ar
* Check for bounds violation for indexed array * Check for bounds violation for indexed array
*/ */
void array_check __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){ void array_check __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np); struct index_array *ap = (struct index_array*)nv_arrayptr(np);
if(ap->header.nelem&ARRAY_UNDEF) if(ap->header.nelem&ARRAY_UNDEF)
{ {
ap->header.nelem &= ~ARRAY_UNDEF; ap->header.nelem &= ~ARRAY_UNDEF;
@ -194,9 +194,9 @@ void array_check __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval
* After the lookup is done the last @ or * subscript is incremented * After the lookup is done the last @ or * subscript is incremented
*/ */
union Value *array_find __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){ union Value *array_find __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__(Namval_t *np;int flag;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np); struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register union Value *up; union Value *up;
register unsigned dot=0; unsigned dot=0;
if(is_associative(ap)) if(is_associative(ap))
up = (union Value*)((*ap->header.fun)(np,NIL(char*),0)); up = (union Value*)((*ap->header.fun)(np,NIL(char*),0));
else else
@ -241,12 +241,12 @@ union Value *array_find __PARAM__((Namval_t *np,int flag), (np, flag)) __OTORP__
* freeing relevant storage * freeing relevant storage
*/ */
static Namarr_t *nv_changearray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){ static Namarr_t *nv_changearray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){
register Namarr_t *ap; Namarr_t *ap;
char numbuff[NUMSIZE]; char numbuff[NUMSIZE];
unsigned dot, digit, n; unsigned dot, digit, n;
union Value *up; union Value *up;
struct index_array *save_ap; struct index_array *save_ap;
register char *string_index= &numbuff[NUMSIZE]; char *string_index= &numbuff[NUMSIZE];
numbuff[NUMSIZE]='\0'; numbuff[NUMSIZE]='\0';
if(!fun || !(ap = nv_arrayptr(np)) || is_associative(ap)) if(!fun || !(ap = nv_arrayptr(np)) || is_associative(ap))
@ -284,7 +284,7 @@ static Namarr_t *nv_changearray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,
* The array pointer is returned if sucessful. * The array pointer is returned if sucessful.
*/ */
Namarr_t *nv_setarray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){ Namarr_t *nv_setarray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char*,int)), (np, fun)) __OTORP__(Namval_t *np; __V_ *(*fun)();){
register Namarr_t *ap; Namarr_t *ap;
if(fun && (ap = nv_arrayptr(np)) && !is_associative(ap)) if(fun && (ap = nv_arrayptr(np)) && !is_associative(ap))
{ {
@ -321,8 +321,8 @@ Namarr_t *nv_setarray __PARAM__((Namval_t *np, __V_ *(*fun)(Namval_t*,const char
* Otherwise, 1 is returned. * Otherwise, 1 is returned.
*/ */
int nv_nextsub __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){ int nv_nextsub __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np); struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register unsigned dot; unsigned dot;
if(!ap || !(ap->header.nelem&ARRAY_SCAN)) if(!ap || !(ap->header.nelem&ARRAY_SCAN))
return(0); return(0);
if(is_associative(ap)) if(is_associative(ap))
@ -353,9 +353,9 @@ int nv_nextsub __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* The node pointer is returned which can be NULL if <np> is * The node pointer is returned which can be NULL if <np> is
* not already array and the ARRAY_ADD bit of <mode> is not set. * not already array and the ARRAY_ADD bit of <mode> is not set.
*/ */
Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode), (np, sp, mode)) __OTORP__(Namval_t *np;register char *sp;register long mode;){ Namval_t *nv_putsub __PARAM__((Namval_t *np,char *sp,long mode), (np, sp, mode)) __OTORP__(Namval_t *np;char *sp;long mode;){
register struct index_array *ap = (struct index_array*)nv_arrayptr(np); struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register int size = (mode&ARRAY_MASK); int size = (mode&ARRAY_MASK);
if(!ap || !ap->header.fun) if(!ap || !ap->header.fun)
{ {
if(sp) if(sp)
@ -367,7 +367,7 @@ Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode
} }
if(!ap || size>=ap->maxi) if(!ap || size>=ap->maxi)
{ {
register struct index_array *apold; struct index_array *apold;
if(size==0) if(size==0)
return(NIL(Namval_t*)); return(NIL(Namval_t*));
ap = array_grow(apold=ap,size); ap = array_grow(apold=ap,size);
@ -398,9 +398,9 @@ Namval_t *nv_putsub __PARAM__((Namval_t *np,register char *sp,register long mode
* process an array subscript for node <np> given the subscript <cp> * process an array subscript for node <np> given the subscript <cp>
* returns pointer to character after the subscript * returns pointer to character after the subscript
*/ */
char *nv_endsubscript __PARAM__((Namval_t *np, register char *cp, int mode), (np, cp, mode)) __OTORP__(Namval_t *np; register char *cp; int mode;){ char *nv_endsubscript __PARAM__((Namval_t *np, char *cp, int mode), (np, cp, mode)) __OTORP__(Namval_t *np; char *cp; int mode;){
register int count=1, quoted=0, c; int count=1, quoted=0, c;
register char *sp = cp+1; char *sp = cp+1;
/* first find matching ']' */ /* first find matching ']' */
while(count>0 && (c= *++cp)) while(count>0 && (c= *++cp))
{ {
@ -435,9 +435,9 @@ char *nv_endsubscript __PARAM__((Namval_t *np, register char *cp, int mode), (np
char *nv_getsub __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){ char *nv_getsub __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
static char numbuff[NUMSIZE]; static char numbuff[NUMSIZE];
register struct index_array *ap = (struct index_array*)nv_arrayptr(np); struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register unsigned dot, n; unsigned dot, n;
register char *cp = &numbuff[NUMSIZE]; char *cp = &numbuff[NUMSIZE];
if(!ap) if(!ap)
return(NIL(char*)); return(NIL(char*));
if(is_associative(ap)) if(is_associative(ap))
@ -456,7 +456,7 @@ char *nv_getsub __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
* If <np> is an indexed array node, the current subscript index * If <np> is an indexed array node, the current subscript index
* retuned, otherwise returns -1 * retuned, otherwise returns -1
*/ */
int nv_aindex __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){ int nv_aindex __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
Namarr_t *ap = nv_arrayptr(np); Namarr_t *ap = nv_arrayptr(np);
if(!ap || is_associative(ap)) if(!ap || is_associative(ap))
return(-1); return(-1);
@ -475,9 +475,9 @@ struct assoc_array
/* /*
* This is the default implementation for associate arrays * This is the default implementation for associate arrays
*/ */
__V_ *nv_associative __PARAM__((register Namval_t *np,const char *sp,int mode), (np, sp, mode)) __OTORP__(register Namval_t *np;const char *sp;int mode;){ __V_ *nv_associative __PARAM__((Namval_t *np,const char *sp,int mode), (np, sp, mode)) __OTORP__(Namval_t *np;const char *sp;int mode;){
register struct assoc_array *ap = (struct assoc_array*)nv_arrayptr(np); struct assoc_array *ap = (struct assoc_array*)nv_arrayptr(np);
register int type; int type;
switch(mode) switch(mode)
{ {
case NV_AINIT: case NV_AINIT:
@ -536,7 +536,7 @@ __V_ *nv_associative __PARAM__((register Namval_t *np,const char *sp,int mode),
/* /*
* Assign values to an array * Assign values to an array
*/ */
void nv_setvec __PARAM__((register Namval_t *np,register int argc,register char *argv[]), (np, argc, argv)) __OTORP__(register Namval_t *np;register int argc;register char *argv[];){ void nv_setvec __PARAM__((Namval_t *np,int argc,char *argv[]), (np, argc, argv)) __OTORP__(Namval_t *np;int argc;char *argv[];){
while(--argc >= 0) while(--argc >= 0)
{ {
if(argc>0 || nv_isattr(np,NV_ARRAY)) if(argc>0 || nv_isattr(np,NV_ARRAY))

View file

@ -136,8 +136,8 @@ void sh_deparse __PARAM__((Sfio_t *out, const union anynode *t,int tflags), (out
/* /*
* print script corresponding to shell tree <t> * print script corresponding to shell tree <t>
*/ */
static void p_tree __PARAM__((register const union anynode *t,register int tflags), (t, tflags)) __OTORP__(register const union anynode *t;register int tflags;){ static void p_tree __PARAM__((const union anynode *t,int tflags), (t, tflags)) __OTORP__(const union anynode *t;int tflags;){
register char *cp; char *cp;
int save = end_line; int save = end_line;
int needbrace = (tflags&NEED_BRACE); int needbrace = (tflags&NEED_BRACE);
tflags &= ~NEED_BRACE; tflags &= ~NEED_BRACE;
@ -280,7 +280,7 @@ static void p_tree __PARAM__((register const union anynode *t,register int tflag
case TARITH: case TARITH:
{ {
register struct argnod *ap = t->ar.arexpr; struct argnod *ap = t->ar.arexpr;
if(begin_line && level) if(begin_line && level)
sfnputc(outfile,'\t',level); sfnputc(outfile,'\t',level);
sfprintf(outfile,"(( %s ))%c",ap->argflag&ARG_RAW?sh_fmtq(ap->argval):ap->argval,end_line); sfprintf(outfile,"(( %s ))%c",ap->argflag&ARG_RAW?sh_fmtq(ap->argval):ap->argval,end_line);
@ -396,7 +396,7 @@ static void p_tree __PARAM__((register const union anynode *t,register int tflag
* decrement indent level for flag==END * decrement indent level for flag==END
*/ */
static void p_keyword __PARAM__((const char *word,int flag), (word, flag)) __OTORP__(const char *word;int flag;){ static void p_keyword __PARAM__((const char *word,int flag), (word, flag)) __OTORP__(const char *word;int flag;){
register int sep; int sep;
if(flag==END) if(flag==END)
sep = end_line; sep = end_line;
else if(*word=='[') else if(*word=='[')
@ -416,9 +416,9 @@ static void p_keyword __PARAM__((const char *word,int flag), (word, flag)) __OTO
level++; level++;
} }
static void p_arg __PARAM__((register const struct argnod *arg,register int endchar,int opts), (arg, endchar, opts)) __OTORP__(register const struct argnod *arg;register int endchar;int opts;){ static void p_arg __PARAM__((const struct argnod *arg,int endchar,int opts), (arg, endchar, opts)) __OTORP__(const struct argnod *arg;int endchar;int opts;){
register const char *cp; const char *cp;
register int flag; int flag;
do do
{ {
if(!arg->argnxt.ap) if(!arg->argnxt.ap)
@ -454,9 +454,9 @@ static void p_arg __PARAM__((register const struct argnod *arg,register int endc
return; return;
} }
static void p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){ static void p_redirect __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
register int iof; int iof;
register char *cp; char *cp;
for(;iop;iop=iop->ionxt) for(;iop;iop=iop->ionxt)
{ {
iof=iop->iofile; iof=iop->iofile;
@ -517,8 +517,8 @@ static void p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OT
return; return;
} }
static void p_comarg __PARAM__((const register struct comnod *com), (com)) __OTORP__(const register struct comnod *com;){ static void p_comarg __PARAM__((const struct comnod *com), (com)) __OTORP__(const struct comnod *com;){
register int flag = end_line; int flag = end_line;
if(com->comarg || com->comio) if(com->comarg || com->comio)
flag = ' '; flag = ' ';
if(com->comset) if(com->comset)
@ -538,8 +538,8 @@ static void p_comarg __PARAM__((const register struct comnod *com), (com)) __OTO
} }
static void p_comlist __PARAM__((const struct dolnod *dol,int endchar), (dol, endchar)) __OTORP__(const struct dolnod *dol;int endchar;){ static void p_comlist __PARAM__((const struct dolnod *dol,int endchar), (dol, endchar)) __OTORP__(const struct dolnod *dol;int endchar;){
register char *cp, *const*argv; char *cp, *const*argv;
register int flag = ' ', special; int flag = ' ', special;
argv = dol->dolval+ARG_SPARE; argv = dol->dolval+ARG_SPARE;
cp = *argv; cp = *argv;
special = (*cp=='[' && cp[1]==0); special = (*cp=='[' && cp[1]==0);
@ -562,7 +562,7 @@ static void p_comlist __PARAM__((const struct dolnod *dol,int endchar), (dol, en
return; return;
} }
static void p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTORP__(register const struct regnod *reg;){ static void p_switch __PARAM__((const struct regnod *reg), (reg)) __OTORP__(const struct regnod *reg;){
if(level>1) if(level>1)
sfnputc(outfile,'\t',level-1); sfnputc(outfile,'\t',level-1);
p_arg(reg->regptr,')',PRE); p_arg(reg->regptr,')',PRE);
@ -583,7 +583,7 @@ static void p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTO
/* /*
* output here documents * output here documents
*/ */
static void here_body __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){ static void here_body __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
Sfio_t *infile; Sfio_t *infile;
#ifdef xxx #ifdef xxx
if(iop->iolink) if(iop->iolink)

View file

@ -159,7 +159,7 @@
*/ */
static struct ld_info *getinfo __PARAM__((__V_ *module), (module)) __OTORP__(__V_ *module;){ static struct ld_info *getinfo __PARAM__((__V_ *module), (module)) __OTORP__(__V_ *module;){
struct ld_info *info=ld_info; struct ld_info *info=ld_info;
register int n=1; int n=1;
if (!ld_info || module != last_module) if (!ld_info || module != last_module)
{ {
last_module = module; last_module = module;

View file

@ -158,8 +158,8 @@ static void glob_dir __PROTO__((struct argnod*));
#ifdef SHOPT_NOCASE #ifdef SHOPT_NOCASE
# include <ctype.h> # include <ctype.h>
static void utol __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){ static void utol __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
register int c; int c;
for(; c= *((unsigned char*)str1); str1++,str2++) for(; c= *((unsigned char*)str1); str1++,str2++)
{ {
if(isupper(c)) if(isupper(c))
@ -180,9 +180,9 @@ static void glob_dir __PROTO__((struct argnod*));
int path_expand __PARAM__((const char *pattern, struct argnod **arghead), (pattern, arghead)) __OTORP__(const char *pattern; struct argnod **arghead;){ int path_expand __PARAM__((const char *pattern, struct argnod **arghead), (pattern, arghead)) __OTORP__(const char *pattern; struct argnod **arghead;){
register struct argnod *ap; struct argnod *ap;
register struct glob *gp; struct glob *gp;
register char *pat; char *pat;
#ifdef KSHELL #ifdef KSHELL
struct glob globdata; struct glob globdata;
membase = &globdata; membase = &globdata;
@ -223,10 +223,10 @@ int path_expand __PARAM__((const char *pattern, struct argnod **arghead), (patte
} }
static void glob_dir __PARAM__((struct argnod *ap), (ap)) __OTORP__(struct argnod *ap;){ static void glob_dir __PARAM__((struct argnod *ap), (ap)) __OTORP__(struct argnod *ap;){
register char *rescan; char *rescan;
register char *prefix; char *prefix;
register char *pat; char *pat;
register struct dirent *dirp; struct dirent *dirp;
DIR *dirf; DIR *dirf;
char *path=0; char *path=0;
char quote = 0; char quote = 0;
@ -344,7 +344,7 @@ process:
#endif /* SHOPT_NOCASE */ #endif /* SHOPT_NOCASE */
while(dirp = readdir(dirf)) while(dirp = readdir(dirf))
{ {
register int c; int c;
if(!D_FILENO(dirp)) if(!D_FILENO(dirp))
continue; continue;
if(fignore && *fignore && strmatch(dirp->d_name, fignore)) if(fignore && *fignore && strmatch(dirp->d_name, fignore))
@ -365,9 +365,9 @@ process:
return; return;
} }
static void addmatch __PARAM__((const char *dir,const char *pat,const register char *rescan,char *endslash), (dir, pat, rescan, endslash)) __OTORP__(const char *dir;const char *pat;const register char *rescan;char *endslash;){ static void addmatch __PARAM__((const char *dir,const char *pat,const char *rescan,char *endslash), (dir, pat, rescan, endslash)) __OTORP__(const char *dir;const char *pat;const char *rescan;char *endslash;){
register struct argnod *ap = (struct argnod*)stakseek(ARGVAL); struct argnod *ap = (struct argnod*)stakseek(ARGVAL);
register struct glob *gp = globptr(); struct glob *gp = globptr();
struct stat statb; struct stat statb;
if(dir) if(dir)
{ {
@ -429,11 +429,11 @@ static void addmatch __PARAM__((const char *dir,const char *pat,const register
* scan tree and add each name that matches the given pattern * scan tree and add each name that matches the given pattern
*/ */
static void scantree __PARAM__((Hashtab_t *tree, const char *pattern), (tree, pattern)) __OTORP__(Hashtab_t *tree; const char *pattern;){ static void scantree __PARAM__((Hashtab_t *tree, const char *pattern), (tree, pattern)) __OTORP__(Hashtab_t *tree; const char *pattern;){
register Hashpos_t *hp; Hashpos_t *hp;
register Namval_t *np; Namval_t *np;
register struct argnod *ap; struct argnod *ap;
register struct glob *gp = globptr(); struct glob *gp = globptr();
register char *cp; char *cp;
if(hp = hashscan(tree,0)) if(hp = hashscan(tree,0))
{ {
while((np = (Namval_t*)hashnext(hp)) && !nv_isnull(np)) while((np = (Namval_t*)hashnext(hp)) && !nv_isnull(np))
@ -461,7 +461,7 @@ static void scantree __PARAM__((Hashtab_t *tree, const char *pattern), (tree, pa
* The number of matches is returned * The number of matches is returned
*/ */
int path_complete __PARAM__((const char *name,register const char *suffix, struct argnod **arghead), (name, suffix, arghead)) __OTORP__(const char *name;register const char *suffix; struct argnod **arghead;){ int path_complete __PARAM__((const char *name,const char *suffix, struct argnod **arghead), (name, suffix, arghead)) __OTORP__(const char *name;const char *suffix; struct argnod **arghead;){
sufstr = suffix; sufstr = suffix;
suflen = strlen(suffix); suflen = strlen(suffix);
return(path_expand(name,arghead)); return(path_expand(name,arghead));
@ -474,10 +474,10 @@ int path_complete __PARAM__((const char *name,register const char *suffix, struc
*/ */
static void sh_trim(sp) static void sh_trim(sp)
register char *sp; char *sp;
{ {
register char *dp = sp; char *dp = sp;
register int c; int c;
while(1) while(1)
{ {
if((c= *sp++) == '\\') if((c= *sp++) == '\\')
@ -491,9 +491,9 @@ register char *sp;
#ifdef SHOPT_BRACEPAT #ifdef SHOPT_BRACEPAT
int path_generate __PARAM__((struct argnod *todo, struct argnod **arghead), (todo, arghead)) __OTORP__(struct argnod *todo; struct argnod **arghead;){ int path_generate __PARAM__((struct argnod *todo, struct argnod **arghead), (todo, arghead)) __OTORP__(struct argnod *todo; struct argnod **arghead;){
register char *cp; char *cp;
register int brace; int brace;
register struct argnod *ap; struct argnod *ap;
struct argnod *top = 0; struct argnod *top = 0;
struct argnod *apin; struct argnod *apin;
char *pat, *rescan, *bracep; char *pat, *rescan, *bracep;

View file

@ -106,10 +106,10 @@ static char indone;
/* /*
* Most signals caught or ignored by the shell come here * Most signals caught or ignored by the shell come here
*/ */
void sh_fault __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ void sh_fault __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register int flag; int flag;
register char *trap; char *trap;
register struct checkpt *pp = (struct checkpt*)sh.jmplist; struct checkpt *pp = (struct checkpt*)sh.jmplist;
/* reset handler */ /* reset handler */
signal(sig, sh_fault); signal(sig, sh_fault);
/* handle ignored signals */ /* handle ignored signals */
@ -176,8 +176,8 @@ void sh_fault __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){
* initialize signal handling * initialize signal handling
*/ */
void sh_siginit __PARAM__((void), ()){ void sh_siginit __PARAM__((void), ()){
register int sig, n=SIGTERM+1; int sig, n=SIGTERM+1;
register const struct shtable2 *tp = shtab_signals; const struct shtable2 *tp = shtab_signals;
init_shtab_signals(); init_shtab_signals();
sig_begin(); sig_begin();
/* find the largest signal number in the table */ /* find the largest signal number in the table */
@ -214,8 +214,8 @@ void sh_siginit __PARAM__((void), ()){
/* /*
* Turn on trap handler for signal <sig> * Turn on trap handler for signal <sig>
*/ */
void sh_sigtrap __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ void sh_sigtrap __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register int flag; int flag;
sh.st.otrapcom = 0; sh.st.otrapcom = 0;
if(sig==0) if(sig==0)
sh_sigdone(); sh_sigdone();
@ -238,7 +238,7 @@ void sh_sigtrap __PARAM__((register int sig), (sig)) __OTORP__(register int sig;
* set signal handler so sh_done is called for all caught signals * set signal handler so sh_done is called for all caught signals
*/ */
void sh_sigdone __PARAM__((void), ()){ void sh_sigdone __PARAM__((void), ()){
register int flag, sig = sh.sigmax; int flag, sig = sh.sigmax;
setdone=1; setdone=1;
sh.sigflag[0] |= SH_SIGFAULT; sh.sigflag[0] |= SH_SIGFAULT;
while(--sig>0) while(--sig>0)
@ -254,9 +254,9 @@ void sh_sigdone __PARAM__((void), ()){
* Free the trap strings if mode is non-zero * Free the trap strings if mode is non-zero
* If mode>1 then ignored traps cause signal to be ignored * If mode>1 then ignored traps cause signal to be ignored
*/ */
void sh_sigreset __PARAM__((register int mode), (mode)) __OTORP__(register int mode;){ void sh_sigreset __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register char *trap; char *trap;
register int flag, sig=sh.st.trapmax; int flag, sig=sh.st.trapmax;
while(sig-- > 0) while(sig-- > 0)
{ {
if(trap=sh.st.trapcom[sig]) if(trap=sh.st.trapcom[sig])
@ -296,9 +296,9 @@ void sh_sigreset __PARAM__((register int mode), (mode)) __OTORP__(register int m
/* /*
* free up trap if set and restore signal handler if modified * free up trap if set and restore signal handler if modified
*/ */
void sh_sigclear __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ void sh_sigclear __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register int flag = sh.sigflag[sig]; int flag = sh.sigflag[sig];
register char *trap; char *trap;
sh.st.otrapcom=0; sh.st.otrapcom=0;
if(!(flag&SH_SIGFAULT)) if(!(flag&SH_SIGFAULT))
return; return;
@ -316,8 +316,8 @@ void sh_sigclear __PARAM__((register int sig), (sig)) __OTORP__(register int sig
*/ */
void sh_chktrap __PARAM__((void), ()){ void sh_chktrap __PARAM__((void), ()){
register int sig=sh.st.trapmax; int sig=sh.st.trapmax;
register char *trap; char *trap;
if(!sh.trapnote) if(!sh.trapnote)
sig=0; sig=0;
sh.trapnote &= ~SH_SIGTRAP; sh.trapnote &= ~SH_SIGTRAP;
@ -401,9 +401,9 @@ int sh_trap __PARAM__((const char *trap, int mode), (trap, mode)) __OTORP__(cons
/* /*
* exit the current scope and jump to an earlier one based on pp->mode * exit the current scope and jump to an earlier one based on pp->mode
*/ */
void sh_exit __PARAM__((register int xno), (xno)) __OTORP__(register int xno;){ void sh_exit __PARAM__((int xno), (xno)) __OTORP__(int xno;){
register struct checkpt *pp = (struct checkpt*)sh.jmplist; struct checkpt *pp = (struct checkpt*)sh.jmplist;
register int sig=0; int sig=0;
sh.exitval=xno; sh.exitval=xno;
if(xno==SH_EXITSIG) if(xno==SH_EXITSIG)
sh.exitval |= (sig=sh.lastsig); sh.exitval |= (sig=sh.lastsig);
@ -471,9 +471,9 @@ void sh_exit __PARAM__((register int xno), (xno)) __OTORP__(register int xno;){
* This is the exit routine for the shell * This is the exit routine for the shell
*/ */
void sh_done __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ void sh_done __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register char *t; char *t;
register int savxit = sh.exitval; int savxit = sh.exitval;
sh.trapnote = 0; sh.trapnote = 0;
indone=1; indone=1;
if(sig==0) if(sig==0)

View file

@ -102,8 +102,8 @@ Fcin_t _Fcin;
/* /*
* open stream <f> for fast character input * open stream <f> for fast character input
*/ */
int fcfopen __PARAM__((register Sfio_t* f), (f)) __OTORP__(register Sfio_t* f;){ int fcfopen __PARAM__((Sfio_t* f), (f)) __OTORP__(Sfio_t* f;){
register int n; int n;
char *buff; char *buff;
Fcin_t save; Fcin_t save;
errno = 0; errno = 0;
@ -136,9 +136,9 @@ int fcfopen __PARAM__((register Sfio_t* f), (f)) __OTORP__(register Sfio_t* f;){
* the previous character is a 0 byte. * the previous character is a 0 byte.
*/ */
int fcfill __PARAM__((void), ()){ int fcfill __PARAM__((void), ()){
register int n; int n;
register Sfio_t *f; Sfio_t *f;
register unsigned char *last=_Fcin.fclast, *ptr=_Fcin.fcptr; unsigned char *last=_Fcin.fclast, *ptr=_Fcin.fcptr;
if(!(f=fcfile())) if(!(f=fcfile()))
{ {
/* see whether pointer has passed null byte */ /* see whether pointer has passed null byte */
@ -170,7 +170,7 @@ int fcfill __PARAM__((void), ()){
* Synchronize and close the current stream * Synchronize and close the current stream
*/ */
int fcclose __PARAM__((void), ()){ int fcclose __PARAM__((void), ()){
register unsigned char *ptr; unsigned char *ptr;
if(_Fcin.fclast==0) if(_Fcin.fclast==0)
return(0); return(0);
if((ptr=_Fcin.fcptr)>_Fcin.fcbuff && *(ptr-1)==0) if((ptr=_Fcin.fcptr)>_Fcin.fcbuff && *(ptr-1)==0)

View file

@ -170,7 +170,7 @@ static Namval_t *ifsnp;
/* /*
* Invalidate all path name bindings * Invalidate all path name bindings
*/ */
static void rehash __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ static void rehash __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
nv_onattr(np,NV_NOALIAS); nv_onattr(np,NV_NOALIAS);
} }
@ -187,8 +187,8 @@ static char *nospace __PARAM__((int unused), (unused)) __OTORP__(int unused;){
# include "edit.h" # include "edit.h"
/* Trap for CSWIDTH variable */ /* Trap for CSWIDTH variable */
static void put_cswidth __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;){ static void put_cswidth __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;){
register char *cp; char *cp;
register char *name = nv_name(np); char *name = nv_name(np);
if(ed_setwidth(val?val:"") && !(flags&NV_IMPORT)) if(ed_setwidth(val?val:"") && !(flags&NV_IMPORT))
error(ERROR_exit(1),e_format,nv_name(np)); error(ERROR_exit(1),e_format,nv_name(np));
nv_putv(np, val, flags, fp); nv_putv(np, val, flags, fp);
@ -196,8 +196,8 @@ static char *nospace __PARAM__((int unused), (unused)) __OTORP__(int unused;){
#endif /* SHOPT_MULTIBYTE */ #endif /* SHOPT_MULTIBYTE */
/* Trap for VISUAL and EDITOR variables */ /* Trap for VISUAL and EDITOR variables */
static void put_ed __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_ed __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;){
register const char *cp, *name=nv_name(np); const char *cp, *name=nv_name(np);
if(*name=='E' && nv_getval(nv_scoped(VISINOD))) if(*name=='E' && nv_getval(nv_scoped(VISINOD)))
goto done; goto done;
sh_offoption(SH_VI|SH_EMACS|SH_GMACS); sh_offoption(SH_VI|SH_EMACS|SH_GMACS);
@ -225,7 +225,7 @@ static void put_optindex __PARAM__((Namval_t* np,const char *val,int flags,Namfu
} }
/* Trap for restricted variables PATH, SHELL, ENV */ /* Trap for restricted variables PATH, SHELL, ENV */
static void put_restricted __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_restricted __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;){
if(!(flags&NV_RDONLY) && sh_isoption(SH_RESTRICTED)) if(!(flags&NV_RDONLY) && sh_isoption(SH_RESTRICTED))
error(ERROR_exit(1),e_restricted,nv_name(np)); error(ERROR_exit(1),e_restricted,nv_name(np));
if(nv_name(np)==nv_name(PATHNOD)) if(nv_name(np)==nv_name(PATHNOD))
@ -498,7 +498,7 @@ static MsgStr allmsgs[] = {
/* /*
* Without this proto, standard C says that _DtGetMessage() returns * Without this proto, standard C says that _DtGetMessage() returns
* an int, even though it really returns a pointer. The compiler is * an int, even though it really returns a pointer. The compiler is
* then free to use the high 32-bits of the return register for * then free to use the high 32-bits of the return for
* something else (like scratch), and that can garble the pointer. * something else (like scratch), and that can garble the pointer.
*/ */
char *_DtGetMessage __PROTO__((char *filename, int set, int n, char *s)); char *_DtGetMessage __PROTO__((char *filename, int set, int n, char *s));
@ -713,7 +713,7 @@ char *savedNlsPath;
void charsize_init __PARAM__((void), ()){ void charsize_init __PARAM__((void), ()){
static char fc[3] = { 0301, ESS2, ESS3}; static char fc[3] = { 0301, ESS2, ESS3};
char buff[8]; char buff[8];
register int i,n; int i,n;
wchar_t wc; wchar_t wc;
memset(buff,0301,MB_CUR_MAX); memset(buff,0301,MB_CUR_MAX);
for(i=0; i<=2; i++) for(i=0; i<=2; i++)
@ -762,7 +762,7 @@ char *savedNlsPath;
free((__V_*)sh_lexstates[ST_BEGIN]); free((__V_*)sh_lexstates[ST_BEGIN]);
if(ast.locale.set&LC_SET_CTYPE) if(ast.locale.set&LC_SET_CTYPE)
{ {
register int c; int c;
char *state[4]; char *state[4];
sh_lexstates[ST_BEGIN] = state[0] = (char*)malloc(4*(1<<CHAR_BIT)); sh_lexstates[ST_BEGIN] = state[0] = (char*)malloc(4*(1<<CHAR_BIT));
memcpy(state[0],sh_lexrstates[ST_BEGIN],(1<<CHAR_BIT)); memcpy(state[0],sh_lexrstates[ST_BEGIN],(1<<CHAR_BIT));
@ -811,7 +811,7 @@ char *savedNlsPath;
#endif /* _hdr_locale */ #endif /* _hdr_locale */
/* Trap for IFS assignment and invalidates state table */ /* Trap for IFS assignment and invalidates state table */
static void put_ifs __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_ifs __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;){
ifsnp = 0; ifsnp = 0;
nv_putv(np, val, flags, fp); nv_putv(np, val, flags, fp);
} }
@ -820,9 +820,9 @@ static void put_ifs __PARAM__((register Namval_t* np,const char *val,int flags,N
* This is the lookup function for IFS * This is the lookup function for IFS
* It keeps the sh.ifstable up to date * It keeps the sh.ifstable up to date
*/ */
static char* get_ifs __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static char* get_ifs __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
register char *cp, *value; char *cp, *value;
register int c,n; int c,n;
value = nv_getv(np,fp); value = nv_getv(np,fp);
if(np!=ifsnp) if(np!=ifsnp)
{ {
@ -872,7 +872,7 @@ static char* get_ifs __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp))
# define gettimeofday(a,b) # define gettimeofday(a,b)
#endif #endif
static void put_seconds __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_seconds __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;){
static double sec_offset; static double sec_offset;
double d; double d;
struct tms tp; struct tms tp;
@ -896,7 +896,7 @@ static void put_seconds __PARAM__((register Namval_t* np,const char *val,int fla
} }
} }
static char* get_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static char* get_seconds __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
struct tms tp; struct tms tp;
double d; double d;
NOT_USED(fp); NOT_USED(fp);
@ -905,7 +905,7 @@ static char* get_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, f
return(sh_ftos(d,nv_size(np))); return(sh_ftos(d,nv_size(np)));
} }
static double nget_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static double nget_seconds __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
struct tms tp; struct tms tp;
NOT_USED(fp); NOT_USED(fp);
gettimeofday(&tp,NIL(void *)); gettimeofday(&tp,NIL(void *));
@ -915,9 +915,9 @@ static double nget_seconds __PARAM__((register Namval_t* np, Namfun_t *fp), (np,
/* /*
* These three functions are used to get and set the RANDOM variable * These three functions are used to get and set the RANDOM variable
*/ */
static void put_rand __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_rand __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;){
static long rand_last; static long rand_last;
register long n; long n;
NOT_USED(fp); NOT_USED(fp);
if(!val) if(!val)
{ {
@ -939,8 +939,8 @@ static void put_rand __PARAM__((register Namval_t* np,const char *val,int flags,
* get random number in range of 0 - 2**15 * get random number in range of 0 - 2**15
* never pick same number twice in a row * never pick same number twice in a row
*/ */
static double nget_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static double nget_rand __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
register long cur, last= *np->nvalue.lp; long cur, last= *np->nvalue.lp;
NOT_USED(fp); NOT_USED(fp);
do do
cur = (rand()>>rand_shift)&RANDMASK; cur = (rand()>>rand_shift)&RANDMASK;
@ -949,8 +949,8 @@ static double nget_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp
return((double)cur); return((double)cur);
} }
static char* get_rand __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static char* get_rand __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
register long n = nget_rand(np,fp); long n = nget_rand(np,fp);
return(fmtbase(n, 10, 0)); return(fmtbase(n, 10, 0));
} }
@ -969,7 +969,7 @@ static double nget_lineno __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OT
} }
static void put_lineno __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;){ static void put_lineno __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;){
register long n; long n;
NOT_USED(fp); NOT_USED(fp);
if(!val) if(!val)
{ {
@ -984,8 +984,8 @@ static void put_lineno __PARAM__((Namval_t* np,const char *val,int flags,Namfun_
sh.st.firstline += nget_lineno(np,fp)+1-n; sh.st.firstline += nget_lineno(np,fp)+1-n;
} }
static char* get_lineno __PARAM__((register Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(register Namval_t* np; Namfun_t *fp;){ static char* get_lineno __PARAM__((Namval_t* np, Namfun_t *fp), (np, fp)) __OTORP__(Namval_t* np; Namfun_t *fp;){
register long n = nget_lineno(np,fp); long n = nget_lineno(np,fp);
return(fmtbase(n, 10, 0)); return(fmtbase(n, 10, 0));
} }
@ -1014,7 +1014,7 @@ static void put_lastarg __PARAM__((Namval_t* np,const char *val,int flags,Namfun
* set or unset the mappings given a colon separated list of directories * set or unset the mappings given a colon separated list of directories
*/ */
static void vpath_set __PARAM__((char *str, int mode), (str, mode)) __OTORP__(char *str; int mode;){ static void vpath_set __PARAM__((char *str, int mode), (str, mode)) __OTORP__(char *str; int mode;){
register char *lastp, *oldp=str, *newp=strchr(oldp,':'); char *lastp, *oldp=str, *newp=strchr(oldp,':');
if(!sh.lim.fs3d) if(!sh.lim.fs3d)
return; return;
while(newp) while(newp)
@ -1030,8 +1030,8 @@ static void put_lastarg __PARAM__((Namval_t* np,const char *val,int flags,Namfun
} }
/* catch vpath assignments */ /* catch vpath assignments */
static void put_vpath __PARAM__((register Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(register Namval_t* np;const char *val;int flags;Namfun_t *fp;){ static void put_vpath __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;){
register char *cp; char *cp;
if(cp = nv_getval(np)) if(cp = nv_getval(np))
vpath_set(cp,0); vpath_set(cp,0);
if(val) if(val)
@ -1079,7 +1079,7 @@ static Namfun_t L_ARG_init = { &L_ARG_disc};
* This function will get called whenever a configuration parameter changes * This function will get called whenever a configuration parameter changes
*/ */
static int newconf __PARAM__((const char *name, const char *path, const char *value), (name, path, value)) __OTORP__(const char *name; const char *path; const char *value;){ static int newconf __PARAM__((const char *name, const char *path, const char *value), (name, path, value)) __OTORP__(const char *name; const char *path; const char *value;){
register char *arg; char *arg;
if(strcmp(name,"UNIVERSE")==0 && strcmp(astconf(name,0,0),value)) if(strcmp(name,"UNIVERSE")==0 && strcmp(astconf(name,0,0),value))
{ {
sh.universe = 0; sh.universe = 0;
@ -1098,9 +1098,9 @@ static int newconf __PARAM__((const char *name, const char *path, const char *va
/* /*
* initialize the shell * initialize the shell
*/ */
int sh_init __PARAM__((register int argc,register char *argv[]), (argc, argv)) __OTORP__(register int argc;register char *argv[];){ int sh_init __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
register char *name; char *name;
register int n,prof; int n,prof;
#ifdef MTRACE #ifdef MTRACE
Mt_certify = 1; Mt_certify = 1;
#endif /* MTRACE */ #endif /* MTRACE */
@ -1241,8 +1241,8 @@ void sh_reinit __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
/* /*
* set when creating a local variable of this name * set when creating a local variable of this name
*/ */
Namfun_t *nv_cover __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ Namfun_t *nv_cover __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register Namfun_t *nfp=0; Namfun_t *nfp=0;
if(np==IFSNOD) if(np==IFSNOD)
nfp = &IFS_init; nfp = &IFS_init;
else if(np==PATHNOD) else if(np==PATHNOD)
@ -1299,10 +1299,10 @@ static void nv_init __PARAM__((void), ()){
*/ */
static Hashtab_t *inittree __PARAM__((const struct shtable2 *name_vals), (name_vals)) __OTORP__(const struct shtable2 *name_vals;){ static Hashtab_t *inittree __PARAM__((const struct shtable2 *name_vals), (name_vals)) __OTORP__(const struct shtable2 *name_vals;){
register Namval_t *np; Namval_t *np;
register const struct shtable2 *tp; const struct shtable2 *tp;
register unsigned n = 0; unsigned n = 0;
register Hashtab_t *treep; Hashtab_t *treep;
for(tp=name_vals;*tp->sh_name;tp++) for(tp=name_vals;*tp->sh_name;tp++)
n++; n++;
np = (Namval_t*)calloc(n,sizeof(Namval_t)); np = (Namval_t*)calloc(n,sizeof(Namval_t));
@ -1348,10 +1348,10 @@ static Hashtab_t *inittree __PARAM__((const struct shtable2 *name_vals), (name_v
*/ */
static void env_init __PARAM__((void), ()){ static void env_init __PARAM__((void), ()){
register char *cp; char *cp;
register Namval_t *np; Namval_t *np;
register char **ep=environ; char **ep=environ;
register char *next=0; char *next=0;
if(ep) if(ep)
{ {
while(cp= *ep++) while(cp= *ep++)

View file

@ -153,7 +153,7 @@ static int slowread __PROTO__((Sfio_t*, __V_*, int, Sfdisc_t*));
static int slowexcept __PROTO__((Sfio_t*, int, Sfdisc_t*)); static int slowexcept __PROTO__((Sfio_t*, int, Sfdisc_t*));
static int pipeexcept __PROTO__((Sfio_t*, int, Sfdisc_t*)); static int pipeexcept __PROTO__((Sfio_t*, int, Sfdisc_t*));
static int io_prompt __PROTO__((int)); static int io_prompt __PROTO__((int));
static int io_heredoc __PROTO__((register struct ionod*)); static int io_heredoc __PROTO__((struct ionod*));
static void sftrack __PROTO__((Sfio_t*,int,int)); static void sftrack __PROTO__((Sfio_t*,int,int));
static int tee_write __PROTO__((Sfio_t*,const __V_*,int,Sfdisc_t*)); static int tee_write __PROTO__((Sfio_t*,const __V_*,int,Sfdisc_t*));
static const Sfdisc_t eval_disc = { NULL, NULL, NULL, eval_exceptf, NULL}; static const Sfdisc_t eval_disc = { NULL, NULL, NULL, eval_exceptf, NULL};
@ -178,7 +178,7 @@ static short filemapsize;
/* ======== input output and file copying ======== */ /* ======== input output and file copying ======== */
void sh_ioinit __PARAM__((void), ()){ void sh_ioinit __PARAM__((void), ()){
register int n; int n;
filemapsize = 8; filemapsize = 8;
filemap = (struct fdsave*)malloc(8*sizeof(struct fdsave)); filemap = (struct fdsave*)malloc(8*sizeof(struct fdsave));
#ifdef SHOPT_FASTPIPE #ifdef SHOPT_FASTPIPE
@ -215,10 +215,10 @@ void sh_ioinit __PARAM__((void), ()){
* For output streams, the buffer is set to sh.output and put into * For output streams, the buffer is set to sh.output and put into
* the sh.outpool synchronization pool * the sh.outpool synchronization pool
*/ */
Sfio_t *sh_iostream __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ Sfio_t *sh_iostream __PARAM__((int fd), (fd)) __OTORP__(int fd;){
register Sfio_t *iop; Sfio_t *iop;
register int status = sh_iocheckfd(fd); int status = sh_iocheckfd(fd);
register int flags = SF_WRITE; int flags = SF_WRITE;
char *bp; char *bp;
int size; int size;
#ifdef SHOPT_FASTPIPE #ifdef SHOPT_FASTPIPE
@ -282,8 +282,8 @@ Sfio_t *sh_iostream __PARAM__((register int fd), (fd)) __OTORP__(register int fd
/* /*
* preserve the file descriptor or stream by moving it * preserve the file descriptor or stream by moving it
*/ */
static void io_preserve __PARAM__((register Sfio_t *sp, register int f2), (sp, f2)) __OTORP__(register Sfio_t *sp; register int f2;){ static void io_preserve __PARAM__((Sfio_t *sp, int f2), (sp, f2)) __OTORP__(Sfio_t *sp; int f2;){
register int fd; int fd;
if(sp) if(sp)
fd = sfsetfd(sp,10); fd = sfsetfd(sp,10);
else else
@ -315,8 +315,8 @@ static void io_preserve __PARAM__((register Sfio_t *sp, register int f2), (sp, f
* The original stream <f1> is closed. * The original stream <f1> is closed.
* The new file descriptor <f2> is returned; * The new file descriptor <f2> is returned;
*/ */
int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP__(register int f1;register int f2;){ int sh_iorenumber __PARAM__((int f1,int f2), (f1, f2)) __OTORP__(int f1;int f2;){
register Sfio_t *sp = sh.sftable[f2]; Sfio_t *sp = sh.sftable[f2];
if(f1!=f2) if(f1!=f2)
{ {
/* see whether file descriptor is in use */ /* see whether file descriptor is in use */
@ -330,7 +330,7 @@ int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP
sh_close(f2); sh_close(f2);
if(f2<=2 && sp) if(f2<=2 && sp)
{ {
register Sfio_t *spnew = sh_iostream(f1); Sfio_t *spnew = sh_iostream(f1);
sh.fdstatus[f2] = (sh.fdstatus[f1]&~IOCLEX); sh.fdstatus[f2] = (sh.fdstatus[f1]&~IOCLEX);
sfsetfd(spnew,f2); sfsetfd(spnew,f2);
sfswap(spnew,sp); sfswap(spnew,sp);
@ -354,9 +354,9 @@ int sh_iorenumber __PARAM__((register int f1,register int f2), (f1, f2)) __OTORP
/* /*
* close a file descriptor and update stream table and attributes * close a file descriptor and update stream table and attributes
*/ */
int sh_close __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ int sh_close __PARAM__((int fd), (fd)) __OTORP__(int fd;){
register Sfio_t *sp; Sfio_t *sp;
register int r = 0; int r = 0;
if(fd<0) if(fd<0)
return(-1); return(-1);
if(fd==sh.coutpipe) if(fd==sh.coutpipe)
@ -379,9 +379,9 @@ int sh_close __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
* Open a file for reading * Open a file for reading
* On failure, print message. * On failure, print message.
*/ */
int sh_open __PARAM__((register const char *path, int flags, ...), (va_alist)) __OTORP__(va_dcl) int sh_open __PARAM__((const char *path, int flags, ...), (va_alist)) __OTORP__(va_dcl)
{ __OTORP__(register const char *path; int flags; ) { __OTORP__(const char *path; int flags; )
register int fd; int fd;
mode_t mode; mode_t mode;
#ifdef SOCKET #ifdef SOCKET
struct sockaddr_in addr; struct sockaddr_in addr;
@ -432,8 +432,8 @@ int sh_open __PARAM__((register const char *path, int flags, ...), (va_alist)) _
return(fd); return(fd);
} }
int sh_chkopen __PARAM__((register const char *name), (name)) __OTORP__(register const char *name;){ int sh_chkopen __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register int fd = sh_open(name,O_RDONLY,0); int fd = sh_open(name,O_RDONLY,0);
if(fd < 0) if(fd < 0)
error(ERROR_system(1),e_open,name); error(ERROR_system(1),e_open,name);
return(fd); return(fd);
@ -442,8 +442,8 @@ int sh_chkopen __PARAM__((register const char *name), (name)) __OTORP__(register
/* /*
* move open file descriptor to a number > 2 * move open file descriptor to a number > 2
*/ */
int sh_iomovefd __PARAM__((register int fdold), (fdold)) __OTORP__(register int fdold;){ int sh_iomovefd __PARAM__((int fdold), (fdold)) __OTORP__(int fdold;){
register int fdnew; int fdnew;
if(fdold<0 || fdold>2) if(fdold<0 || fdold>2)
return(fdold); return(fdold);
fdnew = sh_iomovefd(dup(fdold)); fdnew = sh_iomovefd(dup(fdold));
@ -456,7 +456,7 @@ int sh_iomovefd __PARAM__((register int fdold), (fdold)) __OTORP__(register int
/* /*
* create a pipe and print message on failure * create a pipe and print message on failure
*/ */
int sh_pipe __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){ int sh_pipe __PARAM__((int pv[]), (pv)) __OTORP__(int pv[];){
int fd[2]; int fd[2];
if(pipe(fd)<0 || (pv[0]=fd[0])<0 || (pv[1]=fd[1])<0) if(pipe(fd)<0 || (pv[0]=fd[0])<0 || (pv[1]=fd[1])<0)
error(ERROR_system(1),e_pipe); error(ERROR_system(1),e_pipe);
@ -470,7 +470,7 @@ int sh_pipe __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){
/* /*
* close a pipe * close a pipe
*/ */
void sh_pclose __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];){ void sh_pclose __PARAM__((int pv[]), (pv)) __OTORP__(int pv[];){
if(pv[0]>=2) if(pv[0]>=2)
sh_close(pv[0]); sh_close(pv[0]);
if(pv[1]>=2) if(pv[1]>=2)
@ -485,9 +485,9 @@ void sh_pclose __PARAM__((register int pv[]), (pv)) __OTORP__(register int pv[];
* flag = 3 when called from $( < ...), just open file and return * flag = 3 when called from $( < ...), just open file and return
*/ */
int sh_redirect __PARAM__((struct ionod *iop, int flag), (iop, flag)) __OTORP__(struct ionod *iop; int flag;){ int sh_redirect __PARAM__((struct ionod *iop, int flag), (iop, flag)) __OTORP__(struct ionod *iop; int flag;){
register char *fname; char *fname;
register int fd, iof; int fd, iof;
register Namval_t *np=0; Namval_t *np=0;
const char *message = e_open; const char *message = e_open;
int o_mode; /* mode flag for open */ int o_mode; /* mode flag for open */
static char io_op[5]; /* used for -x trace info */ static char io_op[5]; /* used for -x trace info */
@ -663,9 +663,9 @@ fail:
/* /*
* Create a tmp file for the here-document * Create a tmp file for the here-document
*/ */
static int io_heredoc __PARAM__((register struct ionod *iop), (iop)) __OTORP__(register struct ionod *iop;){ static int io_heredoc __PARAM__((struct ionod *iop), (iop)) __OTORP__(struct ionod *iop;){
register Sfio_t *infile = 0, *outfile; Sfio_t *infile = 0, *outfile;
register char fd; char fd;
/* create an unnamed temporary file */ /* create an unnamed temporary file */
if(!(outfile=sftmp(0))) if(!(outfile=sftmp(0)))
error(ERROR_system(1),e_tmpcreate); error(ERROR_system(1),e_tmpcreate);
@ -716,12 +716,12 @@ static int tee_write __PARAM__((Sfio_t *iop,const __V_ *buff,int n,Sfdisc_t *unu
* if <origfd> < 0, then -origfd is saved, but not duped so that it * if <origfd> < 0, then -origfd is saved, but not duped so that it
* will be closed with sh_iorestore. * will be closed with sh_iorestore.
*/ */
void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __OTORP__(register int origfd; int oldtop;){ void sh_iosave __PARAM__((int origfd, int oldtop), (origfd, oldtop)) __OTORP__(int origfd; int oldtop;){
/*@ /*@
assume oldtop>=0 && oldtop<sh.lim.open_max; assume oldtop>=0 && oldtop<sh.lim.open_max;
@*/ @*/
register int savefd; int savefd;
/* see if already saved, only save once */ /* see if already saved, only save once */
for(savefd=sh.topfd; --savefd>=oldtop; ) for(savefd=sh.topfd; --savefd>=oldtop; )
{ {
@ -752,7 +752,7 @@ void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __
filemap[sh.topfd++].save_fd = savefd; filemap[sh.topfd++].save_fd = savefd;
if(savefd >=0) if(savefd >=0)
{ {
register Sfio_t* sp = sh.sftable[origfd]; Sfio_t* sp = sh.sftable[origfd];
/* make saved file close-on-exec */ /* make saved file close-on-exec */
fcntl(savefd,F_SETFD,FD_CLOEXEC); fcntl(savefd,F_SETFD,FD_CLOEXEC);
if(origfd==job.fd) if(origfd==job.fd)
@ -777,7 +777,7 @@ void sh_iosave __PARAM__((register int origfd, int oldtop), (origfd, oldtop)) __
* close all saved file descriptors * close all saved file descriptors
*/ */
void sh_iounsave __PARAM__((void), ()){ void sh_iounsave __PARAM__((void), ()){
register int fd, savefd, newfd; int fd, savefd, newfd;
for(newfd=fd=0; fd < sh.topfd; fd++) for(newfd=fd=0; fd < sh.topfd; fd++)
{ {
if((savefd = filemap[fd].save_fd)< 0) if((savefd = filemap[fd].save_fd)< 0)
@ -795,7 +795,7 @@ void sh_iounsave __PARAM__((void), ()){
* restore saved file descriptors from <last> on * restore saved file descriptors from <last> on
*/ */
void sh_iorestore __PARAM__((int last), (last)) __OTORP__(int last;){ void sh_iorestore __PARAM__((int last), (last)) __OTORP__(int last;){
register int origfd, savefd, fd; int origfd, savefd, fd;
for (fd = sh.topfd - 1; fd >= last; fd--) for (fd = sh.topfd - 1; fd >= last; fd--)
{ {
origfd = filemap[fd].orig_fd; origfd = filemap[fd].orig_fd;
@ -830,8 +830,8 @@ void sh_iorestore __PARAM__((int last), (last)) __OTORP__(int last;){
* returns -1 for failure, 0 for success * returns -1 for failure, 0 for success
* <mode> is the same as for access() * <mode> is the same as for access()
*/ */
sh_ioaccess __PARAM__((int fd,register int mode), (fd, mode)) __OTORP__(int fd;register int mode;){ sh_ioaccess __PARAM__((int fd,int mode), (fd, mode)) __OTORP__(int fd;int mode;){
register int flags; int flags;
if(mode==X_OK) if(mode==X_OK)
return(-1); return(-1);
if((flags=sh_iocheckfd(fd))!=IOCLOSE) if((flags=sh_iocheckfd(fd))!=IOCLOSE)
@ -852,8 +852,8 @@ sh_ioaccess __PARAM__((int fd,register int mode), (fd, mode)) __OTORP__(int fd;r
* 0 returned on error * 0 returned on error
*/ */
static int str2inet __PARAM__((register const char *sp, struct sockaddr_in *addr), (sp, addr)) __OTORP__(register const char *sp; struct sockaddr_in *addr;){ static int str2inet __PARAM__((const char *sp, struct sockaddr_in *addr), (sp, addr)) __OTORP__(const char *sp; struct sockaddr_in *addr;){
register int n=0,c,v; int n=0,c,v;
unsigned long a=0; unsigned long a=0;
unsigned short p; unsigned short p;
@ -883,8 +883,8 @@ static int str2inet __PARAM__((register const char *sp, struct sockaddr_in *addr
/* /*
* Handle interrupts for slow streams * Handle interrupts for slow streams
*/ */
static int slowexcept __PARAM__((register Sfio_t *iop, int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(register Sfio_t *iop; int type; Sfdisc_t *handle;){ static int slowexcept __PARAM__((Sfio_t *iop, int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop; int type; Sfdisc_t *handle;){
register int n,fno; int n,fno;
NOT_USED(handle); NOT_USED(handle);
if(type!=SF_READ) if(type!=SF_READ)
return(0); return(0);
@ -949,7 +949,7 @@ static void time_grace __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handl
sh.trapnote |= SH_SIGTRAP; sh.trapnote |= SH_SIGTRAP;
} }
static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;register int size;Sfdisc_t *handle;){ static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;int size;Sfdisc_t *handle;){
NOT_USED(handle); NOT_USED(handle);
size = ed_read(sffileno(iop), (char*)buff, size); size = ed_read(sffileno(iop), (char*)buff, size);
return(size); return(size);
@ -958,7 +958,7 @@ static int piperead __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t
* This is the read discipline that is applied to slow devices * This is the read discipline that is applied to slow devices
* This routine takes care of prompting for input * This routine takes care of prompting for input
*/ */
static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;register int size;Sfdisc_t *handle;){ static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,int size,Sfdisc_t *handle), (iop, buff, size, handle)) __OTORP__(Sfio_t *iop;__V_ *buff;int size;Sfdisc_t *handle;){
int (*readf) __PROTO__((int, char*, int)); int (*readf) __PROTO__((int, char*, int));
NOT_USED(handle); NOT_USED(handle);
if(io_prompt(sh.nextprompt)<0 && errno==EIO) if(io_prompt(sh.nextprompt)<0 && errno==EIO)
@ -987,8 +987,8 @@ static int slowread __PARAM__((Sfio_t *iop,__V_ *buff,register int size,Sfdisc_t
* check and return the attributes for a file descriptor * check and return the attributes for a file descriptor
*/ */
int sh_iocheckfd __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){ int sh_iocheckfd __PARAM__((int fd), (fd)) __OTORP__(int fd;){
register int flags, n; int flags, n;
if((n=sh.fdstatus[fd])&IOCLOSE) if((n=sh.fdstatus[fd])&IOCLOSE)
return(n); return(n);
if(!(n&(IOREAD|IOWRITE))) if(!(n&(IOREAD|IOWRITE)))
@ -1051,8 +1051,8 @@ int sh_iocheckfd __PARAM__((register int fd), (fd)) __OTORP__(register int fd;){
* Display prompt PS<flag> on standard error * Display prompt PS<flag> on standard error
*/ */
static int io_prompt __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){ static int io_prompt __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register char *cp; char *cp;
char *endprompt; char *endprompt;
static short cmdno; static short cmdno;
int sfflags; int sfflags;
@ -1067,7 +1067,7 @@ static int io_prompt __PARAM__((register int flag), (flag)) __OTORP__(register i
{ {
case 1: case 1:
{ {
register int c; int c;
#if defined(TIOCLBIC) && defined(LFLUSHO) #if defined(TIOCLBIC) && defined(LFLUSHO)
if(!sh_isoption(SH_VI|SH_EMACS|SH_GMACS)) if(!sh_isoption(SH_VI|SH_EMACS|SH_GMACS))
{ {
@ -1133,9 +1133,9 @@ static int pipeexcept __PARAM__((Sfio_t* iop, int mode, Sfdisc_t* handle), (iop,
* keep track of each stream that is opened and closed * keep track of each stream that is opened and closed
*/ */
static void sftrack __PARAM__((Sfio_t* sp,int flag, int newfd), (sp, flag, newfd)) __OTORP__(Sfio_t* sp;int flag; int newfd;){ static void sftrack __PARAM__((Sfio_t* sp,int flag, int newfd), (sp, flag, newfd)) __OTORP__(Sfio_t* sp;int flag; int newfd;){
register int fd = sffileno(sp); int fd = sffileno(sp);
register struct checkpt *pp; struct checkpt *pp;
register int mode; int mode;
if(flag==SF_SETFD && newfd<0) if(flag==SF_SETFD && newfd<0)
{ {
flag = SF_CLOSE; flag = SF_CLOSE;
@ -1224,9 +1224,9 @@ struct eval
* Create a stream consisting of a space separated argv[] list * Create a stream consisting of a space separated argv[] list
*/ */
Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register char *argv[];){ Sfio_t *sh_sfeval __PARAM__((char *argv[]), (argv)) __OTORP__(char *argv[];){
register Sfio_t *iop; Sfio_t *iop;
register char *cp; char *cp;
if(argv[1]) if(argv[1])
cp = ""; cp = "";
else else
@ -1234,7 +1234,7 @@ Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register
iop = sfopen(NIL(Sfio_t*),(char*)cp,"s"); iop = sfopen(NIL(Sfio_t*),(char*)cp,"s");
if(argv[1]) if(argv[1])
{ {
register struct eval *ep; struct eval *ep;
if(!(ep = new_of(struct eval,0))) if(!(ep = new_of(struct eval,0)))
return(NIL(Sfio_t*)); return(NIL(Sfio_t*));
ep->disc = eval_disc; ep->disc = eval_disc;
@ -1251,9 +1251,9 @@ Sfio_t *sh_sfeval __PARAM__((register char *argv[]), (argv)) __OTORP__(register
*/ */
static int eval_exceptf __PARAM__((Sfio_t *iop,int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type; Sfdisc_t *handle;){ static int eval_exceptf __PARAM__((Sfio_t *iop,int type, Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type; Sfdisc_t *handle;){
register struct eval *ep = (struct eval*)handle; struct eval *ep = (struct eval*)handle;
register char *cp; char *cp;
register int len; int len;
/* no more to do */ /* no more to do */
if(type!=SF_READ || !(cp = ep->argv[0])) if(type!=SF_READ || !(cp = ep->argv[0]))
@ -1292,8 +1292,8 @@ static int eval_exceptf __PARAM__((Sfio_t *iop,int type, Sfdisc_t *handle), (iop
*/ */
static Sfio_t *subopen __PARAM__((Sfio_t* sp, off_t offset, long size), (sp, offset, size)) __OTORP__(Sfio_t* sp; off_t offset; long size;){ static Sfio_t *subopen __PARAM__((Sfio_t* sp, off_t offset, long size), (sp, offset, size)) __OTORP__(Sfio_t* sp; off_t offset; long size;){
register struct subfile *disp; struct subfile *disp;
register int fd = sffileno(sp); int fd = sffileno(sp);
if(sfseek(sp,offset,SEEK_SET) <0) if(sfseek(sp,offset,SEEK_SET) <0)
return(NIL(Sfio_t*)); return(NIL(Sfio_t*));
if(!(disp = (struct subfile*)malloc(sizeof(struct subfile)+IOBSIZE+1))) if(!(disp = (struct subfile*)malloc(sizeof(struct subfile)+IOBSIZE+1)))
@ -1310,8 +1310,8 @@ static Sfio_t *subopen __PARAM__((Sfio_t* sp, off_t offset, long size), (sp, off
/* /*
* read function for subfile discipline * read function for subfile discipline
*/ */
static int subread __PARAM__((Sfio_t* sp,__V_* buff,register int size,Sfdisc_t* handle), (sp, buff, size, handle)) __OTORP__(Sfio_t* sp;__V_* buff;register int size;Sfdisc_t* handle;){ static int subread __PARAM__((Sfio_t* sp,__V_* buff,int size,Sfdisc_t* handle), (sp, buff, size, handle)) __OTORP__(Sfio_t* sp;__V_* buff;int size;Sfdisc_t* handle;){
register struct subfile *disp = (struct subfile*)handle; struct subfile *disp = (struct subfile*)handle;
NOT_USED(sp); NOT_USED(sp);
if(disp->left == 0) if(disp->left == 0)
return(0); return(0);
@ -1324,8 +1324,8 @@ static int subread __PARAM__((Sfio_t* sp,__V_* buff,register int size,Sfdisc_t*
/* /*
* exception handler for subfile discipline * exception handler for subfile discipline
*/ */
static int subexcept __PARAM__((Sfio_t* sp,register int mode, Sfdisc_t* handle), (sp, mode, handle)) __OTORP__(Sfio_t* sp;register int mode; Sfdisc_t* handle;){ static int subexcept __PARAM__((Sfio_t* sp,int mode, Sfdisc_t* handle), (sp, mode, handle)) __OTORP__(Sfio_t* sp;int mode; Sfdisc_t* handle;){
register struct subfile *disp = (struct subfile*)handle; struct subfile *disp = (struct subfile*)handle;
if(mode==SF_CLOSE) if(mode==SF_CLOSE)
{ {
sfdisc(sp,SF_POPDISC); sfdisc(sp,SF_POPDISC);
@ -1342,8 +1342,8 @@ static int subexcept __PARAM__((Sfio_t* sp,register int mode, Sfdisc_t* handle),
* print a list of arguments in columns * print a list of arguments in columns
*/ */
void sh_menu __PARAM__((Sfio_t *outfile,int argn,char *argv[]), (outfile, argn, argv)) __OTORP__(Sfio_t *outfile;int argn;char *argv[];){ void sh_menu __PARAM__((Sfio_t *outfile,int argn,char *argv[]), (outfile, argn, argv)) __OTORP__(Sfio_t *outfile;int argn;char *argv[];){
register int i,j; int i,j;
register char **arg; char **arg;
int nrow, ncol=1, ndigits=1; int nrow, ncol=1, ndigits=1;
int fldsize, wsize = ed_window(); int fldsize, wsize = ed_window();
char *cp = nv_getval(nv_scoped(LINES)); char *cp = nv_getval(nv_scoped(LINES));
@ -1397,8 +1397,8 @@ skip:
/* /*
* shell version of read() for user added builtins * shell version of read() for user added builtins
*/ */
ssize_t sh_read __PARAM__((register int fd, __V_* buff, size_t n), (fd, buff, n)) __OTORP__(register int fd; __V_* buff; size_t n;){ ssize_t sh_read __PARAM__((int fd, __V_* buff, size_t n), (fd, buff, n)) __OTORP__(int fd; __V_* buff; size_t n;){
register Sfio_t *sp; Sfio_t *sp;
if(sp=sh.sftable[fd]) if(sp=sh.sftable[fd])
return(sfread(sp,buff,n)); return(sfread(sp,buff,n));
else else
@ -1409,8 +1409,8 @@ ssize_t sh_read __PARAM__((register int fd, __V_* buff, size_t n), (fd, buff, n)
/* /*
* shell version of write() for user added builtins * shell version of write() for user added builtins
*/ */
ssize_t sh_write __PARAM__((register int fd, const __V_* buff, size_t n), (fd, buff, n)) __OTORP__(register int fd; const __V_* buff; size_t n;){ ssize_t sh_write __PARAM__((int fd, const __V_* buff, size_t n), (fd, buff, n)) __OTORP__(int fd; const __V_* buff; size_t n;){
register Sfio_t *sp; Sfio_t *sp;
if(sp=sh.sftable[fd]) if(sp=sh.sftable[fd])
return(sfwrite(sp,buff,n)); return(sfwrite(sp,buff,n));
else else
@ -1421,8 +1421,8 @@ ssize_t sh_write __PARAM__((register int fd, const __V_* buff, size_t n), (fd, b
/* /*
* shell version of lseek() for user added builtins * shell version of lseek() for user added builtins
*/ */
off_t sh_seek __PARAM__((register int fd, off_t offset, int whence), (fd, offset, whence)) __OTORP__(register int fd; off_t offset; int whence;){ off_t sh_seek __PARAM__((int fd, off_t offset, int whence), (fd, offset, whence)) __OTORP__(int fd; off_t offset; int whence;){
register Sfio_t *sp; Sfio_t *sp;
if(sp=sh.sftable[fd]) if(sp=sh.sftable[fd])
return(sfseek(sp,offset,whence)); return(sfseek(sp,offset,whence));
else else
@ -1430,8 +1430,8 @@ off_t sh_seek __PARAM__((register int fd, off_t offset, int whence), (fd, offset
} }
#undef dup #undef dup
int sh_dup __PARAM__((register int old), (old)) __OTORP__(register int old;){ int sh_dup __PARAM__((int old), (old)) __OTORP__(int old;){
register int fd = dup(old); int fd = dup(old);
if(fd>=0) if(fd>=0)
sh.fdstatus[fd] = (sh.fdstatus[old]&~IOCLEX); sh.fdstatus[fd] = (sh.fdstatus[old]&~IOCLEX);
return(fd); return(fd);

View file

@ -210,10 +210,10 @@ static Sfio_t *outfile;
* This is the SIGCLD interrupt routine * This is the SIGCLD interrupt routine
* When called with sig==0, it does a blocking wait * When called with sig==0, it does a blocking wait
*/ */
static void job_waitsafe __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ static void job_waitsafe __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register pid_t pid; pid_t pid;
register struct process *pw; struct process *pw;
register int flags; int flags;
struct process dummy; struct process dummy;
struct jobsave *jp; struct jobsave *jp;
int wstat; int wstat;
@ -347,7 +347,7 @@ static void job_waitsafe __PARAM__((register int sig), (sig)) __OTORP__(register
* if lflag is set the switching driver message will not print * if lflag is set the switching driver message will not print
*/ */
void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){ void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
register int ntry=0; int ntry=0;
job.fd = JOBTTY; job.fd = JOBTTY;
signal(SIGCHLD,job_waitsafe); signal(SIGCHLD,job_waitsafe);
@ -382,8 +382,8 @@ void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
{ {
/* Get a controlling terminal and set process group */ /* Get a controlling terminal and set process group */
/* This should have already been done by rlogin */ /* This should have already been done by rlogin */
register int fd; int fd;
register char *ttynam; char *ttynam;
#ifndef SIGTSTP #ifndef SIGTSTP
setpgid(0,sh.pid); setpgid(0,sh.pid);
#endif /*SIGTSTP */ #endif /*SIGTSTP */
@ -482,8 +482,8 @@ void job_init __PARAM__((int lflag), (lflag)) __OTORP__(int lflag;){
* restore tty driver and pgrp * restore tty driver and pgrp
*/ */
int job_close __PARAM__((void), ()){ int job_close __PARAM__((void), ()){
register struct process *pw = job.pwlist; struct process *pw = job.pwlist;
register int count = 0, running = 0; int count = 0, running = 0;
if(possible && !job.jobcontrol) if(possible && !job.jobcontrol)
return(0); return(0);
else if(!possible && (!sh_isstate(SH_MONITOR) || sh_isstate(SH_FORKED))) else if(!possible && (!sh_isstate(SH_MONITOR) || sh_isstate(SH_FORKED)))
@ -553,7 +553,7 @@ int job_close __PARAM__((void), ()){
return(0); return(0);
} }
static void job_set __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){ static void job_set __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
/* save current terminal state */ /* save current terminal state */
tty_get(job.fd,&my_stty); tty_get(job.fd,&my_stty);
if(pw->p_flag&P_STTY) if(pw->p_flag&P_STTY)
@ -568,7 +568,7 @@ static void job_set __PARAM__((register struct process *pw), (pw)) __OTORP__(reg
#endif /* SIGTSTP */ #endif /* SIGTSTP */
} }
static void job_reset __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){ static void job_reset __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
/* save the terminal state for current job */ /* save the terminal state for current job */
#ifdef SIGTSTP #ifdef SIGTSTP
job_fgrp(pw,tcgetpgrp(job.fd)); job_fgrp(pw,tcgetpgrp(job.fd));
@ -593,9 +593,9 @@ static void job_reset __PARAM__((register struct process *pw), (pw)) __OTORP__(r
*/ */
void job_bwait __PARAM__((char **jobs), (jobs)) __OTORP__(char **jobs;){ void job_bwait __PARAM__((char **jobs), (jobs)) __OTORP__(char **jobs;){
register char *job; char *job;
register struct process *pw; struct process *pw;
register pid_t pid; pid_t pid;
if(*jobs==0) if(*jobs==0)
job_wait((pid_t)-1); job_wait((pid_t)-1);
else while(job = *jobs++) else while(job = *jobs++)
@ -621,10 +621,10 @@ void job_bwait __PARAM__((char **jobs), (jobs)) __OTORP__(char **jobs;){
*/ */
int job_walk __PARAM__((Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[]), (file, fun, arg, joblist)) __OTORP__(Sfio_t *file;int (*fun)();int arg;char *joblist[];){ int job_walk __PARAM__((Sfio_t *file,int (*fun)(struct process*,int),int arg,char *joblist[]), (file, fun, arg, joblist)) __OTORP__(Sfio_t *file;int (*fun)();int arg;char *joblist[];){
register struct process *pw = job.pwlist; struct process *pw = job.pwlist;
register int r = 0; int r = 0;
register char *jobid, **jobs=joblist; char *jobid, **jobs=joblist;
register struct process *px; struct process *px;
job_string = 0; job_string = 0;
outfile = file; outfile = file;
by_number = 0; by_number = 0;
@ -680,7 +680,7 @@ int job_walk __PARAM__((Sfio_t *file,int (*fun)(struct process*,int),int arg,cha
/* /*
* send signal <sig> to background process group if not disowned * send signal <sig> to background process group if not disowned
*/ */
int job_terminate __PARAM__((register struct process *pw,register int sig), (pw, sig)) __OTORP__(register struct process *pw;register int sig;){ int job_terminate __PARAM__((struct process *pw,int sig), (pw, sig)) __OTORP__(struct process *pw;int sig;){
if(pw->p_pgrp && !(pw->p_flag&P_DISOWN)) if(pw->p_pgrp && !(pw->p_flag&P_DISOWN))
job_kill(pw,sig); job_kill(pw,sig);
return(0); return(0);
@ -693,11 +693,11 @@ int job_terminate __PARAM__((register struct process *pw,register int sig), (pw,
* flag JOB_PFLAG for process id(s) only * flag JOB_PFLAG for process id(s) only
*/ */
int job_list __PARAM__((struct process *pw,register int flag), (pw, flag)) __OTORP__(struct process *pw;register int flag;){ int job_list __PARAM__((struct process *pw,int flag), (pw, flag)) __OTORP__(struct process *pw;int flag;){
register struct process *px = pw; struct process *px = pw;
register int n; int n;
register const char *msg; const char *msg;
register int msize; int msize;
if(!pw || pw->p_job<=0) if(!pw || pw->p_job<=0)
return(1); return(1);
if(pw->p_env != sh.jobenv) if(pw->p_env != sh.jobenv)
@ -768,9 +768,9 @@ int job_list __PARAM__((struct process *pw,register int flag), (pw, flag)) __OTO
* get the process group given the job number * get the process group given the job number
* This routine returns the process group number or -1 * This routine returns the process group number or -1
*/ */
static struct process *job_bystring __PARAM__((register char *ajob), (ajob)) __OTORP__(register char *ajob;){ static struct process *job_bystring __PARAM__((char *ajob), (ajob)) __OTORP__(char *ajob;){
register struct process *pw=job.pwlist; struct process *pw=job.pwlist;
register int c; int c;
if(*ajob++ != '%' || !pw) if(*ajob++ != '%' || !pw)
return(NIL(struct process*)); return(NIL(struct process*));
c = *ajob; c = *ajob;
@ -794,9 +794,9 @@ static struct process *job_bystring __PARAM__((register char *ajob), (ajob)) __O
* Kill a job or process * Kill a job or process
*/ */
int job_kill __PARAM__((register struct process *pw,register int sig), (pw, sig)) __OTORP__(register struct process *pw;register int sig;){ int job_kill __PARAM__((struct process *pw,int sig), (pw, sig)) __OTORP__(struct process *pw;int sig;){
register pid_t pid; pid_t pid;
register int r; int r;
const char *msg; const char *msg;
#ifdef SIGTSTP #ifdef SIGTSTP
int stopsig = (sig==SIGSTOP||sig==SIGTSTP||sig==SIGTTIN||sig==SIGTTOU); int stopsig = (sig==SIGSTOP||sig==SIGTSTP||sig==SIGTTIN||sig==SIGTTOU);
@ -884,10 +884,10 @@ int job_kill __PARAM__((register struct process *pw,register int sig), (pw, sig)
*/ */
static struct process *job_byname __PARAM__((char *name), (name)) __OTORP__(char *name;){ static struct process *job_byname __PARAM__((char *name), (name)) __OTORP__(char *name;){
register struct process *pw = job.pwlist; struct process *pw = job.pwlist;
register struct process *pz = 0; struct process *pz = 0;
register int *flag = 0; int *flag = 0;
register char *cp = name; char *cp = name;
int offset; int offset;
if(!sh.hist_ptr) if(!sh.hist_ptr)
return(NIL(struct process*)); return(NIL(struct process*));
@ -917,10 +917,10 @@ static struct process *job_byname __PARAM__((char *name), (name)) __OTORP__(char
*/ */
void job_clear __PARAM__((void), ()){ void job_clear __PARAM__((void), ()){
register struct process *pw, *px; struct process *pw, *px;
register struct process *pwnext; struct process *pwnext;
register int j = BYTE(sh.lim.child_max); int j = BYTE(sh.lim.child_max);
register struct jobsave *jp; struct jobsave *jp;
for(pw=job.pwlist; pw; pw=pwnext) for(pw=job.pwlist; pw; pw=pwnext)
{ {
pwnext = pw->p_nxtjob; pwnext = pw->p_nxtjob;
@ -954,8 +954,8 @@ void job_clear __PARAM__((void), ()){
*/ */
int job_post __PARAM__((pid_t pid, pid_t join), (pid, join)) __OTORP__(pid_t pid; pid_t join;){ int job_post __PARAM__((pid_t pid, pid_t join), (pid, join)) __OTORP__(pid_t pid; pid_t join;){
register struct process *pw; struct process *pw;
register History_t *hp = sh.hist_ptr; History_t *hp = sh.hist_ptr;
sh.jobenv = sh.curenv; sh.jobenv = sh.curenv;
if(job.toclear) if(job.toclear)
{ {
@ -1023,7 +1023,7 @@ int job_post __PARAM__((pid_t pid, pid_t join), (pid, join)) __OTORP__(pid_t pid
*/ */
static struct process *job_bypid __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){ static struct process *job_bypid __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
register struct process *pw, *px; struct process *pw, *px;
for(pw=job.pwlist; pw; pw=pw->p_nxtjob) for(pw=job.pwlist; pw; pw=pw->p_nxtjob)
for(px=pw; px; px=px->p_nxtproc) for(px=pw; px; px=px->p_nxtproc)
{ {
@ -1038,7 +1038,7 @@ static struct process *job_bypid __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t p
*/ */
static struct process *job_byjid __PARAM__((int jobid), (jobid)) __OTORP__(int jobid;){ static struct process *job_byjid __PARAM__((int jobid), (jobid)) __OTORP__(int jobid;){
register struct process *pw; struct process *pw;
for(pw=job.pwlist;pw; pw = pw->p_nxtjob) for(pw=job.pwlist;pw; pw = pw->p_nxtjob)
{ {
if(pw->p_job==jobid) if(pw->p_job==jobid)
@ -1050,10 +1050,10 @@ static struct process *job_byjid __PARAM__((int jobid), (jobid)) __OTORP__(int j
/* /*
* print a signal message * print a signal message
*/ */
static void job_prmsg __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){ static void job_prmsg __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
if(pw->p_exit!=SIGINT && pw->p_exit!=SIGPIPE) if(pw->p_exit!=SIGINT && pw->p_exit!=SIGPIPE)
{ {
register const char *msg, *dump; const char *msg, *dump;
msg = job_sigmsg((int)(pw->p_exit)); msg = job_sigmsg((int)(pw->p_exit));
msg = ERROR_translate(msg,1); msg = ERROR_translate(msg,1);
if(pw->p_flag&P_COREDUMP) if(pw->p_flag&P_COREDUMP)
@ -1075,9 +1075,9 @@ static void job_prmsg __PARAM__((register struct process *pw), (pw)) __OTORP__(r
* pid=-1 to wait for all runing processes * pid=-1 to wait for all runing processes
*/ */
void job_wait __PARAM__((register pid_t pid), (pid)) __OTORP__(register pid_t pid;){ void job_wait __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
register struct process *pw=0,*px; struct process *pw=0,*px;
register int jobid = 0; int jobid = 0;
char intr = 0; char intr = 0;
if(pid <= 0) if(pid <= 0)
{ {
@ -1230,8 +1230,8 @@ done:
* disown job if bgflag == 'd' * disown job if bgflag == 'd'
*/ */
job_switch __PARAM__((register struct process *pw,int bgflag), (pw, bgflag)) __OTORP__(register struct process *pw;int bgflag;){ job_switch __PARAM__((struct process *pw,int bgflag), (pw, bgflag)) __OTORP__(struct process *pw;int bgflag;){
register const char *msg; const char *msg;
if(!pw || !(pw=job_byjid((int)pw->p_job))) if(!pw || !(pw=job_byjid((int)pw->p_job)))
return(1); return(1);
if(bgflag=='d') if(bgflag=='d')
@ -1276,7 +1276,7 @@ job_switch __PARAM__((register struct process *pw,int bgflag), (pw, bgflag)) __O
* Set the foreground group associated with a job * Set the foreground group associated with a job
*/ */
static void job_fgrp __PARAM__((register struct process *pw, int newgrp), (pw, newgrp)) __OTORP__(register struct process *pw; int newgrp;){ static void job_fgrp __PARAM__((struct process *pw, int newgrp), (pw, newgrp)) __OTORP__(struct process *pw; int newgrp;){
for(; pw; pw=pw->p_nxtproc) for(; pw; pw=pw->p_nxtproc)
pw->p_fgrp = newgrp; pw->p_fgrp = newgrp;
} }
@ -1285,9 +1285,9 @@ static void job_fgrp __PARAM__((register struct process *pw, int newgrp), (pw, n
* turn off STOP state of a process group and send CONT signals * turn off STOP state of a process group and send CONT signals
*/ */
static void job_unstop __PARAM__((register struct process *px), (px)) __OTORP__(register struct process *px;){ static void job_unstop __PARAM__((struct process *px), (px)) __OTORP__(struct process *px;){
register struct process *pw; struct process *pw;
register int num = 0; int num = 0;
for(pw=px ;pw ;pw=pw->p_nxtproc) for(pw=px ;pw ;pw=pw->p_nxtproc)
{ {
if(pw->p_flag&P_STOPPED) if(pw->p_flag&P_STOPPED)
@ -1313,8 +1313,8 @@ static void job_unstop __PARAM__((register struct process *px), (px)) __OTORP__(
* if <notify> is non-zero, then jobs with pending notifications are unposted * if <notify> is non-zero, then jobs with pending notifications are unposted
*/ */
static struct process *job_unpost __PARAM__((register struct process *pwtop,int notify), (pwtop, notify)) __OTORP__(register struct process *pwtop;int notify;){ static struct process *job_unpost __PARAM__((struct process *pwtop,int notify), (pwtop, notify)) __OTORP__(struct process *pwtop;int notify;){
register struct process *pw; struct process *pw;
/* make sure all processes are done */ /* make sure all processes are done */
#ifdef DEBUG #ifdef DEBUG
sfprintf(sfstderr,"%ld: unpost pid=%ld\n",(long)getpid(),(long)pwtop->p_pid); sfprintf(sfstderr,"%ld: unpost pid=%ld\n",(long)getpid(),(long)pwtop->p_pid);
@ -1361,8 +1361,8 @@ static struct process *job_unpost __PARAM__((register struct process *pwtop,int
/* /*
* unlink a job form the job list * unlink a job form the job list
*/ */
static void job_unlink __PARAM__((register struct process *pw), (pw)) __OTORP__(register struct process *pw;){ static void job_unlink __PARAM__((struct process *pw), (pw)) __OTORP__(struct process *pw;){
register struct process *px; struct process *px;
if(pw==job.pwlist) if(pw==job.pwlist)
{ {
job.pwlist = pw->p_nxtjob; job.pwlist = pw->p_nxtjob;
@ -1383,15 +1383,15 @@ static void job_unlink __PARAM__((register struct process *pw), (pw)) __OTORP__(
*/ */
static int job_alloc __PARAM__((void), ()){ static int job_alloc __PARAM__((void), ()){
register int j=0; int j=0;
register unsigned mask = 1; unsigned mask = 1;
register unsigned char *freeword; unsigned char *freeword;
register int jmax = BYTE(sh.lim.child_max); int jmax = BYTE(sh.lim.child_max);
/* skip to first word with a free slot */ /* skip to first word with a free slot */
for(j=0;job.freejobs[j] == UCHAR_MAX; j++); for(j=0;job.freejobs[j] == UCHAR_MAX; j++);
if(j >= jmax) if(j >= jmax)
{ {
register struct process *pw; struct process *pw;
for(j=1; j < sh.lim.child_max; j++) for(j=1; j < sh.lim.child_max; j++)
{ {
if((pw=job_byjid(j))&& !job_unpost(pw,0)) if((pw=job_byjid(j))&& !job_unpost(pw,0))
@ -1412,9 +1412,9 @@ static int job_alloc __PARAM__((void), ()){
* return a job number * return a job number
*/ */
static void job_free __PARAM__((register int n), (n)) __OTORP__(register int n;){ static void job_free __PARAM__((int n), (n)) __OTORP__(int n;){
register int j = (--n)/CHAR_BIT; int j = (--n)/CHAR_BIT;
register unsigned mask; unsigned mask;
n -= j*CHAR_BIT; n -= j*CHAR_BIT;
mask = 1 << n; mask = 1 << n;
job.freejobs[j] &= ~mask; job.freejobs[j] &= ~mask;
@ -1442,9 +1442,9 @@ static char *job_sigmsg __PARAM__((int sig), (sig)) __OTORP__(int sig;){
* if pid==0, then oldest saved process is deleted * if pid==0, then oldest saved process is deleted
* If pid is not found a -1 is returned. * If pid is not found a -1 is returned.
*/ */
int job_chksave __PARAM__((register pid_t pid), (pid)) __OTORP__(register pid_t pid;){ int job_chksave __PARAM__((pid_t pid), (pid)) __OTORP__(pid_t pid;){
register struct jobsave *jp = bck_list, *jpold=0; struct jobsave *jp = bck_list, *jpold=0;
register int r= -1; int r= -1;
while(jp) while(jp)
{ {
if(jp->pid==pid) if(jp->pid==pid)

View file

@ -199,7 +199,7 @@ static void refvar __PARAM__((int type), (type)) __OTORP__(int type;){
* This routine gets called when reading across a buffer boundary * This routine gets called when reading across a buffer boundary
* If lexd.nocopy is off, then current token is saved on the stack * If lexd.nocopy is off, then current token is saved on the stack
*/ */
static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, register int size), (iop, buff, size)) __OTORP__(Sfio_t *iop; const char *buff; register int size;){ static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, int size), (iop, buff, size)) __OTORP__(Sfio_t *iop; const char *buff; int size;){
#ifdef KSHELL #ifdef KSHELL
/* write to history file and to stderr if necessary */ /* write to history file and to stderr if necessary */
if(!sfstacked(iop)) if(!sfstacked(iop))
@ -234,7 +234,7 @@ static void lex_advance __PARAM__((Sfio_t *iop, const char *buff, register int s
* preserves lexical state * preserves lexical state
*/ */
static int lexfill __PARAM__((void), ()){ static int lexfill __PARAM__((void), ()){
register int c; int c;
struct lexdata savedata; struct lexdata savedata;
struct lexstate savestate; struct lexstate savestate;
savedata = lexd; savedata = lexd;
@ -264,10 +264,10 @@ void sh_lexinit __PARAM__((int mode), (mode)) __OTORP__(int mode;){
#ifdef DBUG #ifdef DBUG
int sh_lex __PARAM__((void), ()){ int sh_lex __PARAM__((void), ()){
register int flag; int flag;
extern __MANGLE__ int lextoken __PROTO__((void)); extern __MANGLE__ int lextoken __PROTO__((void));
char *quoted, *macro, *split, *expand; char *quoted, *macro, *split, *expand;
register int tok = lextoken(); int tok = lextoken();
quoted = macro = split = expand = ""; quoted = macro = split = expand = "";
if(tok==0 && (flag=shlex.arg->argflag)) if(tok==0 && (flag=shlex.arg->argflag))
{ {
@ -326,8 +326,8 @@ static void mbStateSkip __PARAM__((const char *state, int *c, int *n, int *len),
* Returns the token type * Returns the token type
*/ */
int sh_lex __PARAM__((void), ()){ int sh_lex __PARAM__((void), ()){
register const char *state; const char *state;
register int n, c, mode=ST_BEGIN, wordflags=0; int n, c, mode=ST_BEGIN, wordflags=0;
int len, inlevel=lexd.level, assignment=0, ingrave=0; int len, inlevel=lexd.level, assignment=0, ingrave=0;
Sfio_t *sp; Sfio_t *sp;
if(lexd.paren) if(lexd.paren)
@ -1283,8 +1283,8 @@ breakloop:
* read to end of command substitution * read to end of command substitution
*/ */
static int comsub __PARAM__((void), ()){ static int comsub __PARAM__((void), ()){
register int n,c,count=1; int n,c,count=1;
register int line=sh.inlineno; int line=sh.inlineno;
char word[5]; char word[5];
int messages=0; int messages=0;
struct lexstate save; struct lexstate save;
@ -1355,8 +1355,8 @@ done:
* allocate ionode with delimiter filled in without disturbing stak * allocate ionode with delimiter filled in without disturbing stak
*/ */
static void nested_here __PARAM__((void), ()){ static void nested_here __PARAM__((void), ()){
register struct ionod *iop; struct ionod *iop;
register int n,offset; int n,offset;
struct argnod *arg = shlex.arg; struct argnod *arg = shlex.arg;
char *base; char *base;
if(offset=staktell()) if(offset=staktell())
@ -1386,8 +1386,8 @@ static void nested_here __PARAM__((void), ()){
* if <copy> is non,zero, then the characters are copied to the stack * if <copy> is non,zero, then the characters are copied to the stack
* <state> is the initial lexical state * <state> is the initial lexical state
*/ */
void sh_lexskip __PARAM__((int close, register int copy, int state), (close, copy, state)) __OTORP__(int close; register int copy; int state;){ void sh_lexskip __PARAM__((int close, int copy, int state), (close, copy, state)) __OTORP__(int close; int copy; int state;){
register char *cp; char *cp;
lexd.nest = close; lexd.nest = close;
lex_state = state; lex_state = state;
lexd.nocopy += !copy; lexd.nocopy += !copy;
@ -1411,11 +1411,11 @@ void sh_lexskip __PARAM__((int close, register int copy, int state), (close, co
* returns 1 for complete here-doc, 0 for EOF * returns 1 for complete here-doc, 0 for EOF
*/ */
static int here_copy __PARAM__((register struct ionod *iop), (iop)) __OTORP__(register struct ionod *iop;){ static int here_copy __PARAM__((struct ionod *iop), (iop)) __OTORP__(struct ionod *iop;){
register const char *state; const char *state;
register int c,n; int c,n;
register char *bufp,*cp; char *bufp,*cp;
register Sfio_t *sp; Sfio_t *sp;
int stripflg, nsave, special=0; int stripflg, nsave, special=0;
if(iop->iolst) if(iop->iolst)
here_copy(iop->iolst); here_copy(iop->iolst);
@ -1593,7 +1593,7 @@ done:
/* /*
* generates string for given token * generates string for given token
*/ */
static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register int sym;){ static char *fmttoken __PARAM__((int sym), (sym)) __OTORP__(int sym;){
static char tok[3]; static char tok[3];
if(sym < 0) if(sym < 0)
return((char*)e_lexzerobyte); return((char*)e_lexzerobyte);
@ -1601,7 +1601,7 @@ static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register in
return(shlex.arg?shlex.arg->argval:"?"); return(shlex.arg?shlex.arg->argval:"?");
if(sym&SYMRES) if(sym&SYMRES)
{ {
register const Shtable_t *tp=shtab_reserved; const Shtable_t *tp=shtab_reserved;
while(tp->sh_number && tp->sh_number!=sym) while(tp->sh_number && tp->sh_number!=sym)
tp++; tp++;
return((char*)tp->sh_name); return((char*)tp->sh_name);
@ -1652,9 +1652,9 @@ static char *fmttoken __PARAM__((register int sym), (sym)) __OTORP__(register in
*/ */
void sh_syntax __PARAM__((void), ()){ void sh_syntax __PARAM__((void), ()){
register const char *cp = e_unexpected; const char *cp = e_unexpected;
register int tok = shlex.token; int tok = shlex.token;
register char *tokstr; char *tokstr;
Sfio_t *sp; Sfio_t *sp;
if((tok==EOFSYM) && shlex.lasttok) if((tok==EOFSYM) && shlex.lasttok)
{ {
@ -1667,7 +1667,7 @@ void sh_syntax __PARAM__((void), ()){
if((sp=fcfile()) || (sh.infd>=0 && (sp=sh.sftable[sh.infd]))) if((sp=fcfile()) || (sh.infd>=0 && (sp=sh.sftable[sh.infd])))
{ {
/* clear out any pending input */ /* clear out any pending input */
register Sfio_t *top; Sfio_t *top;
while(fcget()>0); while(fcget()>0);
fcclose(); fcclose();
while(top=sfstack(sp,SF_POPSTACK)) while(top=sfstack(sp,SF_POPSTACK))
@ -1696,10 +1696,10 @@ void sh_syntax __PARAM__((void), ()){
* If mode==2, the each $"" string is printed on standard output * If mode==2, the each $"" string is printed on standard output
*/ */
struct argnod *sh_endword __PARAM__((int mode), (mode)) __OTORP__(int mode;){ struct argnod *sh_endword __PARAM__((int mode), (mode)) __OTORP__(int mode;){
register const char *state = sh_lexstates[ST_NESTED]; const char *state = sh_lexstates[ST_NESTED];
register int n; int n;
register char *sp,*dp; char *sp,*dp;
register int inquote=0, inlit=0; /* set within quoted strings */ int inquote=0, inlit=0; /* set within quoted strings */
struct argnod* argp; struct argnod* argp;
char *ep=0; char *ep=0;
int offset = staktell(); int offset = staktell();
@ -1901,8 +1901,8 @@ struct alias
* This code gets called whenever an end of string is found with alias * This code gets called whenever an end of string is found with alias
*/ */
static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type;Sfdisc_t *handle;){ static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop, type, handle)) __OTORP__(Sfio_t *iop;int type;Sfdisc_t *handle;){
register struct alias *ap = (struct alias*)handle; struct alias *ap = (struct alias*)handle;
register Namval_t *np; Namval_t *np;
static char buf[2]; static char buf[2];
if(type==0 || !ap) if(type==0 || !ap)
return(0); return(0);
@ -1911,7 +1911,7 @@ static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop
{ {
if(type==SF_CLOSE) if(type==SF_CLOSE)
{ {
register Sfdisc_t *dp = sfdisc(iop,SF_POPDISC); Sfdisc_t *dp = sfdisc(iop,SF_POPDISC);
if(dp!=handle) if(dp!=handle)
sfdisc(iop,dp); sfdisc(iop,dp);
else if(ap) else if(ap)
@ -1922,7 +1922,7 @@ static int alias_exceptf __PARAM__((Sfio_t *iop,int type,Sfdisc_t *handle), (iop
if(ap->nextc) if(ap->nextc)
{ {
/* if last character is a blank, then next work can be alias */ /* if last character is a blank, then next work can be alias */
register int c = fcpeek(-1); int c = fcpeek(-1);
if(isblank(c)) if(isblank(c))
shlex.aliasok = 1; shlex.aliasok = 1;
*buf = ap->nextc; *buf = ap->nextc;
@ -1938,7 +1938,7 @@ done:
static void setupalias __PARAM__((const char *string,Namval_t *np), (string, np)) __OTORP__(const char *string;Namval_t *np;){ static void setupalias __PARAM__((const char *string,Namval_t *np), (string, np)) __OTORP__(const char *string;Namval_t *np;){
register Sfio_t *iop, *base; Sfio_t *iop, *base;
struct alias *ap = (struct alias*)malloc(sizeof(struct alias)); struct alias *ap = (struct alias*)malloc(sizeof(struct alias));
ap->disc = alias_disc; ap->disc = alias_disc;
iop = sfopen(NIL(Sfio_t*),(char*)string,"s"); iop = sfopen(NIL(Sfio_t*),(char*)string,"s");

View file

@ -161,7 +161,7 @@ static char *mac_getstring __PROTO__((char*));
/* /*
* perform only parameter substitution and catch failures * perform only parameter substitution and catch failures
*/ */
char *sh_mactry __PARAM__((register char *string), (string)) __OTORP__(register char *string;){ char *sh_mactry __PARAM__((char *string), (string)) __OTORP__(char *string;){
if(string) if(string)
{ {
int jmp_val; int jmp_val;
@ -183,7 +183,7 @@ char *sh_mactry __PARAM__((register char *string), (string)) __OTORP__(register
* yields a single pathname. * yields a single pathname.
* If <mode> negative, than expansion rules for assignment are applied. * If <mode> negative, than expansion rules for assignment are applied.
*/ */
char *sh_mactrim __PARAM__((char *str, register int mode), (str, mode)) __OTORP__(char *str; register int mode;){ char *sh_mactrim __PARAM__((char *str, int mode), (str, mode)) __OTORP__(char *str; int mode;){
struct _mac_ savemac; struct _mac_ savemac;
savemac = mac; savemac = mac;
stakseek(0); stakseek(0);
@ -217,9 +217,9 @@ char *sh_mactrim __PARAM__((char *str, register int mode), (str, mode)) __OTORP_
/* /*
* Perform all the expansions on the argument <argp> * Perform all the expansions on the argument <argp>
*/ */
int sh_macexpand __PARAM__((register struct argnod *argp, struct argnod **arghead), (argp, arghead)) __OTORP__(register struct argnod *argp; struct argnod **arghead;){ int sh_macexpand __PARAM__((struct argnod *argp, struct argnod **arghead), (argp, arghead)) __OTORP__(struct argnod *argp; struct argnod **arghead;){
register int flags = argp->argflag; int flags = argp->argflag;
register char *str = argp->argval; char *str = argp->argval;
struct _mac_ savemac; struct _mac_ savemac;
savemac = mac; savemac = mac;
stakseek(ARGVAL); stakseek(ARGVAL);
@ -248,9 +248,9 @@ int sh_macexpand __PARAM__((register struct argnod *argp, struct argnod **arghea
* The result is written to <outfile> * The result is written to <outfile>
*/ */
void sh_machere __PARAM__((Sfio_t *infile, Sfio_t *outfile, char *string), (infile, outfile, string)) __OTORP__(Sfio_t *infile; Sfio_t *outfile; char *string;){ void sh_machere __PARAM__((Sfio_t *infile, Sfio_t *outfile, char *string), (infile, outfile, string)) __OTORP__(Sfio_t *infile; Sfio_t *outfile; char *string;){
register int c,n; int c,n;
register const char *state = sh_lexstates[ST_QUOTE]; const char *state = sh_lexstates[ST_QUOTE];
register char *cp; char *cp;
Fcin_t save; Fcin_t save;
struct _mac_ savemac; struct _mac_ savemac;
savemac = mac; savemac = mac;
@ -353,9 +353,9 @@ void sh_machere __PARAM__((Sfio_t *infile, Sfio_t *outfile, char *string), (infi
* Process the characters up to <endch> or end of input string * Process the characters up to <endch> or end of input string
*/ */
static void copyto __PARAM__((int endch, int newquote), (endch, newquote)) __OTORP__(int endch; int newquote;){ static void copyto __PARAM__((int endch, int newquote), (endch, newquote)) __OTORP__(int endch; int newquote;){
register int c,n; int c,n;
register const char *state = sh_lexstates[ST_MACRO]; const char *state = sh_lexstates[ST_MACRO];
register char *cp,*first; char *cp,*first;
int tilde = -1; int tilde = -1;
int oldquote = mac.quote; int oldquote = mac.quote;
int ansi_c = 0; int ansi_c = 0;
@ -566,7 +566,7 @@ done:
* This will be in libast some day * This will be in libast some day
*/ */
static int strgrpmatch __PARAM__((char *string, char *pattern, int match[], int nmatch,int flags), (string, pattern, match, nmatch, flags)) __OTORP__(char *string; char *pattern; int match[]; int nmatch;int flags;){ static int strgrpmatch __PARAM__((char *string, char *pattern, int match[], int nmatch,int flags), (string, pattern, match, nmatch, flags)) __OTORP__(char *string; char *pattern; int match[]; int nmatch;int flags;){
register char *cp=string, *dp; char *cp=string, *dp;
int c=0,anchor = (flags&STR_LEFT); int c=0,anchor = (flags&STR_LEFT);
flags &= ~STR_LEFT; flags &= ~STR_LEFT;
/* optimize a little */ /* optimize a little */
@ -607,9 +607,9 @@ static int strgrpmatch __PARAM__((char *string, char *pattern, int match[], int
/* /*
* copy <str> to stack performing sub-expression substitutions * copy <str> to stack performing sub-expression substitutions
*/ */
static void mac_substitute __PARAM__((register char *cp,char *str,register int subexp[],int subsize), (cp, str, subexp, subsize)) __OTORP__(register char *cp;char *str;register int subexp[];int subsize;){ static void mac_substitute __PARAM__((char *cp,char *str,int subexp[],int subsize), (cp, str, subexp, subsize)) __OTORP__(char *cp;char *str;int subexp[];int subsize;){
register int c,n; int c,n;
register char *first=cp; char *first=cp;
while(1) while(1)
{ {
while((c= *cp++) && c!=ESCAPE); while((c= *cp++) && c!=ESCAPE);
@ -644,11 +644,11 @@ static void mac_substitute __PARAM__((register char *cp,char *str,register int s
*/ */
static int varsub __PARAM__((void), ()){ static int varsub __PARAM__((void), ()){
static char idbuff[2]; static char idbuff[2];
register int c; int c;
register int type=0; /* M_xxx */ int type=0; /* M_xxx */
register char *v,*argp=0; char *v,*argp=0;
register Namval_t *np = NIL(Namval_t*); Namval_t *np = NIL(Namval_t*);
register int dolg=0, mode=0; int dolg=0, mode=0;
Namarr_t *ap=0; Namarr_t *ap=0;
int dolmax=0, vsize= -1, offset, nulflg, replen=0, bysub=0; int dolmax=0, vsize= -1, offset, nulflg, replen=0, bysub=0;
char *id = idbuff, *pattern=0, *repstr; char *id = idbuff, *pattern=0, *repstr;
@ -711,7 +711,7 @@ retry1:
c -= '0'; c -= '0';
if(type) if(type)
{ {
register int d; int d;
while((d=fcget()),isadigit(d)) while((d=fcget()),isadigit(d))
c = 10*c + (d-'0'); c = 10*c + (d-'0');
fcseek(-1); fcseek(-1);
@ -1023,7 +1023,7 @@ retry1:
retry2: retry2:
if(v && (!nulflg || *v ) && c!='+') if(v && (!nulflg || *v ) && c!='+')
{ {
register int d = (mode=='@'?' ':mac.ifs); int d = (mode=='@'?' ':mac.ifs);
int match[20], nmatch; int match[20], nmatch;
while(1) while(1)
{ {
@ -1156,8 +1156,8 @@ nosub:
* <type> is 0 for older `...` version * <type> is 0 for older `...` version
*/ */
static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
register int c; int c;
register char *str; char *str;
Sfio_t *sp; Sfio_t *sp;
Fcin_t save; Fcin_t save;
struct slnod *saveslp = sh.st.staklist; struct slnod *saveslp = sh.st.staklist;
@ -1167,7 +1167,7 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
char *savptr = stakfreeze(0); char *savptr = stakfreeze(0);
int saveflags = sh_isstate(SH_HISTORY|SH_VERBOSE); int saveflags = sh_isstate(SH_HISTORY|SH_VERBOSE);
int newlines; int newlines;
register union anynode *t; union anynode *t;
savemac = mac; savemac = mac;
sh.st.staklist=0; sh.st.staklist=0;
if(type) if(type)
@ -1228,7 +1228,7 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
if(t->tre.tretyp==0 && !t->com.comarg) if(t->tre.tretyp==0 && !t->com.comarg)
{ {
/* special case $( < file) */ /* special case $( < file) */
register int fd; int fd;
struct checkpt buff; struct checkpt buff;
sh_pushcontext(&buff,SH_JMPIO); sh_pushcontext(&buff,SH_JMPIO);
if(t->tre.treio && !(((t->tre.treio)->iofile)&IOUFD) && if(t->tre.treio && !(((t->tre.treio)->iofile)&IOUFD) &&
@ -1279,10 +1279,10 @@ static void comsubst __PARAM__((int type), (type)) __OTORP__(int type;){
/* /*
* copy <str> onto the stack * copy <str> onto the stack
*/ */
static void mac_copy __PARAM__((register const char *str, register int size), (str, size)) __OTORP__(register const char *str; register int size;){ static void mac_copy __PARAM__((const char *str, int size), (str, size)) __OTORP__(const char *str; int size;){
register char *state; char *state;
register const char *cp=str; const char *cp=str;
register int c,n,nopat; int c,n,nopat;
nopat = (mac.quote||mac.assign==1||mac.arith); nopat = (mac.quote||mac.assign==1||mac.arith);
if(mac.sp) if(mac.sp)
sfwrite(mac.sp,str,size); sfwrite(mac.sp,str,size);
@ -1403,7 +1403,7 @@ static void mac_copy __PARAM__((register const char *str, register int size), (s
* Do filename expansion of required * Do filename expansion of required
*/ */
static void endfield __PARAM__((int split), (split)) __OTORP__(int split;){ static void endfield __PARAM__((int split), (split)) __OTORP__(int split;){
register struct argnod *argp; struct argnod *argp;
if(staktell() > ARGVAL || split) if(staktell() > ARGVAL || split)
{ {
argp = (struct argnod*)stakfreeze(1); argp = (struct argnod*)stakfreeze(1);
@ -1432,9 +1432,9 @@ static void endfield __PARAM__((int split), (split)) __OTORP__(int split;){
* Finds the right substring of STRING using the expression PAT * Finds the right substring of STRING using the expression PAT
* the longest substring is found when FLAG is set. * the longest substring is found when FLAG is set.
*/ */
static int substring __PARAM__((register const char *string,const char *pat,int match[], int flag), (string, pat, match, flag)) __OTORP__(register const char *string;const char *pat;int match[]; int flag;){ static int substring __PARAM__((const char *string,const char *pat,int match[], int flag), (string, pat, match, flag)) __OTORP__(const char *string;const char *pat;int match[]; int flag;){
register const char *sp=string; const char *sp=string;
register int size,len,nmatch,n; int size,len,nmatch,n;
int smatch[20]; int smatch[20];
sp += (len=strlen(sp)); sp += (len=strlen(sp));
size = sp-string; size = sp-string;
@ -1467,8 +1467,8 @@ static int substring __PARAM__((register const char *string,const char *pat,int
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
static char *lastchar __PARAM__((const char *string, const char *endstring), (string, endstring)) __OTORP__(const char *string; const char *endstring;){ static char *lastchar __PARAM__((const char *string, const char *endstring), (string, endstring)) __OTORP__(const char *string; const char *endstring;){
register char *str = (char*)string; char *str = (char*)string;
register int c; int c;
mblen(NIL(char*),MB_CUR_MAX); mblen(NIL(char*),MB_CUR_MAX);
while(*str) while(*str)
{ {
@ -1481,9 +1481,9 @@ static int substring __PARAM__((register const char *string,const char *pat,int
return(str); return(str);
} }
static int charlen __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ static int charlen __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register const char *str = string; const char *str = string;
register int n=0; int n=0;
register int c; int c;
wchar_t w; wchar_t w;
mblen(NIL(char*),MB_CUR_MAX); mblen(NIL(char*),MB_CUR_MAX);
while(*str) while(*str)
@ -1504,8 +1504,8 @@ static int substring __PARAM__((register const char *string,const char *pat,int
* <offset> is byte offset for beginning of tilde string * <offset> is byte offset for beginning of tilde string
*/ */
static void tilde_expand2 __PARAM__((register int offset), (offset)) __OTORP__(register int offset;){ static void tilde_expand2 __PARAM__((int offset), (offset)) __OTORP__(int offset;){
register char *cp; char *cp;
int curoff = staktell(); int curoff = staktell();
stakputc(0); stakputc(0);
if(cp = sh_tilde(stakptr(offset))) if(cp = sh_tilde(stakptr(offset)))
@ -1526,11 +1526,11 @@ static void tilde_expand2 __PARAM__((register int offset), (offset)) __OTORP__(r
* If string doesn't start with ~ or ~... not found then 0 returned. * If string doesn't start with ~ or ~... not found then 0 returned.
*/ */
static char *sh_tilde __PARAM__((register const char *string), (string)) __OTORP__(register const char *string;){ static char *sh_tilde __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register char *cp; char *cp;
register int c; int c;
register struct passwd *pw; struct passwd *pw;
register Namval_t *np; Namval_t *np;
static Hashtab_t *logins_tree; static Hashtab_t *logins_tree;
if(*string++!='~') if(*string++!='~')
return(NIL(char*)); return(NIL(char*));
@ -1562,8 +1562,8 @@ static char *sh_tilde __PARAM__((register const char *string), (string)) __OTORP
/* /*
* return values for special macros * return values for special macros
*/ */
static char *special __PARAM__((register int c), (c)) __OTORP__(register int c;){ static char *special __PARAM__((int c), (c)) __OTORP__(int c;){
register Namval_t *np; Namval_t *np;
switch(c) switch(c)
{ {
case '@': case '@':
@ -1605,8 +1605,8 @@ static void mac_error __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* \ characters are stripped from string. * \ characters are stripped from string.
*/ */
static char *mac_getstring __PARAM__((char *pattern), (pattern)) __OTORP__(char *pattern;){ static char *mac_getstring __PARAM__((char *pattern), (pattern)) __OTORP__(char *pattern;){
register char *cp = pattern; char *cp = pattern;
register int c; int c;
while(c = *cp++) while(c = *cp++)
{ {
if(c==ESCAPE) if(c==ESCAPE)
@ -1625,8 +1625,8 @@ static char *mac_getstring __PARAM__((char *pattern), (pattern)) __OTORP__(char
*/ */
static char *nextname __PARAM__((const char *prefix, int len), (prefix, len)) __OTORP__(const char *prefix; int len;){ static char *nextname __PARAM__((const char *prefix, int len), (prefix, len)) __OTORP__(const char *prefix; int len;){
static Hashpos_t *hp; static Hashpos_t *hp;
register Namval_t *np; Namval_t *np;
register char *cp; char *cp;
if(!prefix) if(!prefix)
hp = hashscan(sh.var_tree,0); hp = hashscan(sh.var_tree,0);
else if(hp) else if(hp)

View file

@ -130,7 +130,7 @@ static time_t mailtime;
static char beenhere = 0; static char beenhere = 0;
#ifdef _lib_sigvec #ifdef _lib_sigvec
void clearsigmask __PARAM__((register int sig), (sig)) __OTORP__(register int sig;){ void clearsigmask __PARAM__((int sig), (sig)) __OTORP__(int sig;){
struct sigvec vec; struct sigvec vec;
if(sigvec(sig,NIL(struct sigvec*),&vec)>=0 && vec.sv_mask) if(sigvec(sig,NIL(struct sigvec*),&vec)>=0 && vec.sv_mask)
{ {
@ -141,10 +141,10 @@ static char beenhere = 0;
#endif /* _lib_sigvec */ #endif /* _lib_sigvec */
main __PARAM__((int ac, char *av[]), (ac, av)) __OTORP__(int ac; char *av[];){ main __PARAM__((int ac, char *av[]), (ac, av)) __OTORP__(int ac; char *av[];){
register char *name; char *name;
register int fdin; int fdin;
register Sfio_t *iop; Sfio_t *iop;
register int rshflag; /* set for restricted shell */ int rshflag; /* set for restricted shell */
struct checkpt buff; struct checkpt buff;
int prof; int prof;
char *command; char *command;
@ -322,7 +322,7 @@ main __PARAM__((int ac, char *av[]), (ac, av)) __OTORP__(int ac; char *av[];){
* fdin is the input file descriptor * fdin is the input file descriptor
*/ */
static void exfile __PARAM__((register Sfio_t *iop,register int fno), (iop, fno)) __OTORP__(register Sfio_t *iop;register int fno;){ static void exfile __PARAM__((Sfio_t *iop,int fno), (iop, fno)) __OTORP__(Sfio_t *iop;int fno;){
time_t curtime; time_t curtime;
union anynode *t; union anynode *t;
int maxtry=IOMAXTRY, tdone=0, execflags; int maxtry=IOMAXTRY, tdone=0, execflags;
@ -412,7 +412,7 @@ static void exfile __PARAM__((register Sfio_t *iop,register int fno), (iop, fno)
sh_offstate(SH_INTERACTIVE|SH_ERREXIT|SH_MONITOR); sh_offstate(SH_INTERACTIVE|SH_ERREXIT|SH_MONITOR);
if(sh_isstate(SH_INTERACTIVE) && !tdone) if(sh_isstate(SH_INTERACTIVE) && !tdone)
{ {
register char *mail; char *mail;
#ifdef JOBS #ifdef JOBS
sh_offstate(SH_MONITOR); sh_offstate(SH_MONITOR);
sh_onstate(sh_isoption(SH_MONITOR)); sh_onstate(sh_isoption(SH_MONITOR));
@ -529,8 +529,8 @@ done:
/* prints out messages if files in list have been modified since last call */ /* prints out messages if files in list have been modified since last call */
static void chkmail __PARAM__((char *files), (files)) __OTORP__(char *files;){ static void chkmail __PARAM__((char *files), (files)) __OTORP__(char *files;){
register char *cp,*sp,*qp; char *cp,*sp,*qp;
register char save; char save;
struct argnod *arglist=0; struct argnod *arglist=0;
int offset = staktell(); int offset = staktell();
char *savstak=stakptr(0); char *savstak=stakptr(0);
@ -626,7 +626,7 @@ static void fixargs __PARAM__((char **argv, int mode), (argv, mode)) __OTORP__(c
#else #else
static char *buff; static char *buff;
static int command_len; static int command_len;
register char *cp; char *cp;
int offset=0,size; int offset=0,size;
# ifdef PSTAT # ifdef PSTAT
union pstun un; union pstun un;

View file

@ -230,9 +230,9 @@ void mirror_env __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;)
* Perform parameter assignment for a linked list of parameters * Perform parameter assignment for a linked list of parameters
* <flags> contains attributes for the parameters * <flags> contains attributes for the parameters
*/ */
void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg, flags)) __OTORP__(register struct argnod *arg;register int flags;){ void nv_setlist __PARAM__((struct argnod *arg,int flags), (arg, flags)) __OTORP__(struct argnod *arg;int flags;){
register char *cp; char *cp;
register Namval_t *np; Namval_t *np;
int traceon = (sh_isoption(SH_XTRACE)!=0); int traceon = (sh_isoption(SH_XTRACE)!=0);
if(sh_isoption(SH_ALLEXPORT)) if(sh_isoption(SH_ALLEXPORT))
flags |= NV_EXPORT; flags |= NV_EXPORT;
@ -253,7 +253,7 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
{ {
int flag = (NV_VARNAME|NV_ARRAY|NV_ASSIGN); int flag = (NV_VARNAME|NV_ARRAY|NV_ASSIGN);
struct fornod *fp=(struct fornod*)arg->argchn.ap; struct fornod *fp=(struct fornod*)arg->argchn.ap;
register union anynode *tp=fp->fortre; union anynode *tp=fp->fortre;
char *prefix = sh.prefix; char *prefix = sh.prefix;
cp = fp->fornam; cp = fp->fornam;
error_info.line = fp->fortyp-sh.st.firstline; error_info.line = fp->fortyp-sh.st.firstline;
@ -303,7 +303,7 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
np->nvsize &= ~NV_PARAM; np->nvsize &= ~NV_PARAM;
if(traceon) if(traceon)
{ {
register char *sp=cp; char *sp=cp;
sh_trace(NIL(char**),0); sh_trace(NIL(char**),0);
sfputr(sfstderr,nv_name(np),-1); sfputr(sfstderr,nv_name(np),-1);
if(nv_isattr(np,NV_ARRAY) && (cp=strchr(sp,'['))) if(nv_isattr(np,NV_ARRAY) && (cp=strchr(sp,'[')))
@ -324,8 +324,8 @@ void nv_setlist __PARAM__((register struct argnod *arg,register int flags), (arg
/* /*
* construct a new name from a prefix and base name on the stack * construct a new name from a prefix and base name on the stack
*/ */
static char *newname __PARAM__((register const char *prefix, register const char *name), (prefix, name)) __OTORP__(register const char *prefix; register const char *name;){ static char *newname __PARAM__((const char *prefix, const char *name), (prefix, name)) __OTORP__(const char *prefix; const char *name;){
register int offset = staktell(); int offset = staktell();
stakputs(prefix); stakputs(prefix);
if(*name!='[') if(*name!='[')
stakputc('.'); stakputc('.');
@ -346,11 +346,11 @@ static char *newname __PARAM__((register const char *prefix, register const char
* SH_INIT is only set while initializing the environment * SH_INIT is only set while initializing the environment
*/ */
Namval_t *nv_open __PARAM__((const char *name,Hashtab_t *root,int flags), (name, root, flags)) __OTORP__(const char *name;Hashtab_t *root;int flags;){ Namval_t *nv_open __PARAM__((const char *name,Hashtab_t *root,int flags), (name, root, flags)) __OTORP__(const char *name;Hashtab_t *root;int flags;){
register char *cp = (char*)name; char *cp = (char*)name;
register Namval_t *np=0; Namval_t *np=0;
register int sep = *cp; int sep = *cp;
register char *lastdot = 0; char *lastdot = 0;
register long mode = ((flags&NV_NOADD)?0:NV_ADD); long mode = ((flags&NV_NOADD)?0:NV_ADD);
if(root==sh.alias_tree) if(root==sh.alias_tree)
{ {
while((sep= *(unsigned char*)cp) && (sep!='=') && (sep!='/') && while((sep= *(unsigned char*)cp) && (sep!='=') && (sep!='/') &&
@ -552,12 +552,12 @@ failed:
* If <flags> contains NV_NOFREE, previous value is freed, and <string> * If <flags> contains NV_NOFREE, previous value is freed, and <string>
* becomes value of node and <flags> becomes attributes * becomes value of node and <flags> becomes attributes
*/ */
void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags), (np, string, flags)) __OTORP__(register Namval_t *np; const char *string; int flags;){ void nv_putval __PARAM__((Namval_t *np, const char *string, int flags), (np, string, flags)) __OTORP__(Namval_t *np; const char *string; int flags;){
register const char *sp=string; const char *sp=string;
register union Value *up; union Value *up;
register char *cp; char *cp;
register int size = 0; int size = 0;
register int dot; int dot;
if(!(flags&NV_RDONLY) && nv_isattr (np, NV_RDONLY)) if(!(flags&NV_RDONLY) && nv_isattr (np, NV_RDONLY))
error(ERROR_exit(1),e_readonly, nv_name(np)); error(ERROR_exit(1),e_readonly, nv_name(np));
/* The following could cause the shell to fork if assignment /* The following could cause the shell to fork if assignment
@ -686,7 +686,7 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
rightjust(cp,size,' '); rightjust(cp,size,' ');
else if(nv_isattr(np, NV_LJUST)) else if(nv_isattr(np, NV_LJUST))
{ {
register char *dp; char *dp;
dp = strlen (cp) + cp; dp = strlen (cp) + cp;
*(cp = (cp + size)) = 0; *(cp = (cp + size)) = 0;
for (; dp < cp; *dp++ = ' '); for (; dp < cp; *dp++ = ' ');
@ -722,8 +722,8 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
* will default to a blank. * will default to a blank.
*/ */
static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fill)) __OTORP__(char *str; int size; int fill;){ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fill)) __OTORP__(char *str; int size; int fill;){
register int n; int n;
register char *cp,*sp; char *cp,*sp;
n = strlen(str); n = strlen(str);
/* ignore trailing blanks */ /* ignore trailing blanks */
@ -765,8 +765,8 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
*/ */
static int ja_size __PARAM__((char *str,int size,int type), (str, size, type)) __OTORP__(char *str;int size;int type;){ static int ja_size __PARAM__((char *str,int size,int type), (str, size, type)) __OTORP__(char *str;int size;int type;){
register char *cp = str; char *cp = str;
register int c, n=size; int c, n=size;
int oldn; int oldn;
wchar_t w; wchar_t w;
while(*cp) while(*cp)
@ -774,7 +774,7 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
oldn = n; oldn = n;
if((c=mbtowc(&w,cp,MB_CUR_MAX))>0) if((c=mbtowc(&w,cp,MB_CUR_MAX))>0)
{ {
register int outsize = wcwidth(w); int outsize = wcwidth(w);
/* allow room for excess input bytes */ /* allow room for excess input bytes */
n += (c-outsize); n += (c-outsize);
size -= outsize; size -= outsize;
@ -813,15 +813,15 @@ static void rightjust __PARAM__((char *str, int size, int fill), (str, size, fil
} }
static void ja_restore __PARAM__((void), ()){ static void ja_restore __PARAM__((void), ()){
register char *cp = savechars; char *cp = savechars;
while(*cp) while(*cp)
*savep++ = *cp++; *savep++ = *cp++;
savep = 0; savep = 0;
} }
#endif /* SHOPT_MULTIBYTE */ #endif /* SHOPT_MULTIBYTE */
static char *staknam __PARAM__((register Namval_t *np, char *value), (np, value)) __OTORP__(register Namval_t *np; char *value;){ static char *staknam __PARAM__((Namval_t *np, char *value), (np, value)) __OTORP__(Namval_t *np; char *value;){
register char *p,*q; char *p,*q;
q = stakalloc(strlen(nv_name(np))+(value?strlen(value):0)+2); q = stakalloc(strlen(nv_name(np))+(value?strlen(value):0)+2);
p=strcopy(q,nv_name(np)); p=strcopy(q,nv_name(np));
if(value) if(value)
@ -835,8 +835,8 @@ static char *staknam __PARAM__((register Namval_t *np, char *value), (np, value)
/* /*
* put the name and attribute into value of attributes variable * put the name and attribute into value of attributes variable
*/ */
static void attstore __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ static void attstore __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register int flag = np->nvflag; int flag = np->nvflag;
if(!(flag&NV_EXPORT) || (flag&NV_FUNCT)) if(!(flag&NV_EXPORT) || (flag&NV_FUNCT))
return; return;
flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER); flag &= (NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER);
@ -850,7 +850,7 @@ static void attstore __PARAM__((register Namval_t *np), (np)) __OTORP__(register
} }
static void pushnam __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){ static void pushnam __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register char *value; char *value;
if(nv_isattr(np,NV_IMPORT)) if(nv_isattr(np,NV_IMPORT))
{ {
if(np->nvenv) if(np->nvenv)
@ -867,9 +867,9 @@ static void pushnam __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
*/ */
char **sh_envgen __PARAM__((void), ()){ char **sh_envgen __PARAM__((void), ()){
register char **er; char **er;
register int namec; int namec;
register char *cp; char *cp;
/* L_ARGNOD gets generated automatically as full path name of command */ /* L_ARGNOD gets generated automatically as full path name of command */
nv_offattr(L_ARGNOD,NV_EXPORT); nv_offattr(L_ARGNOD,NV_EXPORT);
attsize = 6; attsize = 6;
@ -893,8 +893,8 @@ static int scanflags;
static int scancount = 0; static int scancount = 0;
static int scanfilter __PARAM__((const char *name, char *arg, __V_ *notused), (name, arg, notused)) __OTORP__(const char *name; char *arg; __V_ *notused;){ static int scanfilter __PARAM__((const char *name, char *arg, __V_ *notused), (name, arg, notused)) __OTORP__(const char *name; char *arg; __V_ *notused;){
register Namval_t *np = (Namval_t*)arg; Namval_t *np = (Namval_t*)arg;
register int k=np->nvflag; int k=np->nvflag;
NOT_USED(name); NOT_USED(name);
NOT_USED(notused); NOT_USED(notused);
if(scanmask?(k&scanmask)==scanflags:(!scanflags || (k&scanflags))) if(scanmask?(k&scanmask)==scanflags:(!scanflags || (k&scanflags)))
@ -935,7 +935,7 @@ int nv_scan __PARAM__((Hashtab_t *root, void (*fn)(Namval_t*), int mask, int fla
* create a new environment scope * create a new environment scope
*/ */
void nv_scope __PARAM__((struct argnod *envlist), (envlist)) __OTORP__(struct argnod *envlist;){ void nv_scope __PARAM__((struct argnod *envlist), (envlist)) __OTORP__(struct argnod *envlist;){
register Hashtab_t *newscope; Hashtab_t *newscope;
newscope = hashalloc(sh.var_tree,HASH_set,HASH_SCOPE|HASH_ALLOCATE,0); newscope = hashalloc(sh.var_tree,HASH_set,HASH_SCOPE|HASH_ALLOCATE,0);
sh.var_tree = newscope; sh.var_tree = newscope;
nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN); nv_setlist(envlist,NV_EXPORT|NV_NOSCOPE|NV_IDENT|NV_ASSIGN);
@ -947,7 +947,7 @@ void nv_scope __PARAM__((struct argnod *envlist), (envlist)) __OTORP__(struct ar
* node, as well as its dope vector, if it is an array. * node, as well as its dope vector, if it is an array.
*/ */
void sh_envnolocal __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ void sh_envnolocal __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(nv_isattr(np,NV_EXPORT|NV_NOFREE)) if(nv_isattr(np,NV_EXPORT|NV_NOFREE))
{ {
if(nv_isattr(np,NV_REF)) if(nv_isattr(np,NV_REF))
@ -980,9 +980,9 @@ void nv_close __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
* by the value of <np>. If <np> denotes an array member, it * by the value of <np>. If <np> denotes an array member, it
* will retain its attributes. * will retain its attributes.
*/ */
void nv_unset __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ void nv_unset __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register union Value *up = &np->nvalue; union Value *up = &np->nvalue;
register Namarr_t *ap; Namarr_t *ap;
if(!forced && nv_isattr (np,NV_RDONLY)) if(!forced && nv_isattr (np,NV_RDONLY))
error(ERROR_exit(1),e_readonly, nv_name(np)); error(ERROR_exit(1),e_readonly, nv_name(np));
if(sh.subshell && !nv_isnull(np)) if(sh.subshell && !nv_isnull(np))
@ -1032,7 +1032,7 @@ void nv_unset __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval
/* /*
* return the node pointer in the highest level scope * return the node pointer in the highest level scope
*/ */
Namval_t *nv_scoped __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ Namval_t *nv_scoped __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
if(hashscope(sh.var_tree)) if(hashscope(sh.var_tree))
return(nv_search((char*)np,sh.var_tree,HASH_BUCKET)); return(nv_search((char*)np,sh.var_tree,HASH_BUCKET));
else else
@ -1050,10 +1050,10 @@ Namval_t *nv_scoped __PARAM__((register Namval_t *np), (np)) __OTORP__(register
* If <np> has no value, 0 is returned. * If <np> has no value, 0 is returned.
*/ */
char *nv_getval __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ char *nv_getval __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register union Value *up= &np->nvalue; union Value *up= &np->nvalue;
register int numeric; int numeric;
register Namarr_t *ap; Namarr_t *ap;
if(!np->nvfun && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF)) if(!np->nvfun && !nv_isattr(np,NV_ARRAY|NV_INTEGER|NV_FUNCT|NV_REF))
goto done; goto done;
if(ap = nv_arrayptr(np)) if(ap = nv_arrayptr(np))
@ -1075,7 +1075,7 @@ char *nv_getval __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namv
} }
if(numeric) if(numeric)
{ {
register long l; long l;
if(!up->cp || nv_isattr (np,NV_CPOINTER)) if(!up->cp || nv_isattr (np,NV_CPOINTER))
return((char*)up->cp); return((char*)up->cp);
else if(nv_isattr (np,NV_DOUBLE)) else if(nv_isattr (np,NV_DOUBLE))
@ -1105,10 +1105,10 @@ done:
return ((char*)up->cp); return ((char*)up->cp);
} }
double nv_getnum __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ double nv_getnum __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register union Value *up; union Value *up;
register double r=0; double r=0;
register char *str; char *str;
if(np->nvfun) if(np->nvfun)
{ {
if(!local) if(!local)
@ -1140,10 +1140,10 @@ double nv_getnum __PARAM__((register Namval_t *np), (np)) __OTORP__(register Nam
* value to conform to <newatts>. The <size> of left and right * value to conform to <newatts>. The <size> of left and right
* justified fields may be given. * justified fields may be given.
*/ */
void nv_newattr __PARAM__((register Namval_t *np, unsigned newatts, int size), (np, newatts, size)) __OTORP__(register Namval_t *np; unsigned newatts; int size;){ void nv_newattr __PARAM__((Namval_t *np, unsigned newatts, int size), (np, newatts, size)) __OTORP__(Namval_t *np; unsigned newatts; int size;){
register char *sp; char *sp;
register char *cp = 0; char *cp = 0;
register unsigned int n; unsigned int n;
Namarr_t *ap = 0; Namarr_t *ap = 0;
int oldsize,oldatts; int oldsize,oldatts;
@ -1219,9 +1219,9 @@ void nv_newattr __PARAM__((register Namval_t *np, unsigned newatts, int size),
#ifndef _NEXT_SOURCE #ifndef _NEXT_SOURCE
static char *oldgetenv __PARAM__((const char *string), (string)) __OTORP__(const static char *oldgetenv __PARAM__((const char *string), (string)) __OTORP__(const
char *string;){ char *string;){
register char c0,c1; char c0,c1;
register const char *cp, *sp; const char *cp, *sp;
register char **av = environ; char **av = environ;
if(!string || (c0= *string)==0) if(!string || (c0= *string)==0)
return(0); return(0);
if((c1= *++string)==0) if((c1= *++string)==0)
@ -1246,7 +1246,7 @@ static char *oldgetenv __PARAM__((const char *string), (string)) __OTORP__(const
* around the problems, others don't. * around the problems, others don't.
*/ */
char *ksh_getenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){ char *ksh_getenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np; Namval_t *np;
if(!sh.var_tree) if(!sh.var_tree)
return(oldgetenv(name)); return(oldgetenv(name));
if((np = nv_search(name,sh.var_tree,0)) && nv_isattr(np,NV_EXPORT)) if((np = nv_search(name,sh.var_tree,0)) && nv_isattr(np,NV_EXPORT))
@ -1266,7 +1266,7 @@ char *ksh_getenv __PARAM__((const char *name), (name)) __OTORP__(const char *nam
* no calls to this routine. - harry phinney 8/15/1994. * no calls to this routine. - harry phinney 8/15/1994.
*/ */
int ksh_putenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){ int ksh_putenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np; Namval_t *np;
if(name) if(name)
{ {
np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN); np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN);
@ -1281,7 +1281,7 @@ int ksh_putenv __PARAM__((const char *name), (name)) __OTORP__(const char *name;
* Override libast setenv() * Override libast setenv()
*/ */
char* setenviron __PARAM__((const char *name), (name)) __OTORP__(const char *name;){ char* setenviron __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register Namval_t *np; Namval_t *np;
if(name) if(name)
{ {
np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN); np = nv_open(name,sh.var_tree,NV_EXPORT|NV_IDENT|NV_ARRAY|NV_ASSIGN);
@ -1298,8 +1298,8 @@ char* setenviron __PARAM__((const char *name), (name)) __OTORP__(const char *nam
* <str1> and <str2> may point to the same place. * <str1> and <str2> may point to the same place.
*/ */
static void ltou __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){ static void ltou __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
register int c; int c;
for(; c= *((unsigned char*)str1); str1++,str2++) for(; c= *((unsigned char*)str1); str1++,str2++)
{ {
if(islower(c)) if(islower(c))
@ -1316,8 +1316,8 @@ static void ltou __PARAM__((register char const *str1,register char *str2), (str
* <str1> and <str2> may point to the same place. * <str1> and <str2> may point to the same place.
*/ */
static void utol __PARAM__((register char const *str1,register char *str2), (str1, str2)) __OTORP__(register char const *str1;register char *str2;){ static void utol __PARAM__((char const *str1,char *str2), (str1, str2)) __OTORP__(char const *str1;char *str2;){
register int c; int c;
for(; c= *((unsigned char*)str1); str1++,str2++) for(; c= *((unsigned char*)str1); str1++,str2++)
{ {
if(isupper(c)) if(isupper(c))
@ -1333,8 +1333,8 @@ static void utol __PARAM__((register char const *str1,register char *str2), (str
* <fp> is null to pop, otherwise, <fp> is pushed onto stack * <fp> is null to pop, otherwise, <fp> is pushed onto stack
* The top of the stack is returned * The top of the stack is returned
*/ */
Namfun_t *nv_stack __PARAM__((register Namval_t *np, register Namfun_t* fp), (np, fp)) __OTORP__(register Namval_t *np; register Namfun_t* fp;){ Namfun_t *nv_stack __PARAM__((Namval_t *np, Namfun_t* fp), (np, fp)) __OTORP__(Namval_t *np; Namfun_t* fp;){
register Namfun_t *lp; Namfun_t *lp;
if(fp) if(fp)
{ {
if((lp=np->nvfun)==fp) if((lp=np->nvfun)==fp)
@ -1364,8 +1364,8 @@ Namfun_t *nv_stack __PARAM__((register Namval_t *np, register Namfun_t* fp), (np
* Special builtins cannot be replaced and return -1 * Special builtins cannot be replaced and return -1
*/ */
int sh_addbuiltin __PARAM__((const char *path, int (*bltin)(int, char*[],__V_*),__V_ *extra), (path, bltin, extra)) __OTORP__(const char *path; int (*bltin)();__V_ *extra;){ int sh_addbuiltin __PARAM__((const char *path, int (*bltin)(int, char*[],__V_*),__V_ *extra), (path, bltin, extra)) __OTORP__(const char *path; int (*bltin)();__V_ *extra;){
register const char *cp, *name = path_basename(path); const char *cp, *name = path_basename(path);
register Namval_t *np, *nq=0; Namval_t *np, *nq=0;
if(name==path && (cp=strchr(name,'.')) && cp!=name) if(name==path && (cp=strchr(name,'.')) && cp!=name)
{ {
int offset = staktell(); int offset = staktell();
@ -1412,8 +1412,8 @@ static char *curbuf;
* with <places> places after the decimal point. The string * with <places> places after the decimal point. The string
* will be stored within static variable <numbuf>. * will be stored within static variable <numbuf>.
*/ */
char *sh_ftos __PARAM__((double val,register int places), (val, places)) __OTORP__(double val;register int places;){ char *sh_ftos __PARAM__((double val,int places), (val, places)) __OTORP__(double val;int places;){
register char *cp, *sp; char *cp, *sp;
int decpt,sign; int decpt,sign;
cp = sffcvt(val,places,&decpt,&sign); cp = sffcvt(val,places,&decpt,&sign);
@ -1440,8 +1440,8 @@ char *sh_ftos __PARAM__((double val,register int places), (val, places)) __OTORP
* convert <val> to a string with <places> significant figures * convert <val> to a string with <places> significant figures
* The result is placed in a local buffer and a pointer returned * The result is placed in a local buffer and a pointer returned
*/ */
char *sh_etos __PARAM__((double val,register int places), (val, places)) __OTORP__(double val;register int places;){ char *sh_etos __PARAM__((double val,int places), (val, places)) __OTORP__(double val;int places;){
register int bufsize = places+8; int bufsize = places+8;
if(!curbuf) if(!curbuf)
curbuf = (char*)malloc(maxbufsize=bufsize); curbuf = (char*)malloc(maxbufsize=bufsize);
else if(bufsize > maxbufsize) else if(bufsize > maxbufsize)
@ -1453,9 +1453,9 @@ char *sh_etos __PARAM__((double val,register int places), (val, places)) __OTORP
/* /*
* call the next getval function in the chain * call the next getval function in the chain
*/ */
char *nv_getv __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; register Namfun_t *nfp;){ char *nv_getv __PARAM__((Namval_t *np, Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; Namfun_t *nfp;){
register Namfun_t *fp; Namfun_t *fp;
register char *cp; char *cp;
if((fp = nfp) != NIL(Namfun_t*) && !local) if((fp = nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next; fp = nfp = nfp->next;
local=0; local=0;
@ -1478,9 +1478,9 @@ char *nv_getv __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTO
/* /*
* call the next getnum function in the chain * call the next getnum function in the chain
*/ */
double nv_getn __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; register Namfun_t *nfp;){ double nv_getn __PARAM__((Namval_t *np, Namfun_t *nfp), (np, nfp)) __OTORP__(Namval_t *np; Namfun_t *nfp;){
register Namfun_t *fp; Namfun_t *fp;
register double d=0; double d=0;
if((fp = nfp) != NIL(Namfun_t*) && !local) if((fp = nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next; fp = nfp = nfp->next;
local=0; local=0;
@ -1507,8 +1507,8 @@ double nv_getn __PARAM__((Namval_t *np, register Namfun_t *nfp), (np, nfp)) __OT
/* /*
* call the next assign function in the chain * call the next assign function in the chain
*/ */
void nv_putv __PARAM__((Namval_t *np, const char *value, int flags, register Namfun_t *nfp), (np, value, flags, nfp)) __OTORP__(Namval_t *np; const char *value; int flags; register Namfun_t *nfp;){ void nv_putv __PARAM__((Namval_t *np, const char *value, int flags, Namfun_t *nfp), (np, value, flags, nfp)) __OTORP__(Namval_t *np; const char *value; int flags; Namfun_t *nfp;){
register Namfun_t *fp; Namfun_t *fp;
if((fp=nfp) != NIL(Namfun_t*) && !local) if((fp=nfp) != NIL(Namfun_t*) && !local)
fp = nfp = nfp->next; fp = nfp = nfp->next;
local=0; local=0;
@ -1542,8 +1542,8 @@ struct vardisc
/* /*
* free discipline if no more discipline functions * free discipline if no more discipline functions
*/ */
static void chktfree __PARAM__((register Namval_t *np, register struct vardisc *vp), (np, vp)) __OTORP__(register Namval_t *np; register struct vardisc *vp;){ static void chktfree __PARAM__((Namval_t *np, struct vardisc *vp), (np, vp)) __OTORP__(Namval_t *np; struct vardisc *vp;){
register int n; int n;
for(n=0; n< sizeof(vp->disc)/sizeof(*vp->disc); n++) for(n=0; n< sizeof(vp->disc)/sizeof(*vp->disc); n++)
{ {
if(vp->disc[n]) if(vp->disc[n])
@ -1562,8 +1562,8 @@ static void chktfree __PARAM__((register Namval_t *np, register struct vardisc *
* This function performs an assignment disc on the given node <np> * This function performs an assignment disc on the given node <np>
*/ */
static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *handle), (np, val, flags, handle)) __OTORP__(Namval_t *np;const char* val;int flags;Namfun_t *handle;){ static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *handle), (np, val, flags, handle)) __OTORP__(Namval_t *np;const char* val;int flags;Namfun_t *handle;){
register struct vardisc *vp = (struct vardisc*)handle; struct vardisc *vp = (struct vardisc*)handle;
register Namval_t *nq, **disc; Namval_t *nq, **disc;
if(val) if(val)
{ {
if(!(nq=vp->disc[ASSIGN])) if(!(nq=vp->disc[ASSIGN]))
@ -1585,7 +1585,7 @@ static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *h
} }
if(val) if(val)
{ {
register char *cp; char *cp;
double d; double d;
if(nv_isnull(SH_VALNOD)) if(nv_isnull(SH_VALNOD))
cp=0; cp=0;
@ -1619,9 +1619,9 @@ static void assign __PARAM__((Namval_t *np,const char* val,int flags,Namfun_t *h
* the lookup on the given node <np> * the lookup on the given node <np>
*/ */
static char* lookup __PARAM__((Namval_t *np, Namfun_t *handle), (np, handle)) __OTORP__(Namval_t *np; Namfun_t *handle;){ static char* lookup __PARAM__((Namval_t *np, Namfun_t *handle), (np, handle)) __OTORP__(Namval_t *np; Namfun_t *handle;){
register struct vardisc *vp = (struct vardisc*)handle; struct vardisc *vp = (struct vardisc*)handle;
register Namval_t *nq; Namval_t *nq;
register char *cp=0; char *cp=0;
if((nq=vp->disc[LOOKUP]) && nq!=BLOCKED) if((nq=vp->disc[LOOKUP]) && nq!=BLOCKED)
{ {
nv_unset(SH_VALNOD); nv_unset(SH_VALNOD);
@ -1641,7 +1641,7 @@ static char* lookup __PARAM__((Namval_t *np, Namfun_t *handle), (np, handle)) __
/* /*
* node creation discipline * node creation discipline
*/ */
Namval_t *nv_create __PARAM__((register Namval_t* np,const char *name,register Namfun_t *fp), (np, name, fp)) __OTORP__(register Namval_t* np;const char *name;register Namfun_t *fp;){ Namval_t *nv_create __PARAM__((Namval_t* np,const char *name,Namfun_t *fp), (np, name, fp)) __OTORP__(Namval_t* np;const char *name;Namfun_t *fp;){
if(np == (Namval_t*)fp) if(np == (Namval_t*)fp)
fp = np->nvfun; fp = np->nvfun;
else if(fp) else if(fp)
@ -1668,14 +1668,14 @@ static const Namdisc_t shdisc =
* If <event> is NULL, then return the event name after <action> * If <event> is NULL, then return the event name after <action>
* If <event> is NULL, and <action> is NULL, return the first event * If <event> is NULL, and <action> is NULL, return the first event
*/ */
char *nv_setdisc __PARAM__((register Namval_t* np,register const char *event,Namval_t *action,register Namfun_t *fp), (np, event, action, fp)) __OTORP__(register Namval_t* np;register const char *event;Namval_t *action;register Namfun_t *fp;){ char *nv_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;){
register struct vardisc *vp = (struct vardisc*)np->nvfun; struct vardisc *vp = (struct vardisc*)np->nvfun;
register int type; int type;
if(np == (Namval_t*)fp) if(np == (Namval_t*)fp)
{ {
static const char *discnames[] = { "get", "set", "unset", 0 }; static const char *discnames[] = { "get", "set", "unset", 0 };
register const char *name; const char *name;
register int getname=0; int getname=0;
/* top level call, check for get/set */ /* top level call, check for get/set */
if(!event) if(!event)
{ {
@ -1744,10 +1744,10 @@ char *nv_setdisc __PARAM__((register Namval_t* np,register const char *event,Nam
/* /*
* Create a reference node from <np> * Create a reference node from <np>
*/ */
void nv_setref __PARAM__((register Namval_t *np), (np)) __OTORP__(register Namval_t *np;){ void nv_setref __PARAM__((Namval_t *np), (np)) __OTORP__(Namval_t *np;){
register Namval_t *nq, *nr; Namval_t *nq, *nr;
register char *cp; char *cp;
register int flags = NV_ARRAY|NV_VARNAME|NV_REF; int flags = NV_ARRAY|NV_VARNAME|NV_REF;
Hashtab_t *hp=sh.var_tree; Hashtab_t *hp=sh.var_tree;
if(nv_isattr(np,NV_REF)) if(nv_isattr(np,NV_REF))
return; return;

View file

@ -151,9 +151,9 @@ static struct argnod *label_last;
* type=='V' for variable assignment lists * type=='V' for variable assignment lists
* Otherwise type is determined by the command */ * Otherwise type is determined by the command */
static void writedefs __PARAM__((struct argnod *arglist, int line, int type, struct argnod *cmd), (arglist, line, type, cmd)) __OTORP__(struct argnod *arglist; int line; int type; struct argnod *cmd;){ static void writedefs __PARAM__((struct argnod *arglist, int line, int type, struct argnod *cmd), (arglist, line, type, cmd)) __OTORP__(struct argnod *arglist; int line; int type; struct argnod *cmd;){
register struct argnod *argp = arglist; struct argnod *argp = arglist;
register char *cp; char *cp;
register int n; int n;
int width=0; int width=0;
static char atbuff[20]; static char atbuff[20];
static char justify[2]; static char justify[2];
@ -213,7 +213,7 @@ static void writedefs __PARAM__((struct argnod *arglist, int line, int type, str
* Make a parent node for fork() or io-redirection * Make a parent node for fork() or io-redirection
*/ */
static union anynode *makeparent __PARAM__((int flag, union anynode *child), (flag, child)) __OTORP__(int flag; union anynode *child;){ static union anynode *makeparent __PARAM__((int flag, union anynode *child), (flag, child)) __OTORP__(int flag; union anynode *child;){
register union anynode *par = getnode(forknod); union anynode *par = getnode(forknod);
par->fork.forktyp = flag; par->fork.forktyp = flag;
par->fork.forktre = child; par->fork.forktre = child;
par->fork.forkio = 0; par->fork.forkio = 0;
@ -225,7 +225,7 @@ static union anynode *makeparent __PARAM__((int flag, union anynode *child), (fl
* Make a node corresponding to a command list * Make a node corresponding to a command list
*/ */
static union anynode *makelist __PARAM__((int type, union anynode *l, union anynode *r), (type, l, r)) __OTORP__(int type; union anynode *l; union anynode *r;){ static union anynode *makelist __PARAM__((int type, union anynode *l, union anynode *r), (type, l, r)) __OTORP__(int type; union anynode *l; union anynode *r;){
register union anynode *t; union anynode *t;
if(!l || !r) if(!l || !r)
sh_syntax(); sh_syntax();
else else
@ -247,7 +247,7 @@ static union anynode *makelist __PARAM__((int type, union anynode *l, union anyn
*/ */
union anynode *sh_parse __PARAM__((Sfio_t *iop, int flag), (iop, flag)) __OTORP__(Sfio_t *iop; int flag;){ union anynode *sh_parse __PARAM__((Sfio_t *iop, int flag), (iop, flag)) __OTORP__(Sfio_t *iop; int flag;){
register union anynode *t; union anynode *t;
Fcin_t sav_input; Fcin_t sav_input;
int sav_prompt = sh.nextprompt; int sav_prompt = sh.nextprompt;
if(sh.binscript && sffileno(iop)==sh.infd) if(sh.binscript && sffileno(iop)==sh.infd)
@ -305,7 +305,7 @@ union anynode *sh_parse __PARAM__((Sfio_t *iop, int flag), (iop, flag)) __OTORP_
* the parse tree * the parse tree
*/ */
union anynode *sh_dolparen __PARAM__((void), ()){ union anynode *sh_dolparen __PARAM__((void), ()){
register union anynode *t=0; union anynode *t=0;
Sfio_t *sp = fcfile(); Sfio_t *sp = fcfile();
int line = sh.inlineno; int line = sh.inlineno;
sh.inlineno = error_info.line+sh.st.firstline; sh.inlineno = error_info.line+sh.st.firstline;
@ -329,7 +329,7 @@ union anynode *sh_dolparen __PARAM__((void), ()){
* This code handles the case where string has been converted * This code handles the case where string has been converted
* to a file by an alias setup * to a file by an alias setup
*/ */
register int c; int c;
char *cp; char *cp;
if(fcgetc(c) > 0) if(fcgetc(c) > 0)
fcseek(-1); fcseek(-1);
@ -358,8 +358,8 @@ void sh_freeup __PARAM__((void), ()){
* stack is freed when reference count is zero * stack is freed when reference count is zero
*/ */
void sh_funstaks __PARAM__((register struct slnod *slp,int flag), (slp, flag)) __OTORP__(register struct slnod *slp;int flag;){ void sh_funstaks __PARAM__((struct slnod *slp,int flag), (slp, flag)) __OTORP__(struct slnod *slp;int flag;){
register struct slnod *slpold; struct slnod *slpold;
while(slpold=slp) while(slpold=slp)
{ {
if(slp->slchild) if(slp->slchild)
@ -379,9 +379,9 @@ void sh_funstaks __PARAM__((register struct slnod *slp,int flag), (slp, flag)) _
* list [ ; cmd ] * list [ ; cmd ]
*/ */
static union anynode *sh_cmd __PARAM__((register int sym, int flag), (sym, flag)) __OTORP__(register int sym; int flag;){ static union anynode *sh_cmd __PARAM__((int sym, int flag), (sym, flag)) __OTORP__(int sym; int flag;){
register union anynode *left, *right; union anynode *left, *right;
register int type = FINT|FAMP; int type = FINT|FAMP;
if(sym==NL) if(sym==NL)
shlex.lasttok = 0; shlex.lasttok = 0;
left = list(flag); left = list(flag);
@ -432,9 +432,9 @@ static union anynode *sh_cmd __PARAM__((register int sym, int flag), (sym, flag)
* list || term * list || term
* unfortunately, these are equal precedence * unfortunately, these are equal precedence
*/ */
static union anynode *list __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){ static union anynode *list __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register union anynode *t = term(flag); union anynode *t = term(flag);
register int token; int token;
while(t && ((token=shlex.token)==ANDFSYM || token==ORFSYM)) while(t && ((token=shlex.token)==ANDFSYM || token==ORFSYM))
t = makelist((token==ANDFSYM?TAND:TORF), t, term(SH_NL)); t = makelist((token==ANDFSYM?TAND:TORF), t, term(SH_NL));
return(t); return(t);
@ -445,9 +445,9 @@ static union anynode *list __PARAM__((register int flag), (flag)) __OTORP__(regi
* item * item
* item | term * item | term
*/ */
static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(register int flag;){ static union anynode *term __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register union anynode *t; union anynode *t;
register int token; int token;
if(flag&SH_NL) if(flag&SH_NL)
token = skipnl(); token = skipnl();
else else
@ -463,7 +463,7 @@ static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(regi
} }
else if((t=item(SH_NL|SH_EMPTY)) && shlex.token=='|') else if((t=item(SH_NL|SH_EMPTY)) && shlex.token=='|')
{ {
register union anynode *tt; union anynode *tt;
t = makeparent(TFORK|FPOU,t); t = makeparent(TFORK|FPOU,t);
if(tt=term(SH_NL)) if(tt=term(SH_NL))
{ {
@ -489,9 +489,9 @@ static union anynode *term __PARAM__((register int flag), (flag)) __OTORP__(regi
/* /*
* case statement * case statement
*/ */
static struct regnod* syncase __PARAM__((register int esym), (esym)) __OTORP__(register int esym;){ static struct regnod* syncase __PARAM__((int esym), (esym)) __OTORP__(int esym;){
register int tok = skipnl(); int tok = skipnl();
register struct regnod *r; struct regnod *r;
if(tok==esym) if(tok==esym)
return(NIL(struct regnod*)); return(NIL(struct regnod*));
r = (struct regnod*)stakalloc(sizeof(struct regnod)); r = (struct regnod*)stakalloc(sizeof(struct regnod));
@ -538,11 +538,11 @@ static struct regnod* syncase __PARAM__((register int esym), (esym)) __OTORP__(r
* Otherise a list containing an arithmetic command and a while * Otherise a list containing an arithmetic command and a while
* is returned. * is returned.
*/ */
static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __OTORP__(register union anynode *tf;){ static union anynode *arithfor __PARAM__((union anynode *tf), (tf)) __OTORP__(union anynode *tf;){
register union anynode *t, *tw = tf; union anynode *t, *tw = tf;
register int offset; int offset;
register struct argnod *argp; struct argnod *argp;
register int n; int n;
int argflag = shlex.arg->argflag; int argflag = shlex.arg->argflag;
/* save current input */ /* save current input */
Fcin_t sav_input; Fcin_t sav_input;
@ -551,7 +551,7 @@ static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __O
/* split ((...)) into three expressions */ /* split ((...)) into three expressions */
for(n=0; ; n++) for(n=0; ; n++)
{ {
register int c; int c;
argp = (struct argnod*)stakseek(ARGVAL); argp = (struct argnod*)stakseek(ARGVAL);
argp->argnxt.ap = 0; argp->argnxt.ap = 0;
argp->argflag = argflag; argp->argflag = argflag;
@ -617,8 +617,8 @@ static union anynode *arithfor __PARAM__((register union anynode *tf), (tf)) __O
} }
static union anynode *funct __PARAM__((void), ()){ static union anynode *funct __PARAM__((void), ()){
register union anynode *t; union anynode *t;
register int flag; int flag;
struct slnod *volatile slp=0; struct slnod *volatile slp=0;
Stak_t *savstak; Stak_t *savstak;
#ifdef SHOPT_KIA #ifdef SHOPT_KIA
@ -735,10 +735,10 @@ static union anynode *funct __PARAM__((void), ()){
/* /*
* Compound assignment * Compound assignment
*/ */
static struct argnod *assign __PARAM__((register struct argnod *ap), (ap)) __OTORP__(register struct argnod *ap;){ static struct argnod *assign __PARAM__((struct argnod *ap), (ap)) __OTORP__(struct argnod *ap;){
register int n; int n;
register union anynode *t ,**tp; union anynode *t ,**tp;
register struct comnod *ac; struct comnod *ac;
int array=0; int array=0;
Namval_t *np; Namval_t *np;
n = strlen(ap->argval)-1; n = strlen(ap->argval)-1;
@ -808,9 +808,9 @@ static struct argnod *assign __PARAM__((register struct argnod *ap), (ap)) __OTO
*/ */
static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){ static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register union anynode *t; union anynode *t;
register struct ionod *io; struct ionod *io;
register int tok = (shlex.token&0xff); int tok = (shlex.token&0xff);
int savwdval = shlex.lasttok; int savwdval = shlex.lasttok;
int savline = shlex.lastline; int savline = shlex.lastline;
if(!(flag&SH_NOIO) && (tok=='<' || tok=='>')) if(!(flag&SH_NOIO) && (tok=='<' || tok=='>'))
@ -862,7 +862,7 @@ static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
/* if statement */ /* if statement */
case IFSYM: case IFSYM:
{ {
register union anynode *tt; union anynode *tt;
t = getnode(ifnod); t = getnode(ifnod);
t->if_.iftyp=TIF; t->if_.iftyp=TIF;
t->if_.iftre=sh_cmd(THENSYM,SH_NL); t->if_.iftre=sh_cmd(THENSYM,SH_NL);
@ -943,7 +943,7 @@ static union anynode *item __PARAM__((int flag), (flag)) __OTORP__(int flag;){
case LABLSYM: case LABLSYM:
{ {
register struct argnod *argp = label_list; struct argnod *argp = label_list;
while(argp) while(argp)
{ {
if(strcmp(argp->argval,shlex.arg->argval)==0) if(strcmp(argp->argval,shlex.arg->argval)==0)
@ -1001,9 +1001,9 @@ done:
* This is for a simple command, for list, or compound assignment * This is for a simple command, for list, or compound assignment
*/ */
static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io)) __OTORP__(int flag; struct ionod *io;){ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io)) __OTORP__(int flag; struct ionod *io;){
register struct comnod *t; struct comnod *t;
register struct argnod *argp; struct argnod *argp;
register int tok; int tok;
struct argnod **argtail; struct argnod **argtail;
struct argnod **settail; struct argnod **settail;
int keywd=1; int keywd=1;
@ -1137,7 +1137,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
#ifdef SHOPT_KIA #ifdef SHOPT_KIA
if(shlex.kiafile) if(shlex.kiafile)
{ {
register Namval_t *np=(Namval_t*)t->comnamp; Namval_t *np=(Namval_t*)t->comnamp;
int line = t->comline; int line = t->comline;
argp = t->comarg; argp = t->comarg;
if(argp) if(argp)
@ -1171,7 +1171,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
Namval_t *np=(Namval_t*)t->comnamp; Namval_t *np=(Namval_t*)t->comnamp;
if((np==SYSBREAK || np==SYSCONT) && (argp->argflag&ARG_RAW) && !isdigit(*argp->argval)) if((np==SYSBREAK || np==SYSCONT) && (argp->argflag&ARG_RAW) && !isdigit(*argp->argval))
{ {
register char *cp = argp->argval; char *cp = argp->argval;
/* convert break/continue labels to numbers */ /* convert break/continue labels to numbers */
tok = 0; tok = 0;
for(argp=label_list;argp!=label_last;argp=argp->argnxt.ap) for(argp=label_list;argp!=label_last;argp=argp->argnxt.ap)
@ -1214,7 +1214,7 @@ static union anynode *simple __PARAM__((int flag, struct ionod *io), (flag, io))
* skip past newlines but issue prompt if interactive * skip past newlines but issue prompt if interactive
*/ */
static int skipnl __PARAM__((void), ()){ static int skipnl __PARAM__((void), ()){
register int token; int token;
while((token=sh_lex())==NL); while((token=sh_lex())==NL);
if(token==';') if(token==';')
sh_syntax(); sh_syntax();
@ -1226,8 +1226,8 @@ static int skipnl __PARAM__((void), ()){
* if flag is set then an alias can be in the next word * if flag is set then an alias can be in the next word
*/ */
static struct ionod *inout __PARAM__((struct ionod *lastio,int flag), (lastio, flag)) __OTORP__(struct ionod *lastio;int flag;){ static struct ionod *inout __PARAM__((struct ionod *lastio,int flag), (lastio, flag)) __OTORP__(struct ionod *lastio;int flag;){
register int iof = shlex.digits, token=shlex.token; int iof = shlex.digits, token=shlex.token;
register struct ionod *iop; struct ionod *iop;
switch(token&0xff) switch(token&0xff)
{ {
case '<': case '<':
@ -1299,10 +1299,10 @@ static struct ionod *inout __PARAM__((struct ionod *lastio,int flag), (lastio, f
*/ */
static struct argnod *qscan __PARAM__((struct comnod *ac,int argn), (ac, argn)) __OTORP__(struct comnod *ac;int argn;){ static struct argnod *qscan __PARAM__((struct comnod *ac,int argn), (ac, argn)) __OTORP__(struct comnod *ac;int argn;){
register char **cp; char **cp;
register struct argnod *ap; struct argnod *ap;
register struct dolnod* dp; struct dolnod* dp;
register int special=0; int special=0;
/* special hack for test -t compatibility */ /* special hack for test -t compatibility */
if((Namval_t*)ac->comnamp==SYSTEST) if((Namval_t*)ac->comnamp==SYSTEST)
special = 2; special = 2;
@ -1356,30 +1356,30 @@ static struct argnod *qscan __PARAM__((struct comnod *ac,int argn), (ac, argn))
} }
static union anynode *test_expr __PARAM__((int sym), (sym)) __OTORP__(int sym;){ static union anynode *test_expr __PARAM__((int sym), (sym)) __OTORP__(int sym;){
register union anynode *t = test_or(); union anynode *t = test_or();
if(shlex.token!=sym) if(shlex.token!=sym)
sh_syntax(); sh_syntax();
return(t); return(t);
} }
static union anynode *test_or __PARAM__((void), ()){ static union anynode *test_or __PARAM__((void), ()){
register union anynode *t = test_and(); union anynode *t = test_and();
while(shlex.token==ORFSYM) while(shlex.token==ORFSYM)
t = makelist(TORF|TTEST,t,test_and()); t = makelist(TORF|TTEST,t,test_and());
return(t); return(t);
} }
static union anynode *test_and __PARAM__((void), ()){ static union anynode *test_and __PARAM__((void), ()){
register union anynode *t = test_primary(); union anynode *t = test_primary();
while(shlex.token==ANDFSYM) while(shlex.token==ANDFSYM)
t = makelist(TAND|TTEST,t,test_primary()); t = makelist(TAND|TTEST,t,test_primary());
return(t); return(t);
} }
static union anynode *test_primary __PARAM__((void), ()){ static union anynode *test_primary __PARAM__((void), ()){
register struct argnod *arg; struct argnod *arg;
register union anynode *t; union anynode *t;
register int num,token; int num,token;
token = skipnl(); token = skipnl();
num = shlex.digits; num = shlex.digits;
switch(token) switch(token)
@ -1462,8 +1462,8 @@ static union anynode *test_primary __PARAM__((void), ()){
#ifdef SHOPT_KIA #ifdef SHOPT_KIA
int kiaclose __PARAM__((void), ()){ int kiaclose __PARAM__((void), ()){
register off_t off1,off2; off_t off1,off2;
register int n; int n;
if(shlex.kiafile) if(shlex.kiafile)
{ {
sfseek(shlex.kiafile,shlex.kiabegin,SEEK_SET); sfseek(shlex.kiafile,shlex.kiabegin,SEEK_SET);

View file

@ -130,9 +130,9 @@ static int exec_err;
* Sets the PWD variable to this value * Sets the PWD variable to this value
*/ */
char *path_pwd __PARAM__((int flag), (flag)) __OTORP__(int flag;){ char *path_pwd __PARAM__((int flag), (flag)) __OTORP__(int flag;){
register char *cp; char *cp;
register char *dfault = (char*)e_dot; char *dfault = (char*)e_dot;
register int count = 0; int count = 0;
if(sh.pwd) if(sh.pwd)
return((char*)sh.pwd); return((char*)sh.pwd);
while(1) while(1)
@ -189,8 +189,8 @@ skip:
*/ */
char *path_get __PARAM__((const char *name), (name)) __OTORP__(const char *name;){ char *path_get __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register char *path=0; char *path=0;
register char *sp = sh.lastpath; char *sp = sh.lastpath;
static int bin_is_usrbin = -1; static int bin_is_usrbin = -1;
if(strchr(name,'/')) if(strchr(name,'/'))
return(""); return("");
@ -220,9 +220,9 @@ char *path_get __PARAM__((const char *name), (name)) __OTORP__(const char *name;
* convert each /usr/bin to /bin and eliminate multiple /bin from <path> * convert each /usr/bin to /bin and eliminate multiple /bin from <path>
* The resulting path is placed on the stack * The resulting path is placed on the stack
*/ */
static char *path_to_stak __PARAM__((register const char *path), (path)) __OTORP__(register const char *path;){ static char *path_to_stak __PARAM__((const char *path), (path)) __OTORP__(const char *path;){
register const char *cp=path, *base; const char *cp=path, *base;
register int n, nbin=0; int n, nbin=0;
stakseek(0); stakseek(0);
while(*cp) while(*cp)
{ {
@ -250,7 +250,7 @@ static char *path_to_stak __PARAM__((register const char *path), (path)) __OTORP
} }
int path_open __PARAM__((const char *name,char *path), (name, path)) __OTORP__(const char *name;char *path;){ int path_open __PARAM__((const char *name,char *path), (name, path)) __OTORP__(const char *name;char *path;){
register int fd; int fd;
struct stat statb; struct stat statb;
if(strchr(name,'/')) if(strchr(name,'/'))
{ {
@ -292,9 +292,9 @@ int path_open __PARAM__((const char *name,char *path), (name, path)) __OTORP__(c
*/ */
static int path_inpath __PARAM__((const char *path, const char *fpath), (path, fpath)) __OTORP__(const char *path; const char *fpath;){ static int path_inpath __PARAM__((const char *path, const char *fpath), (path, fpath)) __OTORP__(const char *path; const char *fpath;){
register const char *dp = fpath; const char *dp = fpath;
register const char *sp = path; const char *sp = path;
register int c, match=1; int c, match=1;
if(!dp || !sp || *sp==0) if(!dp || !sp || *sp==0)
return(0); return(0);
if(*sp==':' || (*sp=='.' && ((c=sp[1])==0 || c==':'))) if(*sp==':' || (*sp=='.' && ((c=sp[1])==0 || c==':')))
@ -323,14 +323,14 @@ static int path_inpath __PARAM__((const char *path, const char *fpath), (path, f
* set tracked alias node <np> to value <sp> * set tracked alias node <np> to value <sp>
*/ */
void path_alias __PARAM__((register Namval_t *np,register char *sp), (np, sp)) __OTORP__(register Namval_t *np;register char *sp;){ void path_alias __PARAM__((Namval_t *np,char *sp), (np, sp)) __OTORP__(Namval_t *np;char *sp;){
if(!sp) if(!sp)
nv_unset(np); nv_unset(np);
else else
{ {
register const char *vp = np->nvalue.cp; const char *vp = np->nvalue.cp;
register int n = 1; int n = 1;
register int nofree = nv_isattr(np,NV_NOFREE); int nofree = nv_isattr(np,NV_NOFREE);
nv_offattr(np,NV_NOPRINT); nv_offattr(np,NV_NOPRINT);
if(!vp || (n=strcmp(sp,vp))!=0) if(!vp || (n=strcmp(sp,vp))!=0)
{ {
@ -350,8 +350,8 @@ void path_alias __PARAM__((register Namval_t *np,register char *sp), (np, sp)) _
* given a pathname return the base name * given a pathname return the base name
*/ */
char *path_basename __PARAM__((register const char *name), (name)) __OTORP__(register const char *name;){ char *path_basename __PARAM__((const char *name), (name)) __OTORP__(const char *name;){
register const char *start = name; const char *start = name;
while (*name) while (*name)
if ((*name++ == '/') && *name) /* don't trim trailing / */ if ((*name++ == '/') && *name) /* don't trim trailing / */
start = name; start = name;
@ -379,9 +379,9 @@ static void funload __PARAM__((int fno, const char *name), (fno, name)) __OTORP_
* If endpath!=NULL, Path search ends when path matches endpath. * If endpath!=NULL, Path search ends when path matches endpath.
*/ */
int path_search __PARAM__((register const char *name,const char *endpath, int flag), (name, endpath, flag)) __OTORP__(register const char *name;const char *endpath; int flag;){ int path_search __PARAM__((const char *name,const char *endpath, int flag), (name, endpath, flag)) __OTORP__(const char *name;const char *endpath; int flag;){
register Namval_t *np; Namval_t *np;
register int fno; int fno;
if(flag) if(flag)
{ {
/* if not found on pruned path, rehash and try again */ /* if not found on pruned path, rehash and try again */
@ -393,7 +393,7 @@ int path_search __PARAM__((register const char *name,const char *endpath, int fl
} }
if(flag==0 || !sh.lastpath) if(flag==0 || !sh.lastpath)
{ {
register char *path=0; char *path=0;
if(strmatch(name,e_alphanum)) if(strmatch(name,e_alphanum))
path = nv_getval(nv_scoped(FPATHNOD)); path = nv_getval(nv_scoped(FPATHNOD));
if(path && (fno=path_open(name,path))>=0) if(path && (fno=path_open(name,path))>=0)
@ -425,11 +425,11 @@ int path_search __PARAM__((register const char *name,const char *endpath, int fl
* end search of path matches endpath without checking execute permission * end search of path matches endpath without checking execute permission
*/ */
char *path_absolute __PARAM__((register const char *name, const char *endpath), (name, endpath)) __OTORP__(register const char *name; const char *endpath;){ char *path_absolute __PARAM__((const char *name, const char *endpath), (name, endpath)) __OTORP__(const char *name; const char *endpath;){
register int f; int f;
register char *path; char *path;
register const char *fpath=0; const char *fpath=0;
register int isfun; int isfun;
#ifdef SHOPT_VPIX #ifdef SHOPT_VPIX
char **suffix = 0; char **suffix = 0;
char *top; char *top;
@ -501,9 +501,9 @@ char *path_absolute __PARAM__((register const char *name, const char *endpath),
# endif /*S_EXEC */ # endif /*S_EXEC */
#endif /* S_IXUSR */ #endif /* S_IXUSR */
static int canexecute __PARAM__((register char *path, int isfun), (path, isfun)) __OTORP__(register char *path; int isfun;){ static int canexecute __PARAM__((char *path, int isfun), (path, isfun)) __OTORP__(char *path; int isfun;){
struct stat statb; struct stat statb;
register int fd=0; int fd=0;
path = path_relative(path); path = path_relative(path);
if(isfun) if(isfun)
{ {
@ -542,9 +542,9 @@ err:
* Return path relative to present working directory * Return path relative to present working directory
*/ */
char *path_relative __PARAM__((register const char* file), (file)) __OTORP__(register const char* file;){ char *path_relative __PARAM__((const char* file), (file)) __OTORP__(const char* file;){
register const char *pwd; const char *pwd;
register const char *fp = file; const char *fp = file;
/* can't relpath when sh.pwd not set */ /* can't relpath when sh.pwd not set */
if(!(pwd=sh.pwd)) if(!(pwd=sh.pwd))
return((char*)fp); return((char*)fp);
@ -564,10 +564,10 @@ char *path_relative __PARAM__((register const char* file), (file)) __OTORP__(reg
return((char*)file); return((char*)file);
} }
char *path_join __PARAM__((register char *path,const char *name), (path, name)) __OTORP__(register char *path;const char *name;){ char *path_join __PARAM__((char *path,const char *name), (path, name)) __OTORP__(char *path;const char *name;){
/* leaves result on top of stack */ /* leaves result on top of stack */
register char *scanp = path; char *scanp = path;
register int c; int c;
stakseek(PATH_OFFSET); stakseek(PATH_OFFSET);
if(*scanp=='.') if(*scanp=='.')
{ {
@ -602,8 +602,8 @@ char *path_join __PARAM__((register char *path,const char *name), (path, name))
} }
void path_exec __PARAM__((register const char *arg0,register char *argv[],struct argnod *local), (arg0, argv, local)) __OTORP__(register const char *arg0;register char *argv[];struct argnod *local;){ void path_exec __PARAM__((const char *arg0,char *argv[],struct argnod *local), (arg0, argv, local)) __OTORP__(const char *arg0;char *argv[];struct argnod *local;){
register const char *path = ""; const char *path = "";
nv_setlist(local,NV_EXPORT|NV_IDENT|NV_ASSIGN); nv_setlist(local,NV_EXPORT|NV_IDENT|NV_ASSIGN);
xecenv=sh_envgen(); xecenv=sh_envgen();
if(strchr(arg0,'/')) if(strchr(arg0,'/'))
@ -632,9 +632,9 @@ void path_exec __PARAM__((register const char *arg0,register char *argv[],struct
* This routine constructs a short path consisting of all * This routine constructs a short path consisting of all
* Relative directories up to the directory of fullname <name> * Relative directories up to the directory of fullname <name>
*/ */
static char *prune __PARAM__((register char *path,const char *fullname), (path, fullname)) __OTORP__(register char *path;const char *fullname;){ static char *prune __PARAM__((char *path,const char *fullname), (path, fullname)) __OTORP__(char *path;const char *fullname;){
register char *p = path; char *p = path;
register char *s; char *s;
int n = 1; int n = 1;
const char *base; const char *base;
char *inpath = path; char *inpath = path;
@ -675,8 +675,8 @@ static char *prune __PARAM__((register char *path,const char *fullname), (path,
} }
static char *execs __PARAM__((const char *ap,const char *arg0,register char **argv), (ap, arg0, argv)) __OTORP__(const char *ap;const char *arg0;register char **argv;){ static char *execs __PARAM__((const char *ap,const char *arg0,char **argv), (ap, arg0, argv)) __OTORP__(const char *ap;const char *arg0;char **argv;){
register char *path, *prefix; char *path, *prefix;
sh_sigcheck(); sh_sigcheck();
prefix=path_join((char*)ap,arg0); prefix=path_join((char*)ap,arg0);
xecenv[0] = stakptr(0); xecenv[0] = stakptr(0);
@ -779,8 +779,8 @@ static char *execs __PARAM__((const char *ap,const char *arg0,register char **ar
*/ */
static void exscript __PARAM__((register char *path,register char *argv[]), (path, argv)) __OTORP__(register char *path;register char *argv[];){ static void exscript __PARAM__((char *path,char *argv[]), (path, argv)) __OTORP__(char *path;char *argv[];){
register Sfio_t *sp; Sfio_t *sp;
sh.comdiv=0; sh.comdiv=0;
sh.bckpid = 0; sh.bckpid = 0;
sh.st.ioset=0; sh.st.ioset=0;
@ -801,8 +801,8 @@ static void exscript __PARAM__((register char *path,register char *argv[]), (pat
/* check if file cannot open for read or script is setuid/setgid */ /* check if file cannot open for read or script is setuid/setgid */
{ {
static char name[] = "/tmp/euidXXXXXXXXXX"; static char name[] = "/tmp/euidXXXXXXXXXX";
register int n; int n;
register uid_t euserid; uid_t euserid;
char *savet; char *savet;
struct stat statb; struct stat statb;
if((n=sh_open(path,O_RDONLY,0)) >= 0) if((n=sh_open(path,O_RDONLY,0)) >= 0)
@ -933,8 +933,8 @@ static void exscript __PARAM__((register char *path,register char *argv[]), (pat
* Produce a pseudo-floating point representation * Produce a pseudo-floating point representation
* with 3 bits base-8 exponent, 13 bits fraction. * with 3 bits base-8 exponent, 13 bits fraction.
*/ */
static int compress __PARAM__((register time_t t), (t)) __OTORP__(register time_t t;){ static int compress __PARAM__((time_t t), (t)) __OTORP__(time_t t;){
register int exp = 0, rund = 0; int exp = 0, rund = 0;
while (t >= 8192) while (t >= 8192)
{ {

View file

@ -141,7 +141,7 @@ static double seterror __PROTO__((const char[])); /* set error message string *
*/ */
double strval __PARAM__((const char *s, char** end, double(*conv)(const char**,struct lval*,int,double)), (s, end, conv)) __OTORP__(const char *s; char** end; double(*conv)();){ double strval __PARAM__((const char *s, char** end, double(*conv)(const char**,struct lval*,int,double)), (s, end, conv)) __OTORP__(const char *s; char** end; double(*conv)();){
register double n; double n;
pushchr(s); pushchr(s);
cur.isfloat = 0; cur.isfloat = 0;
@ -167,9 +167,9 @@ double strval __PARAM__((const char *s, char** end, double(*conv)(const char**,s
* evaluate a subexpression with precedence * evaluate a subexpression with precedence
*/ */
static double expr __PARAM__((register int precedence), (precedence)) __OTORP__(register int precedence;){ static double expr __PARAM__((int precedence), (precedence)) __OTORP__(int precedence;){
register int c, op; int c, op;
register double n, x; double n, x;
int wasop, incr=0; int wasop, incr=0;
struct lval lvalue, assignop; struct lval lvalue, assignop;
const char *pos; const char *pos;

View file

@ -106,10 +106,10 @@
* This is only used for small tables and is used to save non-sharable memory * This is only used for small tables and is used to save non-sharable memory
*/ */
int sh_locate __PARAM__((register const char *sp,const Shtable_t *table,int size), (sp, table, size)) __OTORP__(register const char *sp;const Shtable_t *table;int size;){ int sh_locate __PARAM__((const char *sp,const Shtable_t *table,int size), (sp, table, size)) __OTORP__(const char *sp;const Shtable_t *table;int size;){
register int first; int first;
register const Shtable_t *tp; const Shtable_t *tp;
register int c; int c;
if(sp==0 || (first= *sp)==0) if(sp==0 || (first= *sp)==0)
return(0); return(0);
tp=table; tp=table;
@ -127,8 +127,8 @@ int sh_locate __PARAM__((register const char *sp,const Shtable_t *table,int size
* The new string is put on top of the stack * The new string is put on top of the stack
*/ */
char *sh_substitute __PARAM__((const char *string,const char *oldsp,char *newsp), (string, oldsp, newsp)) __OTORP__(const char *string;const char *oldsp;char *newsp;){ char *sh_substitute __PARAM__((const char *string,const char *oldsp,char *newsp), (string, oldsp, newsp)) __OTORP__(const char *string;const char *oldsp;char *newsp;){
register const char *sp = string; const char *sp = string;
register const char *cp; const char *cp;
const char *savesp = 0; const char *savesp = 0;
stakseek(0); stakseek(0);
if(*sp==0) if(*sp==0)
@ -182,9 +182,9 @@ found:
* Remove escape characters from characters in <sp> and eliminate quoted nulls. * Remove escape characters from characters in <sp> and eliminate quoted nulls.
*/ */
void sh_trim __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){ void sh_trim __PARAM__((char *sp), (sp)) __OTORP__(char *sp;){
register char *dp; char *dp;
register int c; int c;
if(sp) if(sp)
{ {
dp = sp; dp = sp;
@ -204,8 +204,8 @@ void sh_trim __PARAM__((register char *sp), (sp)) __OTORP__(register char *sp;){
* puts null terminated result on stack, but doesn't freeze it * puts null terminated result on stack, but doesn't freeze it
*/ */
char *sh_fmtq __PARAM__((const char *string), (string)) __OTORP__(const char *string;){ char *sh_fmtq __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register const char *cp = string; const char *cp = string;
register int c, state; int c, state;
int offset; int offset;
if(!cp) if(!cp)
return((char*)0); return((char*)0);
@ -303,10 +303,10 @@ char *sh_fmtq __PARAM__((const char *string), (string)) __OTORP__(const char *st
} }
#ifdef SHOPT_MULTIBYTE #ifdef SHOPT_MULTIBYTE
int sh_strchr __PARAM__((const char *string, register const char *dp), (string, dp)) __OTORP__(const char *string; register const char *dp;){ int sh_strchr __PARAM__((const char *string, const char *dp), (string, dp)) __OTORP__(const char *string; const char *dp;){
wchar_t c,d; wchar_t c,d;
register int m; int m;
register const char *cp=string; const char *cp=string;
int n = mbtowc(&d,dp,MB_CUR_MAX); int n = mbtowc(&d,dp,MB_CUR_MAX);
while((m=mbtowc(&c,cp,MB_CUR_MAX)) && c) while((m=mbtowc(&c,cp,MB_CUR_MAX)) && c)
{ {

View file

@ -132,9 +132,9 @@ static int subenv;
void sh_subtmpfile __PARAM__((void), ()){ void sh_subtmpfile __PARAM__((void), ()){
if(sfset(sfstdout,0,0)&SF_STRING) if(sfset(sfstdout,0,0)&SF_STRING)
{ {
register int fd; int fd;
register struct checkpt *pp = (struct checkpt*)sh.jmplist; struct checkpt *pp = (struct checkpt*)sh.jmplist;
register struct subshell *sp = subshell_data->pipe; struct subshell *sp = subshell_data->pipe;
/* save file descriptor 1 if open */ /* save file descriptor 1 if open */
if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0) if((sp->tmpfd = fd = fcntl(1,F_DUPFD,10)) >= 0)
{ {
@ -168,7 +168,7 @@ void sh_subtmpfile __PARAM__((void), ()){
* The child continues possibly with its standard output replaced by temp file * The child continues possibly with its standard output replaced by temp file
*/ */
void sh_subfork __PARAM__((void), ()){ void sh_subfork __PARAM__((void), ()){
register struct subshell *sp = subshell_data; struct subshell *sp = subshell_data;
pid_t pid; pid_t pid;
/* see whether inside $(...) */ /* see whether inside $(...) */
if(sp->pipe) if(sp->pipe)
@ -197,8 +197,8 @@ void sh_subfork __PARAM__((void), ()){
* layer created by the most recent subshell_fork if the * layer created by the most recent subshell_fork if the
* node hasn't already been copied * node hasn't already been copied
*/ */
Namval_t *sh_assignok __PARAM__((register Namval_t *np,int add), (np, add)) __OTORP__(register Namval_t *np;int add;){ Namval_t *sh_assignok __PARAM__((Namval_t *np,int add), (np, add)) __OTORP__(Namval_t *np;int add;){
register Namval_t *mp; Namval_t *mp;
if(nv_isnull(np) && !add) /* don't bother with this */ if(nv_isnull(np) && !add) /* don't bother with this */
return(np); return(np);
/* don't bother to save if in newer scope */ /* don't bother to save if in newer scope */
@ -226,8 +226,8 @@ Namval_t *sh_assignok __PARAM__((register Namval_t *np,int add), (np, add)) __OT
* restore the variables * restore the variables
*/ */
static void nv_restore __PARAM__((struct subshell *sp), (sp)) __OTORP__(struct subshell *sp;){ static void nv_restore __PARAM__((struct subshell *sp), (sp)) __OTORP__(struct subshell *sp;){
register Namval_t *mp, *np; Namval_t *mp, *np;
register Hashpos_t *pos = hashscan(sp->svar,0); Hashpos_t *pos = hashscan(sp->svar,0);
while(np=(Namval_t*)hashnext(pos)) while(np=(Namval_t*)hashnext(pos))
{ {
if(mp = nv_search((char*)np,sp->var,HASH_BUCKET)) if(mp = nv_search((char*)np,sp->var,HASH_BUCKET))
@ -256,7 +256,7 @@ static void nv_restore __PARAM__((struct subshell *sp), (sp)) __OTORP__(struct s
Sfio_t *sh_subshell __PARAM__((union anynode *t, int flags, int comsub), (t, flags, comsub)) __OTORP__(union anynode *t; int flags; int comsub;){ Sfio_t *sh_subshell __PARAM__((union anynode *t, int flags, int comsub), (t, flags, comsub)) __OTORP__(union anynode *t; int flags; int comsub;){
struct subshell sub_data; struct subshell sub_data;
register struct subshell *sp = &sub_data; struct subshell *sp = &sub_data;
int jmpval,nsig; int jmpval,nsig;
int savecurenv = sh.curenv; int savecurenv = sh.curenv;
char *savstak; char *savstak;

View file

@ -130,8 +130,8 @@ static gid_t egroupid;
static struct stat statb; static struct stat statb;
main __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){ main __PARAM__((int argc,char *argv[]), (argc, argv)) __OTORP__(int argc;char *argv[];){
register int m,n; int m,n;
register char *p; char *p;
struct stat statx; struct stat statx;
int mode; int mode;
uid_t effuid; uid_t effuid;
@ -283,7 +283,7 @@ exec:
* return true of shell ends in sh * return true of shell ends in sh
*/ */
static int endsh __PARAM__((register const char *shell), (shell)) __OTORP__(register const char *shell;){ static int endsh __PARAM__((const char *shell), (shell)) __OTORP__(const char *shell;){
while(*shell) while(*shell)
shell++; shell++;
if(*--shell != 'h' || *--shell != 's') if(*--shell != 'h' || *--shell != 's')
@ -296,7 +296,7 @@ static int endsh __PARAM__((register const char *shell), (shell)) __OTORP__(regi
* return true of shell is in <dir> directory * return true of shell is in <dir> directory
*/ */
static int in_dir __PARAM__((register const char *dir,register const char *shell), (dir, shell)) __OTORP__(register const char *dir;register const char *shell;){ static int in_dir __PARAM__((const char *dir,const char *shell), (dir, shell)) __OTORP__(const char *dir;const char *shell;){
while(*dir) while(*dir)
{ {
if(*dir++ != *shell++) if(*dir++ != *shell++)
@ -316,7 +316,7 @@ static void error_exit __PARAM__((const char *message), (message)) __OTORP__(con
* This version of access checks against effective uid and effective gid * This version of access checks against effective uid and effective gid
*/ */
eaccess __PARAM__((register const char *name, register int mode), (name, mode)) __OTORP__(register const char *name; register int mode;){ eaccess __PARAM__((const char *name, int mode), (name, mode)) __OTORP__(const char *name; int mode;){
struct stat statb; struct stat statb;
if (stat(name, &statb) == 0) if (stat(name, &statb) == 0)
{ {
@ -337,7 +337,7 @@ eaccess __PARAM__((register const char *name, register int mode), (name, mode))
{ {
static int maxgroups = 0; static int maxgroups = 0;
gid_t *groups; gid_t *groups;
register int n; int n;
if(maxgroups==0) if(maxgroups==0)
{ {
/* first time */ /* first time */
@ -387,7 +387,7 @@ setids __PARAM__((int mode,int owner,int group), (mode, owner, group)) __OTORP__
*/ */
setids __PARAM__((int mode,uid_t owner,gid_t group), (mode, owner, group)) __OTORP__(int mode;uid_t owner;gid_t group;){ setids __PARAM__((int mode,uid_t owner,gid_t group), (mode, owner, group)) __OTORP__(int mode;uid_t owner;gid_t group;){
register int n,m; int n,m;
int pv[2]; int pv[2];
/* /*
@ -497,8 +497,8 @@ setids __PARAM__((int mode,uid_t owner,gid_t group), (mode, owner, group)) __OTO
*/ */
static void maketemp __PARAM__((char *template), (template)) __OTORP__(char *template;){ static void maketemp __PARAM__((char *template), (template)) __OTORP__(char *template;){
register char *cp = template; char *cp = template;
register pid_t n = getpid(); pid_t n = getpid();
/* skip to end of string */ /* skip to end of string */
while(*++cp); while(*++cp);
/* convert process id to string */ /* convert process id to string */
@ -516,7 +516,7 @@ static void maketemp __PARAM__((char *template), (template)) __OTORP__(char *tem
static int mycopy __PARAM__((int fdi, int fdo), (fdi, fdo)) __OTORP__(int fdi; int fdo;){ static int mycopy __PARAM__((int fdi, int fdo), (fdi, fdo)) __OTORP__(int fdi; int fdo;){
char buffer[BLKSIZE]; char buffer[BLKSIZE];
register int n; int n;
while((n = read(fdi,buffer,BLKSIZE)) > 0) while((n = read(fdi,buffer,BLKSIZE)) > 0)
if(write(fdo,buffer,n) != n) if(write(fdo,buffer,n) != n)

View file

@ -114,7 +114,7 @@ int sh_tdump __PARAM__((Sfio_t *out, const union anynode *t), (out, t)) __OTORP_
/* /*
* print script corresponding to shell tree <t> * print script corresponding to shell tree <t>
*/ */
static int p_tree __PARAM__((register const union anynode *t), (t)) __OTORP__(register const union anynode *t;){ static int p_tree __PARAM__((const union anynode *t), (t)) __OTORP__(const union anynode *t;){
if(!t) if(!t)
return(sfputl(outfile,-1)); return(sfputl(outfile,-1));
if(sfputl(outfile,t->tre.tretyp)<0) if(sfputl(outfile,t->tre.tretyp)<0)
@ -197,8 +197,8 @@ static int p_tree __PARAM__((register const union anynode *t), (t)) __OTORP__(re
} }
} }
static int p_arg __PARAM__((register const struct argnod *arg), (arg)) __OTORP__(register const struct argnod *arg;){ static int p_arg __PARAM__((const struct argnod *arg), (arg)) __OTORP__(const struct argnod *arg;){
register int n; int n;
struct fornod *fp; struct fornod *fp;
while(arg) while(arg)
{ {
@ -221,7 +221,7 @@ static int p_arg __PARAM__((register const struct argnod *arg), (arg)) __OTORP__
return(sfputu(outfile,0)); return(sfputu(outfile,0));
} }
static int p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTORP__(register const struct ionod *iop;){ static int p_redirect __PARAM__((const struct ionod *iop), (iop)) __OTORP__(const struct ionod *iop;){
while(iop) while(iop)
{ {
sfputl(outfile,iop->iofile); sfputl(outfile,iop->iofile);
@ -240,7 +240,7 @@ static int p_redirect __PARAM__((register const struct ionod *iop), (iop)) __OTO
return(sfputl(outfile,-1)); return(sfputl(outfile,-1));
} }
static int p_comarg __PARAM__((const register struct comnod *com), (com)) __OTORP__(const register struct comnod *com;){ static int p_comarg __PARAM__((const struct comnod *com), (com)) __OTORP__(const struct comnod *com;){
p_redirect(com->comio); p_redirect(com->comio);
p_arg(com->comset); p_arg(com->comset);
if(!com->comarg) if(!com->comarg)
@ -253,8 +253,8 @@ static int p_comarg __PARAM__((const register struct comnod *com), (com)) __OTOR
} }
static int p_comlist __PARAM__((const struct dolnod *dol), (dol)) __OTORP__(const struct dolnod *dol;){ static int p_comlist __PARAM__((const struct dolnod *dol), (dol)) __OTORP__(const struct dolnod *dol;){
register char *cp, *const*argv; char *cp, *const*argv;
register int n; int n;
argv = dol->dolval+ARG_SPARE; argv = dol->dolval+ARG_SPARE;
while(cp = *argv) while(cp = *argv)
argv++; argv++;
@ -266,7 +266,7 @@ static int p_comlist __PARAM__((const struct dolnod *dol), (dol)) __OTORP__(cons
return(sfputu(outfile,0)); return(sfputu(outfile,0));
} }
static int p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTORP__(register const struct regnod *reg;){ static int p_switch __PARAM__((const struct regnod *reg), (reg)) __OTORP__(const struct regnod *reg;){
while(reg) while(reg)
{ {
sfputl(outfile,reg->regflag); sfputl(outfile,reg->regflag);
@ -277,8 +277,8 @@ static int p_switch __PARAM__((register const struct regnod *reg), (reg)) __OTOR
return(sfputl(outfile,-1)); return(sfputl(outfile,-1));
} }
static int p_string __PARAM__((register const char *string), (string)) __OTORP__(register const char *string;){ static int p_string __PARAM__((const char *string), (string)) __OTORP__(const char *string;){
register size_t n=strlen(string); size_t n=strlen(string);
if(sfputu(outfile,n+1)<0) if(sfputu(outfile,n+1)<0)
return(-1); return(-1);
return(sfwrite(outfile,string,n)); return(sfwrite(outfile,string,n));

View file

@ -116,7 +116,7 @@ static Timer_t *tptop, *tpmin;
static char time_state; static char time_state;
static double getnow __PARAM__((void), ()){ static double getnow __PARAM__((void), ()){
register double now; double now;
#ifdef _lib_gettimeofday #ifdef _lib_gettimeofday
struct timeval tp; struct timeval tp;
gettimeofday(&tp,(void *)0); gettimeofday(&tp,(void *)0);
@ -131,7 +131,7 @@ static double getnow __PARAM__((void), ()){
/* /*
* set an alarm for <t> seconds * set an alarm for <t> seconds
*/ */
static double setalarm __PARAM__((register double t), (t)) __OTORP__(register double t;){ static double setalarm __PARAM__((double t), (t)) __OTORP__(double t;){
#if defined(_lib_setitimer) && defined(ITIMER_REAL) #if defined(_lib_setitimer) && defined(ITIMER_REAL)
struct itimerval tnew, told; struct itimerval tnew, told;
tnew.it_value.tv_sec = t; tnew.it_value.tv_sec = t;
@ -154,7 +154,7 @@ static double setalarm __PARAM__((register double t), (t)) __OTORP__(register do
/* signal handler for alarm call */ /* signal handler for alarm call */
static void sigalrm __PARAM__((int sig), (sig)) __OTORP__(int sig;){ static void sigalrm __PARAM__((int sig), (sig)) __OTORP__(int sig;){
register Timer_t *tp, *tplast, *tpold; Timer_t *tp, *tplast, *tpold;
double now; double now;
static double left; static double left;
NOT_USED(sig); NOT_USED(sig);
@ -237,7 +237,7 @@ static void oldalrm __PARAM__((__V_ *handle), (handle)) __OTORP__(__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;){ __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; Timer_t *tp;
double t; double t;
Handler_t fn; Handler_t fn;
t = ((double)msec)/1000.; t = ((double)msec)/1000.;
@ -282,7 +282,7 @@ __V_ *kshtimeradd __PARAM__((unsigned long msec,int flags,void (*action)(__V_*),
* delete timer <tp>. If <tp> is NULL, all timers are deleted * delete timer <tp>. If <tp> is NULL, all timers are deleted
*/ */
void timerdel __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;){ void timerdel __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle;){
register Timer_t *tp = (Timer_t*)handle; Timer_t *tp = (Timer_t*)handle;
if(tp) if(tp)
tp->action = 0; tp->action = 0;
else else

View file

@ -121,8 +121,8 @@ union anynode *sh_trestore __PARAM__((Sfio_t *in), (in)) __OTORP__(Sfio_t *in;){
static union anynode *r_tree() static union anynode *r_tree()
{ {
long l = sfgetl(infile); long l = sfgetl(infile);
register int type; int type;
register union anynode *t=0; union anynode *t=0;
if(l<0) if(l<0)
return(t); return(t);
type = l; type = l;
@ -219,8 +219,8 @@ static union anynode *r_tree()
} }
static struct argnod *r_arg __PARAM__((void), ()){ static struct argnod *r_arg __PARAM__((void), ()){
register struct argnod *ap=0, *apold, *aptop=0; struct argnod *ap=0, *apold, *aptop=0;
register long l; long l;
while((l=sfgetu(infile))>0) while((l=sfgetu(infile))>0)
{ {
ap = (struct argnod*)stakseek((unsigned)l+ARGVAL); ap = (struct argnod*)stakseek((unsigned)l+ARGVAL);
@ -263,8 +263,8 @@ static struct argnod *r_arg __PARAM__((void), ()){
} }
static struct ionod *r_redirect __PARAM__((void), ()){ static struct ionod *r_redirect __PARAM__((void), ()){
register long l; long l;
register struct ionod *iop=0, *iopold, *ioptop=0; struct ionod *iop=0, *iopold, *ioptop=0;
while((l=sfgetl(infile))>=0) while((l=sfgetl(infile))>=0)
{ {
iop = (struct ionod*)getnode(ionod); iop = (struct ionod*)getnode(ionod);
@ -313,9 +313,9 @@ static void r_comarg __PARAM__((struct comnod *com), (com)) __OTORP__(struct com
} }
static struct dolnod *r_comlist __PARAM__((void), ()){ static struct dolnod *r_comlist __PARAM__((void), ()){
register struct dolnod *dol=0; struct dolnod *dol=0;
register long l; long l;
register char **argv; char **argv;
if((l=sfgetl(infile))>0) if((l=sfgetl(infile))>0)
{ {
dol = (struct dolnod*)stakalloc(sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE)); dol = (struct dolnod*)stakalloc(sizeof(struct dolnod) + sizeof(char*)*(l+ARG_SPARE));
@ -328,7 +328,7 @@ static struct dolnod *r_comlist __PARAM__((void), ()){
} }
static struct regnod *r_switch __PARAM__((void), ()){ static struct regnod *r_switch __PARAM__((void), ()){
register long l; long l;
struct regnod *reg=0,*regold,*regtop=0; struct regnod *reg=0,*regold,*regtop=0;
while((l=sfgetl(infile))>=0) while((l=sfgetl(infile))>=0)
{ {
@ -348,9 +348,9 @@ static struct regnod *r_switch __PARAM__((void), ()){
} }
static char *r_string __PARAM__((void), ()){ static char *r_string __PARAM__((void), ()){
register Sfio_t *in = infile; Sfio_t *in = infile;
register unsigned long l = sfgetu(in); unsigned long l = sfgetu(in);
register char *ptr; char *ptr;
if(l == 0) if(l == 0)
return(NIL(char*)); return(NIL(char*));
ptr = stakalloc((unsigned)l); ptr = stakalloc((unsigned)l);

View file

@ -130,7 +130,7 @@ static struct f_save *save_fork; /* most recently saved data */
int sh_vforksave __PARAM__((void), ()) int sh_vforksave __PARAM__((void), ())
#line 35 #line 35
{ {
register struct f_save *fp; struct f_save *fp;
if(!(fp = new_of(struct f_save,0))) if(!(fp = new_of(struct f_save,0)))
return(0); return(0);
fp->f_save_fork = save_fork; fp->f_save_fork = save_fork;
@ -151,7 +151,7 @@ int sh_vforksave __PARAM__((void), ())
void sh_vforkrestore __PARAM__((void), ()) void sh_vforkrestore __PARAM__((void), ())
#line 55 #line 55
{ {
register struct f_save *fp = save_fork; struct f_save *fp = save_fork;
if(!sh_isstate(SH_VFORKED)) if(!sh_isstate(SH_VFORKED))
return; return;

View file

@ -132,8 +132,8 @@ static char pipejob;
/* /*
* Given stream <iop> compile and execute * Given stream <iop> compile and execute
*/ */
int sh_eval __PARAM__((register Sfio_t *iop, int mode), (iop, mode)) __OTORP__(register Sfio_t *iop; int mode;){ int sh_eval __PARAM__((Sfio_t *iop, int mode), (iop, mode)) __OTORP__(Sfio_t *iop; int mode;){
register union anynode *t; union anynode *t;
struct slnod *saveslp = sh.st.staklist; struct slnod *saveslp = sh.st.staklist;
int jmpval; int jmpval;
struct checkpt *pp = (struct checkpt*)sh.jmplist; struct checkpt *pp = (struct checkpt*)sh.jmplist;
@ -167,7 +167,7 @@ int sh_eval __PARAM__((register Sfio_t *iop, int mode), (iop, mode)) __OTORP__(r
#ifdef SHOPT_FASTPIPE #ifdef SHOPT_FASTPIPE
static int pipe_exec __PARAM__((int pv[], union anynode *t, int errorflg), (pv, t, errorflg)) __OTORP__(int pv[]; union anynode *t; int errorflg;){ static int pipe_exec __PARAM__((int pv[], union anynode *t, int errorflg), (pv, t, errorflg)) __OTORP__(int pv[]; union anynode *t; int errorflg;){
struct checkpt buff; struct checkpt buff;
register union anynode *tchild = t->fork.forktre; union anynode *tchild = t->fork.forktre;
Namval_t *np; Namval_t *np;
Sfile_t *iop; Sfile_t *iop;
int jmpval,r; int jmpval,r;
@ -209,12 +209,12 @@ static int pipe_exec __PARAM__((int pv[], union anynode *t, int errorflg), (pv,
} }
#endif /* SHOPT_FASTPIPE */ #endif /* SHOPT_FASTPIPE */
sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OTORP__(register const union anynode *t; int flags;){ sh_exec __PARAM__((const union anynode *t, int flags), (t, flags)) __OTORP__(const union anynode *t; int flags;){
sh_sigcheck(); sh_sigcheck();
if(t && !sh.st.execbrk && !sh_isoption(SH_NOEXEC)) if(t && !sh.st.execbrk && !sh_isoption(SH_NOEXEC))
{ {
register int type = flags; int type = flags;
register char *com0 = 0; char *com0 = 0;
int errorflg = (type&SH_ERREXIT); int errorflg = (type&SH_ERREXIT);
int execflg = (type&SH_NOFORK); int execflg = (type&SH_NOFORK);
int mainloop = (type&SH_INTERACTIVE); int mainloop = (type&SH_INTERACTIVE);
@ -242,7 +242,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{ {
case TCOM: case TCOM:
{ {
register struct argnod *argp; struct argnod *argp;
char *trap; char *trap;
Namval_t *np; Namval_t *np;
struct ionod *io; struct ionod *io;
@ -258,7 +258,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
com0 = com[0]; com0 = com[0];
if(!(np=(Namval_t*)(t->com.comnamp)) && com0) if(!(np=(Namval_t*)(t->com.comnamp)) && com0)
{ {
register char *cp; char *cp;
Namval_t *nq=0; Namval_t *nq=0;
/* check for reference to discipline function */ /* check for reference to discipline function */
if((cp=strchr(com0,'.')) && cp!=com0) if((cp=strchr(com0,'.')) && cp!=com0)
@ -310,7 +310,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
} }
while(np==SYSCOMMAND) while(np==SYSCOMMAND)
{ {
register int n = b_command(0,com,0); int n = b_command(0,com,0);
if(n==0) if(n==0)
break; break;
command += n; command += n;
@ -333,7 +333,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{ {
if(argn==0 || (np && !command && nv_isattr(np,BLT_SPC))) if(argn==0 || (np && !command && nv_isattr(np,BLT_SPC)))
{ {
register int flags=NV_VARNAME|NV_ASSIGN; int flags=NV_VARNAME|NV_ASSIGN;
if(np==SYSTYPESET) if(np==SYSTYPESET)
{ {
if(sh.fn_depth) if(sh.fn_depth)
@ -472,7 +472,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
if(!command && np && nv_isattr(np,NV_FUNCTION)) if(!command && np && nv_isattr(np,NV_FUNCTION))
{ {
int indx; int indx;
register struct slnod *slp; struct slnod *slp;
if(!np->nvalue.ip) if(!np->nvalue.ip)
{ {
path_search(com0,NIL(char*),0); path_search(com0,NIL(char*),0);
@ -502,7 +502,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
} }
case TFORK: case TFORK:
{ {
register pid_t parent; pid_t parent;
int no_fork,jobid; int no_fork,jobid;
int pipes[2]; int pipes[2];
no_fork = (execflg && !(type&(FAMP|FPOU)) && no_fork = (execflg && !(type&(FAMP|FPOU)) &&
@ -794,9 +794,9 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
case TFOR: /* for and select */ case TFOR: /* for and select */
{ {
register char **args; char **args;
register int nargs; int nargs;
register Namval_t *np; Namval_t *np;
struct dolnod *argsav=0; struct dolnod *argsav=0;
struct comnod *tp; struct comnod *tp;
char *cp, *nullptr = 0; char *cp, *nullptr = 0;
@ -822,7 +822,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
{ {
char *val; char *val;
int save_prompt; int save_prompt;
/* reuse register */ /* reuse */
if(refresh) if(refresh)
{ {
sh_menu(sfstderr,nargs,args); sh_menu(sfstderr,nargs,args);
@ -889,7 +889,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
case TWH: /* while and until */ case TWH: /* while and until */
{ {
register int r=0; int r=0;
sh.st.loopcnt++; sh.st.loopcnt++;
while(sh.st.execbrk==0 && (sh_exec(t->wh.whtre,0)==0)==(type==TWH)) while(sh.st.execbrk==0 && (sh_exec(t->wh.whtre,0)==0)==(type==TWH))
{ {
@ -908,7 +908,7 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
} }
case TARITH: /* (( expression )) */ case TARITH: /* (( expression )) */
{ {
register char *trap; char *trap;
static char *arg[4]= {"((", 0, "))"}; static char *arg[4]= {"((", 0, "))"};
error_info.line = t->ar.arline-sh.st.firstline; error_info.line = t->ar.arline-sh.st.firstline;
if(trap=sh.st.trap[SH_DEBUGTRAP]) if(trap=sh.st.trap[SH_DEBUGTRAP])
@ -945,10 +945,10 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
t= (union anynode*)(t->sw.swlst); t= (union anynode*)(t->sw.swlst);
while(t) while(t)
{ {
register struct argnod *rex=(struct argnod*)t->reg.regptr; struct argnod *rex=(struct argnod*)t->reg.regptr;
while(rex) while(rex)
{ {
register char *s; char *s;
if(rex->argflag&ARG_MAC) if(rex->argflag&ARG_MAC)
{ {
s = sh_mactrim(rex->argval,1); s = sh_mactrim(rex->argval,1);
@ -1037,11 +1037,11 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
} }
case TFUN: case TFUN:
{ {
register Namval_t *np; Namval_t *np;
register struct slnod *slp; struct slnod *slp;
register char *fname = ((struct functnod*)t)->functnam; char *fname = ((struct functnod*)t)->functnam;
register char *cp; char *cp;
register Namval_t *npv=0; Namval_t *npv=0;
/* look for discipline functions */ /* look for discipline functions */
error_info.line = t->funct.functline-sh.st.firstline; error_info.line = t->funct.functline-sh.st.firstline;
if(cp = strrchr(fname,'.')) if(cp = strrchr(fname,'.'))
@ -1098,8 +1098,8 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
/* new test compound command */ /* new test compound command */
case TTST: case TTST:
{ {
register int n; int n;
register char *left; char *left;
if(type&TTEST) if(type&TTEST)
skipexitset++; skipexitset++;
error_info.line = t->tst.tstline-sh.st.firstline; error_info.line = t->tst.tstline-sh.st.firstline;
@ -1110,9 +1110,9 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
} }
else else
{ {
register int traceon=0; int traceon=0;
register char *right; char *right;
register char *trap; char *trap;
n = type>>TSHIFT; n = type>>TSHIFT;
left = word_trim(&(t->lst.lstlef->arg),0); left = word_trim(&(t->lst.lstlef->arg),0);
if(type&TBINARY) if(type&TBINARY)
@ -1220,8 +1220,8 @@ sh_exec __PARAM__((register const union anynode *t, int flags), (t, flags)) __OT
* returns 1 if r == trim(s) otherwise 0 * returns 1 if r == trim(s) otherwise 0
*/ */
static trim_eq __PARAM__((register const char *r,register const char *s), (r, s)) __OTORP__(register const char *r;register const char *s;){ static trim_eq __PARAM__((const char *r,const char *s), (r, s)) __OTORP__(const char *r;const char *s;){
register char c; char c;
while(c = *s++) while(c = *s++)
{ {
if(c=='\\') if(c=='\\')
@ -1236,9 +1236,9 @@ static trim_eq __PARAM__((register const char *r,register const char *s), (r, s)
* print out the command line if set -x is on * print out the command line if set -x is on
*/ */
int sh_trace __PARAM__((register char *argv[], register int nl), (argv, nl)) __OTORP__(register char *argv[]; register int nl;){ int sh_trace __PARAM__((char *argv[], int nl), (argv, nl)) __OTORP__(char *argv[]; int nl;){
register char *cp; char *cp;
register int bracket = 0; int bracket = 0;
if(sh_isoption(SH_XTRACE)) if(sh_isoption(SH_XTRACE))
{ {
/* make this trace atomic */ /* make this trace atomic */
@ -1279,8 +1279,8 @@ int sh_trace __PARAM__((register char *argv[], register int nl), (argv, nl)) __O
} }
static char *word_trim __PARAM__((register struct argnod *arg, int flag), (arg, flag)) __OTORP__(register struct argnod *arg; int flag;){ static char *word_trim __PARAM__((struct argnod *arg, int flag), (arg, flag)) __OTORP__(struct argnod *arg; int flag;){
register char *sp = arg->argval; char *sp = arg->argval;
if((arg->argflag&ARG_RAW)) if((arg->argflag&ARG_RAW))
return(sp); return(sp);
return(sh_mactrim(sp,flag)); return(sh_mactrim(sp,flag));
@ -1309,8 +1309,8 @@ static void timed_out __PARAM__((__V_ *handle), (handle)) __OTORP__(__V_ *handle
/* /*
* called by parent and child after fork by sh_fork() * called by parent and child after fork by sh_fork()
*/ */
pid_t _sh_fork __PARAM__((register pid_t parent,int flags,int *jobid), (parent, flags, jobid)) __OTORP__(register pid_t parent;int flags;int *jobid;){ pid_t _sh_fork __PARAM__((pid_t parent,int flags,int *jobid), (parent, flags, jobid)) __OTORP__(pid_t parent;int flags;int *jobid;){
register struct checkpt *pp = (struct checkpt*)sh.jmplist; struct checkpt *pp = (struct checkpt*)sh.jmplist;
static long forkcnt = 1000L; static long forkcnt = 1000L;
pid_t curpgid = job.curpgid; pid_t curpgid = job.curpgid;
pid_t postid = (flags&FAMP)?0:curpgid; pid_t postid = (flags&FAMP)?0:curpgid;
@ -1407,7 +1407,7 @@ pid_t _sh_fork __PARAM__((register pid_t parent,int flags,int *jobid), (parent,
} }
pid_t sh_fork __PARAM__((int flags, int *jobid), (flags, jobid)) __OTORP__(int flags; int *jobid;){ pid_t sh_fork __PARAM__((int flags, int *jobid), (flags, jobid)) __OTORP__(int flags; int *jobid;){
register pid_t parent; pid_t parent;
#ifdef SHOPT_FASTPIPE #ifdef SHOPT_FASTPIPE
if(sffileno(sfstdin)<0) if(sffileno(sfstdin)<0)
{ {
@ -1430,8 +1430,8 @@ pid_t sh_fork __PARAM__((int flags, int *jobid), (flags, jobid)) __OTORP__(int f
* The environment modification list <envlist> is ignored for posix functions * The environment modification list <envlist> is ignored for posix functions
*/ */
static void sh_funct __PARAM__((Namval_t *np,int argn, char *argv[],int execflg,struct argnod *envlist), (np, argn, argv, execflg, envlist)) __OTORP__(Namval_t *np;int argn; char *argv[];int execflg;struct argnod *envlist;){ static void sh_funct __PARAM__((Namval_t *np,int argn, char *argv[],int execflg,struct argnod *envlist), (np, argn, argv, execflg, envlist)) __OTORP__(Namval_t *np;int argn; char *argv[];int execflg;struct argnod *envlist;){
register char *trap; char *trap;
register int nsig; int nsig;
struct dolnod *argsav=0,*saveargfor; struct dolnod *argsav=0,*saveargfor;
struct sh_scoped savst; struct sh_scoped savst;
Shopt_t savopt; Shopt_t savopt;
@ -1526,9 +1526,9 @@ static void sh_funct __PARAM__((Namval_t *np,int argn, char *argv[],int execflg,
*/ */
int sh_fun __PARAM__((Namval_t *np, Namval_t *nq), (np, nq)) __OTORP__(Namval_t *np; Namval_t *nq;){ int sh_fun __PARAM__((Namval_t *np, Namval_t *nq), (np, nq)) __OTORP__(Namval_t *np; Namval_t *nq;){
char *argv[2]; char *argv[2];
register Namarr_t *ap; Namarr_t *ap;
register int offset; int offset;
register char *base; char *base;
Fcin_t save; Fcin_t save;
fcsave(&save); fcsave(&save);
if((offset=staktell())>0) if((offset=staktell())>0)
@ -1575,9 +1575,9 @@ int sh_fun __PARAM__((Namval_t *np, Namval_t *nq), (np, nq)) __OTORP__(Namval_t
/* /*
* print a time and a separator * print a time and a separator
*/ */
static void p_time __PARAM__((Sfio_t *outfile,register clock_t t,int c), (outfile, t, c)) __OTORP__(Sfio_t *outfile;register clock_t t;int c;){ static void p_time __PARAM__((Sfio_t *outfile,clock_t t,int c), (outfile, t, c)) __OTORP__(Sfio_t *outfile;clock_t t;int c;){
register int min, sec, frac; int min, sec, frac;
register int hr; int hr;
frac = t%sh.lim.clk_tck; frac = t%sh.lim.clk_tck;
frac = (frac*100)/sh.lim.clk_tck; frac = (frac*100)/sh.lim.clk_tck;
t /= sh.lim.clk_tck; t /= sh.lim.clk_tck;
@ -1635,8 +1635,8 @@ static void coproc_init __PARAM__((int pipes[]), (pipes)) __OTORP__(int pipes[];
/* /*
* print out function definition * print out function definition
*/ */
static void print_fun __PARAM__((register Namval_t* np), (np)) __OTORP__(register Namval_t* np;){ static void print_fun __PARAM__((Namval_t* np), (np)) __OTORP__(Namval_t* np;){
register char *format; char *format;
if(!is_afunction(np) || !np->nvalue.ip) if(!is_afunction(np) || !np->nvalue.ip)
return; return;
if(nv_isattr(np,NV_FPOSIX)) if(nv_isattr(np,NV_FPOSIX))
@ -1653,7 +1653,7 @@ static void print_fun __PARAM__((register Namval_t* np), (np)) __OTORP__(registe
*/ */
static int run_subshell __PARAM__((const union anynode *t,pid_t grp), (t, grp)) __OTORP__(const union anynode *t;pid_t grp;){ static int run_subshell __PARAM__((const union anynode *t,pid_t grp), (t, grp)) __OTORP__(const union anynode *t;pid_t grp;){
static char prolog[] = "set; typeset -p; print .sh.dollar=$$"; static char prolog[] = "set; typeset -p; print .sh.dollar=$$";
register int i, fd, trace = sh_isoption(SH_XTRACE); int i, fd, trace = sh_isoption(SH_XTRACE);
pid_t pid; pid_t pid;
char *arglist[3], devfd[12], *cp; char *arglist[3], devfd[12], *cp;
Sfio_t *sp = sftmp(0); Sfio_t *sp = sftmp(0);
@ -1717,7 +1717,7 @@ static pid_t sh_ntfork __PARAM__((const union anynode *t,char *argv[],int *jobid
# ifndef _lib_fork # ifndef _lib_fork
if(!argv) if(!argv)
{ {
register union anynode *tchild = t->fork.forktre; union anynode *tchild = t->fork.forktre;
int optimize=0; int optimize=0;
otype = t->tre.tretyp; otype = t->tre.tretyp;
savetype = otype; savetype = otype;

View file

@ -126,9 +126,9 @@
*/ */
static int static int
blokread __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(register Archive_t* ap; char* buf; int n;){ blokread __PARAM__((Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(Archive_t* ap; char* buf; int n;){
register int i; int i;
register int j; int j;
char c; char c;
static int eof; static int eof;
@ -170,10 +170,10 @@ blokread __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __O
} }
static int static int
blokwrite __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(register Archive_t* ap; char* buf; int n;){ blokwrite __PARAM__((Archive_t* ap, char* buf, int n), (ap, buf, n)) __OTORP__(Archive_t* ap; char* buf; int n;){
register char* s; char* s;
register int i; int i;
register int j; int j;
char blk[9]; char blk[9];
if (ap->io.blok) if (ap->io.blok)
@ -225,7 +225,7 @@ blokwrite __PARAM__((register Archive_t* ap, char* buf, int n), (ap, buf, n)) __
*/ */
void void
binit __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ binit __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
unsigned long n; unsigned long n;
if (ap->delta) if (ap->delta)
@ -245,7 +245,7 @@ binit __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap
*/ */
int int
bskip __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ bskip __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
long c; long c;
int skip = ap->io.skip; int skip = ap->io.skip;
#ifdef MTIOCTOP #ifdef MTIOCTOP
@ -315,8 +315,8 @@ bskip __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap
*/ */
static int static int
bfill __PARAM__((register Archive_t* ap, int must), (ap, must)) __OTORP__(register Archive_t* ap; int must;){ bfill __PARAM__((Archive_t* ap, int must), (ap, must)) __OTORP__(Archive_t* ap; int must;){
register int c; int c;
if (ap->io.eof) return(-1); if (ap->io.eof) return(-1);
if (ap->io.skip) ap->io.skip = bskip(ap); if (ap->io.skip) ap->io.skip = bskip(ap);
@ -343,10 +343,10 @@ bfill __PARAM__((register Archive_t* ap, int must), (ap, must)) __OTORP__(regist
*/ */
int int
bread __PARAM__((register Archive_t* ap, __V_* ab, register long n, long m, int must), (ap, ab, n, m, must)) __OTORP__(register Archive_t* ap; __V_* ab; register long n; long m; int must;){ bread __PARAM__((Archive_t* ap, __V_* ab, long n, long m, int must), (ap, ab, n, m, must)) __OTORP__(Archive_t* ap; __V_* ab; long n; long m; int must;){
register char* b = (char*)ab; char* b = (char*)ab;
register int c; int c;
register char* ob; char* ob;
if (ap->io.eof) return(-1); if (ap->io.eof) return(-1);
if (m <= 0) return(0); if (m <= 0) return(0);
@ -465,8 +465,8 @@ bread __PARAM__((register Archive_t* ap, __V_* ab, register long n, long m, int
*/ */
void void
bunread __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)) __OTORP__(register Archive_t* ap; __V_* ab; register int n;){ bunread __PARAM__((Archive_t* ap, __V_* ab, int n), (ap, ab, n)) __OTORP__(Archive_t* ap; __V_* ab; int n;){
register char* b = (char*)ab; char* b = (char*)ab;
ap->io.eof = 0; ap->io.eof = 0;
ap->io.count -= n; ap->io.count -= n;
@ -484,8 +484,8 @@ bunread __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n
*/ */
char* char*
bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(register Archive_t* ap; register int n;){ bget __PARAM__((Archive_t* ap, int n), (ap, n)) __OTORP__(Archive_t* ap; int n;){
register char* s; char* s;
ap->io.count += n; ap->io.count += n;
s = ap->io.next; s = ap->io.next;
@ -494,9 +494,9 @@ bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(regi
{ {
if (ap->io.last > ap->io.buffer + MAXUNREAD + state.buffersize) if (ap->io.last > ap->io.buffer + MAXUNREAD + state.buffersize)
{ {
register char* b; char* b;
register int k; int k;
register int m; int m;
k = ap->io.last - s; k = ap->io.last - s;
m = roundof(k, IOALIGN) - k; m = roundof(k, IOALIGN) - k;
@ -534,9 +534,9 @@ bget __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(regi
*/ */
void void
backup __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ backup __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register long n; long n;
register long m; long m;
#ifdef MTIOCTOP #ifdef MTIOCTOP
struct mtop mt; struct mtop mt;
#endif #endif
@ -593,7 +593,7 @@ backup __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* a
*/ */
void void
bflushin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ bflushin __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
ap->io.count += ap->io.last - ap->io.next; ap->io.count += ap->io.last - ap->io.next;
ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD; ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD;
if (!ap->io.eof) if (!ap->io.eof)
@ -608,7 +608,7 @@ bflushin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t*
*/ */
off_t off_t
bseek __PARAM__((register Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OTORP__(register Archive_t* ap; off_t pos; int op;){ bseek __PARAM__((Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OTORP__(Archive_t* ap; off_t pos; int op;){
ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD; ap->io.next = ap->io.last = ap->io.buffer + MAXUNREAD;
if ((pos = lseek(ap->io.fd, pos, op)) >= 0) if ((pos = lseek(ap->io.fd, pos, op)) >= 0)
{ {
@ -624,9 +624,9 @@ bseek __PARAM__((register Archive_t* ap, off_t pos, int op), (ap, pos, op)) __OT
*/ */
void void
bflushout __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ bflushout __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register int n; int n;
register int c; int c;
if (n = ap->io.next - ap->io.buffer) if (n = ap->io.next - ap->io.buffer)
{ {
@ -649,9 +649,9 @@ bflushout __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t
*/ */
void void
bwrite __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)) __OTORP__(register Archive_t* ap; __V_* ab; register int n;){ bwrite __PARAM__((Archive_t* ap, __V_* ab, int n), (ap, ab, n)) __OTORP__(Archive_t* ap; __V_* ab; int n;){
register char* b = (char*)ab; char* b = (char*)ab;
register int c; int c;
if (ap->sum > 0) if (ap->sum > 0)
ap->memsum = memsum(b, n, ap->memsum); ap->memsum = memsum(b, n, ap->memsum);
@ -734,7 +734,7 @@ bwrite __PARAM__((register Archive_t* ap, __V_* ab, register int n), (ap, ab, n)
*/ */
void void
bput __PARAM__((register Archive_t* ap, register int n), (ap, n)) __OTORP__(register Archive_t* ap; register int n;){ bput __PARAM__((Archive_t* ap, int n), (ap, n)) __OTORP__(Archive_t* ap; int n;){
ap->io.count += n; ap->io.count += n;
message((-7, "bput(%s,%d@%ld): %-.*s%s", ap->name, n, ap->io.count, n > 32 ? 32 : n, ap->io.next, n > 32 ? "..." : "")); message((-7, "bput(%s,%d@%ld): %-.*s%s", ap->name, n, ap->io.count, n > 32 ? 32 : n, ap->io.next, n > 32 ? "..." : ""));
if (ap->sum > 0) if (ap->sum > 0)
@ -766,7 +766,7 @@ static struct
*/ */
static int static int
devpath __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){ devpath __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
if (ftw->info == FTW_F && ftw->statb.st_dev == dev.st->st_dev && ftw->statb.st_ino == dev.st->st_ino) if (ftw->info == FTW_F && ftw->statb.st_dev == dev.st->st_dev && ftw->statb.st_ino == dev.st->st_ino)
{ {
message((-1, "device name is %s", ftw->path)); message((-1, "device name is %s", ftw->path));
@ -802,9 +802,9 @@ interactive __PARAM__((void), ()){
*/ */
void void
newio __PARAM__((register Archive_t* ap, int c, int n), (ap, c, n)) __OTORP__(register Archive_t* ap; int c; int n;){ newio __PARAM__((Archive_t* ap, int c, int n), (ap, c, n)) __OTORP__(Archive_t* ap; int c; int n;){
register char* s; char* s;
register char* rw; char* rw;
char* file; char* file;
char* io; char* io;
char* t; char* t;

View file

@ -97,9 +97,9 @@
*/ */
char* char*
strlower __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ strlower __PARAM__((char* s), (s)) __OTORP__(char* s;){
register int c; int c;
register char* t; char* t;
for (t = s; c = *t; t++) for (t = s; c = *t; t++)
if (isupper(c)) if (isupper(c))
@ -112,9 +112,9 @@ strlower __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/ */
char* char*
strupper __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ strupper __PARAM__((char* s), (s)) __OTORP__(char* s;){
register int c; int c;
register char* t; char* t;
for (t = s; c = *t; t++) for (t = s; c = *t; t++)
if (islower(c)) if (islower(c))
@ -127,7 +127,7 @@ strupper __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/ */
long long
cpio_long __PARAM__((register unsigned short* s), (s)) __OTORP__(register unsigned short* s;){ cpio_long __PARAM__((unsigned short* s), (s)) __OTORP__(unsigned short* s;){
Integral_t u; Integral_t u;
u.l = 1; u.l = 1;
@ -149,7 +149,7 @@ cpio_long __PARAM__((register unsigned short* s), (s)) __OTORP__(register unsign
*/ */
void void
cpio_short __PARAM__((register unsigned short* s, long n), (s, n)) __OTORP__(register unsigned short* s; long n;){ cpio_short __PARAM__((unsigned short* s, long n), (s, n)) __OTORP__(unsigned short* s; long n;){
Integral_t u; Integral_t u;
u.l = 1; u.l = 1;
@ -173,8 +173,8 @@ cpio_short __PARAM__((register unsigned short* s, long n), (s, n)) __OTORP__(reg
int int
tar_checksum __PARAM__((void), ()){ tar_checksum __PARAM__((void), ()){
register char* p; char* p;
register int n; int n;
p = tar_header.chksum; p = tar_header.chksum;
while (p < &tar_header.chksum[sizeof(tar_header.chksum)]) *p++ = ' '; while (p < &tar_header.chksum[sizeof(tar_header.chksum)]) *p++ = ' ';
@ -189,9 +189,9 @@ tar_checksum __PARAM__((void), ()){
*/ */
long long
asc_checksum __PARAM__((char* ab, int n, register unsigned long sum), (ab, n, sum)) __OTORP__(char* ab; int n; register unsigned long sum;){ asc_checksum __PARAM__((char* ab, int n, unsigned long sum), (ab, n, sum)) __OTORP__(char* ab; int n; unsigned long sum;){
register unsigned char* b = (unsigned char*)ab; unsigned char* b = (unsigned char*)ab;
register unsigned char* e; unsigned char* e;
e = b + n; e = b + n;
while (b < e) sum += *b++; while (b < e) sum += *b++;
@ -203,9 +203,9 @@ asc_checksum __PARAM__((char* ab, int n, register unsigned long sum), (ab, n, su
*/ */
long long
getlabnum __PARAM__((register char* p, int byte, int width, int base), (p, byte, width, base)) __OTORP__(register char* p; int byte; int width; int base;){ getlabnum __PARAM__((char* p, int byte, int width, int base), (p, byte, width, base)) __OTORP__(char* p; int byte; int width; int base;){
register char* e; char* e;
register int c; int c;
long n; long n;
p += byte - 1; p += byte - 1;
@ -221,9 +221,9 @@ getlabnum __PARAM__((register char* p, int byte, int width, int base), (p, byte,
*/ */
char* char*
getlabstr __PARAM__((register char* p, int byte, int width, register char* s), (p, byte, width, s)) __OTORP__(register char* p; int byte; int width; register char* s;){ getlabstr __PARAM__((char* p, int byte, int width, char* s), (p, byte, width, s)) __OTORP__(char* p; int byte; int width; char* s;){
register char* e; char* e;
char* v; char* v;
v = s; v = s;
@ -245,9 +245,9 @@ getlabstr __PARAM__((register char* p, int byte, int width, register char* s), (
#define OHASHLPART(h,c) OHASHPART(31, h, c, 3, 2) #define OHASHLPART(h,c) OHASHPART(31, h, c, 3, 2)
unsigned long unsigned long
omemsum __PARAM__((const __V_* b, int n, register unsigned long c), (b, n, c)) __OTORP__(const __V_* b; int n; register unsigned long c;){ omemsum __PARAM__((const __V_* b, int n, unsigned long c), (b, n, c)) __OTORP__(const __V_* b; int n; unsigned long c;){
register unsigned char* p; unsigned char* p;
register unsigned char* e; unsigned char* e;
p = (unsigned char*)b; p = (unsigned char*)b;
e = p + n; e = p + n;

View file

@ -97,8 +97,8 @@
*/ */
void void
copyin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ copyin __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register File_t* f = &ap->file; File_t* f = &ap->file;
deltabase(ap); deltabase(ap);
while (getprologue(ap)) while (getprologue(ap))
@ -120,9 +120,9 @@ copyin __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* a
*/ */
int int
copyout __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){ copyout __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
register Archive_t* ap = state.out; Archive_t* ap = state.out;
register File_t* f = &ap->file; File_t* f = &ap->file;
if (getfile(ap, f, ftw)) if (getfile(ap, f, ftw))
{ {
@ -142,10 +142,10 @@ copyout __PARAM__((register Ftw_t* ftw), (ftw)) __OTORP__(register Ftw_t* ftw;){
static void static void
recordout __PARAM__((Archive_t* ap, File_t* f, Sfio_t* fp), (ap, f, fp)) __OTORP__(Archive_t* ap; File_t* f; Sfio_t* fp;){ recordout __PARAM__((Archive_t* ap, File_t* f, Sfio_t* fp), (ap, f, fp)) __OTORP__(Archive_t* ap; File_t* f; Sfio_t* fp;){
register int c; int c;
register char* p; char* p;
register char* recdat; char* recdat;
register char* blkdat; char* blkdat;
char* rec; char* rec;
char* blk; char* blk;
int span; int span;
@ -326,9 +326,9 @@ recordout __PARAM__((Archive_t* ap, File_t* f, Sfio_t* fp), (ap, f, fp)) __OTORP
*/ */
void void
fileout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ fileout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
register long c; long c;
int err; int err;
Buffer_t* bp; Buffer_t* bp;
Sfio_t* rfp; Sfio_t* rfp;
@ -458,9 +458,9 @@ fileout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
static void static void
recordin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f, wfd)) __OTORP__(register Archive_t* ap; register File_t* f; int wfd;){ recordin __PARAM__((Archive_t* ap, File_t* f, int wfd), (ap, f, wfd)) __OTORP__(Archive_t* ap; File_t* f; int wfd;){
register long n; long n;
register long size; long size;
int c; int c;
int i; int i;
int j; int j;
@ -645,8 +645,8 @@ recordin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f
*/ */
static void static void
savesetin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap, f, wfd)) __OTORP__(register Archive_t* ap; register File_t* f; int wfd;){ savesetin __PARAM__((Archive_t* ap, File_t* f, int wfd), (ap, f, wfd)) __OTORP__(Archive_t* ap; File_t* f; int wfd;){
register long c; long c;
int i; int i;
int j; int j;
int k; int k;
@ -736,10 +736,10 @@ savesetin __PARAM__((register Archive_t* ap, register File_t* f, int wfd), (ap,
*/ */
void void
filein __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ filein __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register long c; long c;
register int n; int n;
register char* s; char* s;
int dfd; int dfd;
int wfd; int wfd;
long checksum; long checksum;
@ -845,7 +845,7 @@ filein __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/ */
void void
fileskip __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ fileskip __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
switch (ap->format) switch (ap->format)
{ {
case ALAR: case ALAR:
@ -871,11 +871,11 @@ fileskip __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
int int
copyinout __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){ copyinout __PARAM__((Ftw_t* ftw), (ftw)) __OTORP__(Ftw_t* ftw;){
register long c; long c;
register long n; long n;
register int rfd; int rfd;
register int wfd; int wfd;
register File_t* f = &state.out->file; File_t* f = &state.out->file;
static char path[PATH_MAX]; static char path[PATH_MAX];
@ -932,9 +932,9 @@ cmpftw __PARAM__((Ftw_t* ft1, Ftw_t* ft2), (ft1, ft2)) __OTORP__(Ftw_t* ft1; Ftw
typedef int (*Ftw_cmp_t) __PROTO__((Ftw_t*, Ftw_t*)); typedef int (*Ftw_cmp_t) __PROTO__((Ftw_t*, Ftw_t*));
void void
copy __PARAM__((register Archive_t* ap, register int (*copyfile)(Ftw_t*)), (ap, copyfile)) __OTORP__(register Archive_t* ap; register int (*copyfile)();){ copy __PARAM__((Archive_t* ap, int (*copyfile)(Ftw_t*)), (ap, copyfile)) __OTORP__(Archive_t* ap; int (*copyfile)();){
register char* s; char* s;
register int n; int n;
if (ap) if (ap)
{ {
@ -966,7 +966,7 @@ copy __PARAM__((register Archive_t* ap, register int (*copyfile)(Ftw_t*)), (ap,
*/ */
void void
append __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ append __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
if (state.update) initdelta(ap); if (state.update) initdelta(ap);
ap->format = IN_DEFAULT; ap->format = IN_DEFAULT;
copyin(ap); copyin(ap);

View file

@ -98,9 +98,9 @@
static void static void
getdeltaops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){ getdeltaops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register char* e; char* e;
register int n; int n;
unsigned long x; unsigned long x;
char c; char c;
@ -160,8 +160,8 @@ getdeltaops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t*
*/ */
void void
getdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ getdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
char c; char c;
int n; int n;
unsigned long sum; unsigned long sum;
@ -218,7 +218,7 @@ getdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/ */
void void
getdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ getdeltatrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
if (ap->delta && ap->delta->trailer) if (ap->delta && ap->delta->trailer)
{ {
f->st->st_size += ap->delta->trailer; f->st->st_size += ap->delta->trailer;
@ -232,9 +232,9 @@ getdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/ */
void void
setdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ setdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register int n; int n;
if (f->delta.op && ap->delta) if (f->delta.op && ap->delta)
{ {
@ -253,7 +253,7 @@ setdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/ */
void void
putdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ putdeltaheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
int n; int n;
if (f->delta.op && ap->delta && (n = ap->delta->hdr - ap->delta->hdrbuf)) if (f->delta.op && ap->delta && (n = ap->delta->hdr - ap->delta->hdrbuf))
@ -278,9 +278,9 @@ putdeltaheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f))
*/ */
void void
putdeltatrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ putdeltatrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register int n; int n;
if (f->delta.op && ap->delta) if (f->delta.op && ap->delta)
{ {
@ -312,8 +312,8 @@ initdelta __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
*/ */
void void
deltabase __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ deltabase __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register Archive_t* bp; Archive_t* bp;
struct stat st; struct stat st;
if (!ap->delta) if (!ap->delta)
@ -355,10 +355,10 @@ deltabase __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t
void void
deltaverify __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){ deltaverify __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register int wfd; int wfd;
register Member_t* d; Member_t* d;
register long c; long c;
register long n; long n;
Hash_position_t* pos; Hash_position_t* pos;
if (!state.list && ap->delta && (pos = hashscan(ap->delta->tab, 0))) if (!state.list && ap->delta && (pos = hashscan(ap->delta->tab, 0)))
@ -410,9 +410,9 @@ deltaverify __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
*/ */
static void static void
deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, register Member_t* d), (ip, op, d)) __OTORP__(Archive_t* ip; Archive_t* op; register Member_t* d;){ deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, Member_t* d), (ip, op, d)) __OTORP__(Archive_t* ip; Archive_t* op; Member_t* d;){
register char* s; char* s;
register Member_t* m; Member_t* m;
d->mark = 1; d->mark = 1;
if (s = strrchr(d->info->path, '/')) if (s = strrchr(d->info->path, '/'))
@ -438,8 +438,8 @@ deltaprefix __PARAM__((Archive_t* ip, Archive_t* op, register Member_t* d), (ip,
*/ */
void void
deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; register File_t* f;){ deltaout __PARAM__((Archive_t* ip, Archive_t* op, File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; File_t* f;){
register Member_t* d; Member_t* d;
int dfd; int dfd;
if (d = op->delta && op->delta->tab && f->name ? (Member_t*)hashget(op->delta->tab, f->name) : (Member_t*)0) if (d = op->delta && op->delta->tab && f->name ? (Member_t*)hashget(op->delta->tab, f->name) : (Member_t*)0)
@ -489,7 +489,7 @@ deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
} }
if (!d || d->mtime != f->st->st_mtime) if (!d || d->mtime != f->st->st_mtime)
{ {
register char* s; char* s;
if (ip && ip->delta && ip->delta->tab && f->name && (s = strrchr(f->name, '/'))) if (ip && ip->delta && ip->delta->tab && f->name && (s = strrchr(f->name, '/')))
{ {
@ -512,7 +512,7 @@ deltaout __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
*/ */
static void static void
deltacopy __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; register File_t* f;){ deltacopy __PARAM__((Archive_t* ip, Archive_t* op, File_t* f), (ip, op, f)) __OTORP__(Archive_t* ip; Archive_t* op; File_t* f;){
f->st->st_size = f->delta.base->size; f->st->st_size = f->delta.base->size;
if (f->delta.base->expand >= 0) if (f->delta.base->expand >= 0)
{ {
@ -537,9 +537,9 @@ deltacopy __PARAM__((Archive_t* ip, Archive_t* op, register File_t* f), (ip, op,
*/ */
void void
deltadelete __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ deltadelete __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register File_t* f; File_t* f;
register Member_t* d; Member_t* d;
Hash_position_t* pos; Hash_position_t* pos;
if (!state.ordered && ap->delta && ap->delta->tab) if (!state.ordered && ap->delta && ap->delta->tab)
@ -572,9 +572,9 @@ deltadelete __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
void void
deltapass __PARAM__((Archive_t* ip, Archive_t* op), (ip, op)) __OTORP__(Archive_t* ip; Archive_t* op;){ deltapass __PARAM__((Archive_t* ip, Archive_t* op), (ip, op)) __OTORP__(Archive_t* ip; Archive_t* op;){
register File_t* f; File_t* f;
register long c; long c;
register long n; long n;
Member_t* d; Member_t* d;
char* p; char* p;
Hash_position_t* pos; Hash_position_t* pos;
@ -764,7 +764,7 @@ typedef struct
static int static int
delread __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){ delread __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){
register Vdio_t* dp = (Vdio_t*)vd; Vdio_t* dp = (Vdio_t*)vd;
if (off != dp->offset) if (off != dp->offset)
{ {
@ -800,7 +800,7 @@ delread __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd))
static int static int
delwrite __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){ delwrite __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)) __OTORP__(__V_* buf; int n; long off; Vddisc_t* vd;){
register Vdio_t* dp = (Vdio_t*)vd; Vdio_t* dp = (Vdio_t*)vd;
Buffer_t* bp; Buffer_t* bp;
if (dp->op & DELTA_BIO) if (dp->op & DELTA_BIO)
@ -836,7 +836,7 @@ delwrite __PARAM__((__V_* buf, int n, long off, Vddisc_t* vd), (buf, n, off, vd)
int int
paxdelta __PARAM__((Archive_t* ip, Archive_t* ap, File_t* f, int op, ...), (va_alist)) __OTORP__(va_dcl) paxdelta __PARAM__((Archive_t* ip, Archive_t* ap, File_t* f, int op, ...), (va_alist)) __OTORP__(va_dcl)
{ __OTORP__(Archive_t* ip; Archive_t* ap; File_t* f; int op; ) { __OTORP__(Archive_t* ip; Archive_t* ap; File_t* f; int op; )
register Vdio_t* dp; Vdio_t* dp;
va_list vp; va_list vp;
long n; long n;
int bufferclash = 0; int bufferclash = 0;

View file

@ -117,12 +117,12 @@
*/ */
char* char*
fgetline __PARAM__((register FILE* fp, int op), (fp, op)) __OTORP__(register FILE* fp; int op;) fgetline __PARAM__((FILE* fp, int op), (fp, op)) __OTORP__(FILE* fp; int op;)
#line 29 #line 29
{ {
register int c; int c;
register char* s; char* s;
register char* end; char* end;
static char* buf; static char* buf;
static int siz; static int siz;

View file

@ -97,8 +97,8 @@
*/ */
int int
filter __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ filter __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
int rfd; int rfd;
int wfd; int wfd;
Proc_t* proc; Proc_t* proc;
@ -150,8 +150,8 @@ filter __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/ */
int int
openin __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ openin __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
int rfd; int rfd;
if (f->type != X_IFREG) if (f->type != X_IFREG)
@ -185,9 +185,9 @@ openin __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP_
*/ */
static int static int
missdir __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ missdir __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register char* t; char* t;
long pp; long pp;
struct stat* st; struct stat* st;
struct stat* sp; struct stat* sp;
@ -257,8 +257,8 @@ missdir __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
int int
openout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ openout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int fd; int fd;
int exists; int exists;
struct stat st; struct stat st;
@ -514,8 +514,8 @@ openout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
int int
getfile __PARAM__((register Archive_t* ap, register File_t* f, register Ftw_t* ftw), (ap, f, ftw)) __OTORP__(register Archive_t* ap; register File_t* f; register Ftw_t* ftw;){ getfile __PARAM__((Archive_t* ap, File_t* f, Ftw_t* ftw), (ap, f, ftw)) __OTORP__(Archive_t* ap; File_t* f; Ftw_t* ftw;){
register char* name; char* name;
static struct stat st; static struct stat st;
static char pathbuffer[PATH_MAX]; static char pathbuffer[PATH_MAX];
@ -599,8 +599,8 @@ getfile __PARAM__((register Archive_t* ap, register File_t* f, register Ftw_t* f
*/ */
int int
validout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ validout __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
static char linkbuffer[PATH_MAX]; static char linkbuffer[PATH_MAX];
static char idbuffer[ALAR_NAMESIZE + 1]; static char idbuffer[ALAR_NAMESIZE + 1];
@ -697,9 +697,9 @@ validout __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
*/ */
int int
addlink __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ addlink __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register Link_t* p; Link_t* p;
register char* s; char* s;
Fileid_t id; Fileid_t id;
unsigned short us; unsigned short us;
@ -827,7 +827,7 @@ addlink __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
void void
getidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){ getidnames __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
if (!f->uidname) f->uidname = fmtuid(f->st->st_uid); if (!f->uidname) f->uidname = fmtuid(f->st->st_uid);
if (!f->gidname) f->gidname = fmtgid(f->st->st_gid); if (!f->gidname) f->gidname = fmtgid(f->st->st_gid);
} }
@ -837,8 +837,8 @@ getidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
*/ */
void void
setidnames __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){ setidnames __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
register int id; int id;
if (f->uidname) if (f->uidname)
{ {
@ -898,7 +898,7 @@ getarchive __PARAM__((int op), (op)) __OTORP__(int op;){
*/ */
void void
initfile __PARAM__((register Archive_t* ap, register File_t* f, register char* name, int mode), (ap, f, name, mode)) __OTORP__(register Archive_t* ap; register File_t* f; register char* name; int mode;){ initfile __PARAM__((Archive_t* ap, File_t* f, char* name, int mode), (ap, f, name, mode)) __OTORP__(Archive_t* ap; File_t* f; char* name; int mode;){
static struct stat st; static struct stat st;
memzero(f, sizeof(*f)); memzero(f, sizeof(*f));
@ -918,8 +918,8 @@ initfile __PARAM__((register Archive_t* ap, register File_t* f, register char* n
*/ */
void void
setfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ setfile __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register Post_t* p; Post_t* p;
Post_t post; Post_t post;
if (!ap->pass) switch (f->type) if (!ap->pass) switch (f->type)
@ -967,8 +967,8 @@ settime __PARAM__((const char* name, time_t atime, time_t mtime), (name, atime,
*/ */
int int
restore __PARAM__((register const char* name, char* ap, __V_* handle), (name, ap, handle)) __OTORP__(register const char* name; char* ap; __V_* handle;){ restore __PARAM__((const char* name, char* ap, __V_* handle), (name, ap, handle)) __OTORP__(const char* name; char* ap; __V_* handle;){
register Post_t* p = (Post_t*)ap; Post_t* p = (Post_t*)ap;
int m; int m;
struct stat st; struct stat st;
@ -1004,7 +1004,7 @@ restore __PARAM__((register const char* name, char* ap, __V_* handle), (name, ap
*/ */
int int
prune __PARAM__((register Archive_t* ap, register File_t* f, register struct stat* st), (ap, f, st)) __OTORP__(register Archive_t* ap; register File_t* f; register struct stat* st;){ prune __PARAM__((Archive_t* ap, File_t* f, struct stat* st), (ap, f, st)) __OTORP__(Archive_t* ap; File_t* f; struct stat* st;){
if (st->st_mode == f->st->st_mode && (ap->delta && f->st->st_mtime == st->st_mtime || state.update && (unsigned long)f->st->st_mtime <= (unsigned long)st->st_mtime)) if (st->st_mode == f->st->st_mode && (ap->delta && f->st->st_mtime == st->st_mtime || state.update && (unsigned long)f->st->st_mtime <= (unsigned long)st->st_mtime))
return(1); return(1);
return(0); return(0);
@ -1017,10 +1017,10 @@ prune __PARAM__((register Archive_t* ap, register File_t* f, register struct sta
ssize_t ssize_t
holewrite __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(int fd; __V_* buf; size_t siz;){ holewrite __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(int fd; __V_* buf; size_t siz;){
register char* t = (char*)buf; char* t = (char*)buf;
register char* e = t + siz; char* e = t + siz;
register char* b = 0; char* b = 0;
register char* s; char* s;
ssize_t i; ssize_t i;
ssize_t n = 0; ssize_t n = 0;

View file

@ -123,7 +123,7 @@ delta_hi __PARAM__((long x), (x)) __OTORP__(long x;){
*/ */
static int static int
isalar __PARAM__((Archive_t* ap, register char* hdr), (ap, hdr)) __OTORP__(Archive_t* ap; register char* hdr;){ isalar __PARAM__((Archive_t* ap, char* hdr), (ap, hdr)) __OTORP__(Archive_t* ap; char* hdr;){
char buf[4]; char buf[4];
if (!strneq(hdr, "VOL1", 4)) if (!strneq(hdr, "VOL1", 4))
@ -147,7 +147,7 @@ isalar __PARAM__((Archive_t* ap, register char* hdr), (ap, hdr)) __OTORP__(Archi
*/ */
int int
getprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ getprologue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
int n; int n;
long size; long size;
@ -297,7 +297,7 @@ getprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/ */
static void static void
setinfo __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ setinfo __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
long n; long n;
if (ap->delta) if (ap->delta)
@ -318,8 +318,8 @@ setinfo __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
static void static void
putinfo __PARAM__((register Archive_t* ap, char* file, unsigned long mtime, unsigned long checksum), (ap, file, mtime, checksum)) __OTORP__(register Archive_t* ap; char* file; unsigned long mtime; unsigned long checksum;){ putinfo __PARAM__((Archive_t* ap, char* file, unsigned long mtime, unsigned long checksum), (ap, file, mtime, checksum)) __OTORP__(Archive_t* ap; char* file; unsigned long mtime; unsigned long checksum;){
register File_t* f = &ap->file; File_t* f = &ap->file;
Sfio_t* np = 0; Sfio_t* np = 0;
if (!file) if (!file)
@ -350,7 +350,7 @@ putinfo __PARAM__((register Archive_t* ap, char* file, unsigned long mtime, unsi
*/ */
void void
putprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ putprologue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
if (ap->delta && ap->delta->version == DELTA_88) if (ap->delta && ap->delta->version == DELTA_88)
ap->checksum = ap->old.checksum; ap->checksum = ap->old.checksum;
switch (ap->format) switch (ap->format)
@ -413,10 +413,10 @@ putprologue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/ */
void void
getepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ getepilogue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register char* s; char* s;
register long n; long n;
register long i; long i;
if (ap->delta && ap->delta->epilogue < 0) if (ap->delta && ap->delta->epilogue < 0)
error(3, "%s: corrupt archive: missing epilogue", ap->name); error(3, "%s: corrupt archive: missing epilogue", ap->name);
@ -491,9 +491,9 @@ getepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive
*/ */
void void
putepilogue __PARAM__((register Archive_t* ap), (ap)) __OTORP__(register Archive_t* ap;){ putepilogue __PARAM__((Archive_t* ap), (ap)) __OTORP__(Archive_t* ap;){
register long n; long n;
register unsigned long boundary; unsigned long boundary;
static int selected; static int selected;
@ -571,10 +571,10 @@ static char* ops = opsbuf; /* opsbuf output pointer */
*/ */
static void static void
getxops __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ getxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* p; char* p;
register char* s; char* s;
register int c; int c;
long n; long n;
if (f->namesize > (n = strlen(f->name) + 1)) for (p = f->name + n; c = *p++;) if (f->namesize > (n = strlen(f->name) + 1)) for (p = f->name + n; c = *p++;)
@ -613,8 +613,8 @@ getxops __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP
*/ */
static void static void
setxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){ setxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
NoP(ap); NoP(ap);
if (n = ops - opsbuf) if (n = ops - opsbuf)
@ -630,8 +630,8 @@ setxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archiv
*/ */
static void static void
putxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){ putxops __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
n = ops - opsbuf; n = ops - opsbuf;
bwrite(ap, f->name, f->namesize -= n); bwrite(ap, f->name, f->namesize -= n);
@ -644,9 +644,9 @@ putxops __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archiv
*/ */
static void static void
addxopstr __PARAM__((Archive_t* ap, int op, register char* s), (ap, op, s)) __OTORP__(Archive_t* ap; int op; register char* s;){ addxopstr __PARAM__((Archive_t* ap, int op, char* s), (ap, op, s)) __OTORP__(Archive_t* ap; int op; char* s;){
register char* p = ops; char* p = ops;
register char* e = opsbuf + sizeof(opsbuf) - 3; char* e = opsbuf + sizeof(opsbuf) - 3;
NoP(ap); NoP(ap);
if (p < e) if (p < e)
@ -681,7 +681,7 @@ addxopnum __PARAM__((Archive_t* ap, int op, long n), (ap, op, n)) __OTORP__(Arch
static void static void
getkeyname __PARAM__((Archive_t* ap, File_t* f, int index, char** nm), (ap, f, index, nm)) __OTORP__(Archive_t* ap; File_t* f; int index; char** nm;){ getkeyname __PARAM__((Archive_t* ap, File_t* f, int index, char** nm), (ap, f, index, nm)) __OTORP__(Archive_t* ap; File_t* f; int index; char** nm;){
register Option_t* op; Option_t* op;
static int uinit; static int uinit;
static int ginit; static int ginit;
@ -725,7 +725,7 @@ getkeyname __PARAM__((Archive_t* ap, File_t* f, int index, char** nm), (ap, f, i
static void static void
getkeytime __PARAM__((Archive_t* ap, File_t* f, int index, time_t* tm), (ap, f, index, tm)) __OTORP__(Archive_t* ap; File_t* f; int index; time_t* tm;){ getkeytime __PARAM__((Archive_t* ap, File_t* f, int index, time_t* tm), (ap, f, index, tm)) __OTORP__(Archive_t* ap; File_t* f; int index; time_t* tm;){
register Option_t* op; Option_t* op;
NoP(f); NoP(f);
op = &options[index]; op = &options[index];
@ -745,10 +745,10 @@ getkeytime __PARAM__((Archive_t* ap, File_t* f, int index, time_t* tm), (ap, f,
*/ */
int int
getheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ getheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register int i; int i;
register long n; long n;
char* t; char* t;
long num; long num;
int warned; int warned;
@ -1587,9 +1587,9 @@ getheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTO
static void static void
putkey __PARAM__((Sfio_t* sp, Sfio_t* tp, const char* name, int op, const char* value), (sp, tp, name, op, value)) __OTORP__(Sfio_t* sp; Sfio_t* tp; const char* name; int op; const char* value;){ putkey __PARAM__((Sfio_t* sp, Sfio_t* tp, const char* name, int op, const char* value), (sp, tp, name, op, value)) __OTORP__(Sfio_t* sp; Sfio_t* tp; const char* name; int op; const char* value;){
register const char* s; const char* s;
register int c; int c;
register int n; int n;
sfprintf(tp, " %s", name); sfprintf(tp, " %s", name);
if (op) sfputc(tp, op); if (op) sfputc(tp, op);
@ -1651,9 +1651,9 @@ putkey __PARAM__((Sfio_t* sp, Sfio_t* tp, const char* name, int op, const char*
*/ */
void void
putheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ putheader __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* s; char* s;
register int n; int n;
int c; int c;
setdeltaheader(ap, f); setdeltaheader(ap, f);
@ -2059,8 +2059,8 @@ putheader __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTO
*/ */
void void
gettrailer __PARAM__((register Archive_t* ap, File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; File_t* f;){ gettrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register long n; long n;
NoP(f); NoP(f);
if (ap->sum-- > 0) if (ap->sum-- > 0)
@ -2080,8 +2080,8 @@ gettrailer __PARAM__((register Archive_t* ap, File_t* f), (ap, f)) __OTORP__(reg
*/ */
void void
puttrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ puttrailer __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int n; int n;
putdeltatrailer(ap, f); putdeltatrailer(ap, f);
switch (ap->format) switch (ap->format)
@ -2112,9 +2112,9 @@ puttrailer __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
*/ */
int int
getlabel __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ getlabel __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register int c; int c;
register int n; int n;
static char last[5]; static char last[5];
static int done; static int done;
@ -2151,7 +2151,7 @@ getlabel __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTOR
*/ */
void void
putlabels __PARAM__((register Archive_t* ap, register File_t* f, char* type), (ap, f, type)) __OTORP__(register Archive_t* ap; register File_t* f; char* type;){ putlabels __PARAM__((Archive_t* ap, File_t* f, char* type), (ap, f, type)) __OTORP__(Archive_t* ap; File_t* f; char* type;){
struct tm* tm; struct tm* tm;
static int section = 1; static int section = 1;
@ -2192,9 +2192,9 @@ putlabels __PARAM__((register Archive_t* ap, register File_t* f, char* type), (a
*/ */
int int
getsaveset __PARAM__((register Archive_t* ap, register File_t* f, int header), (ap, f, header)) __OTORP__(register Archive_t* ap; register File_t* f; int header;){ getsaveset __PARAM__((Archive_t* ap, File_t* f, int header), (ap, f, header)) __OTORP__(Archive_t* ap; File_t* f; int header;){
register char* p; char* p;
register char* s; char* s;
char* t; char* t;
int i; int i;
long n; long n;

View file

@ -100,8 +100,8 @@
*/ */
int int
getformat __PARAM__((register char* name), (name)) __OTORP__(register char* name;){ getformat __PARAM__((char* name), (name)) __OTORP__(char* name;){
register int i; int i;
strlower(name); strlower(name);
for (i = 0; format[i].name; i++) for (i = 0; format[i].name; i++)
@ -115,9 +115,9 @@ getformat __PARAM__((register char* name), (name)) __OTORP__(register char* name
*/ */
static int static int
pathcmp __PARAM__((register const char* s, register const char* t), (s, t)) __OTORP__(register const char* s; register const char* t;){ pathcmp __PARAM__((const char* s, const char* t), (s, t)) __OTORP__(const char* s; const char* t;){
register int sc; int sc;
register int tc; int tc;
for (;;) for (;;)
{ {
@ -150,9 +150,9 @@ ordered __PARAM__((Archive_t* ap, const char* prv, const char* cur), (ap, prv, c
*/ */
int int
selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(register Archive_t* ap; register File_t* f;){ selectfile __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register Archive_t* bp; Archive_t* bp;
register Member_t* d; Member_t* d;
int linked = 0; int linked = 0;
if (f->skip || f->namesize <= 1) if (f->skip || f->namesize <= 1)
@ -200,8 +200,8 @@ selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
addlink(ap, f); addlink(ap, f);
if (state.ordered && ap->delta && ap->delta->format != COMPRESS && (bp = ap->delta->base)) if (state.ordered && ap->delta && ap->delta->format != COMPRESS && (bp = ap->delta->base))
{ {
register int n; int n;
register int m; int m;
for (;;) for (;;)
{ {
@ -266,9 +266,9 @@ selectfile __PARAM__((register Archive_t* ap, register File_t* f), (ap, f)) __OT
*/ */
int int
verify __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive_t* ap; register File_t* f;){ verify __PARAM__((Archive_t* ap, File_t* f), (ap, f)) __OTORP__(Archive_t* ap; File_t* f;){
register char* prompt; char* prompt;
register char* name; char* name;
NoP(ap); NoP(ap);
if (state.yesno) switch (state.operation) if (state.yesno) switch (state.operation)
@ -313,8 +313,8 @@ verify __PARAM__((Archive_t* ap, register File_t* f), (ap, f)) __OTORP__(Archive
*/ */
char* char*
map __PARAM__((register char* name), (name)) __OTORP__(register char* name;){ map __PARAM__((char* name), (name)) __OTORP__(char* name;){
register Map_t* mp; Map_t* mp;
char* to; char* to;
char* from; char* from;
@ -347,12 +347,12 @@ typedef struct
*/ */
static int static int
listlookup __PARAM__((__V_* handle, register const char* name, const char* arg, int cc, char** ps, long* pn), (handle, name, arg, cc, ps, pn)) __OTORP__(__V_* handle; register const char* name; const char* arg; int cc; char** ps; long* pn;){ listlookup __PARAM__((__V_* handle, const char* name, const char* arg, int cc, char** ps, long* pn), (handle, name, arg, cc, ps, pn)) __OTORP__(__V_* handle; const char* name; const char* arg; int cc; char** ps; long* pn;){
List_handle_t* gp = (List_handle_t*)handle; List_handle_t* gp = (List_handle_t*)handle;
register File_t* f = gp->file; File_t* f = gp->file;
register struct stat* st = f->st; struct stat* st = f->st;
register char* s = 0; char* s = 0;
register long n = 0; long n = 0;
Option_t* op; Option_t* op;
static Sfio_t* mp; static Sfio_t* mp;
@ -573,7 +573,7 @@ listprintf __PARAM__((Sfio_t* sp, Archive_t* ap, File_t* f, const char* format),
*/ */
void void
listentry __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){ listentry __PARAM__((File_t* f), (f)) __OTORP__(File_t* f;){
if (!f->extended && !f->skip && (state.drop || state.list || state.verbose)) if (!f->extended && !f->skip && (state.drop || state.list || state.verbose))
{ {
if (state.drop) if (state.drop)
@ -599,7 +599,7 @@ listentry __PARAM__((register File_t* f), (f)) __OTORP__(register File_t* f;){
char** char**
initmatch __PARAM__((char** p), (p)) __OTORP__(char** p;){ initmatch __PARAM__((char** p), (p)) __OTORP__(char** p;){
register char** a; char** a;
a = p; a = p;
while (*a) while (*a)
@ -612,9 +612,9 @@ initmatch __PARAM__((char** p), (p)) __OTORP__(char** p;){
*/ */
int int
match __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ match __PARAM__((char* s), (s)) __OTORP__(char* s;){
register char** p; char** p;
register char* t; char* t;
int n; int n;
if (!(p = state.patterns)) return(state.matchsense); if (!(p = state.patterns)) return(state.matchsense);
@ -646,7 +646,7 @@ match __PARAM__((register char* s), (s)) __OTORP__(register char* s;){
*/ */
int int
dirprefix __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(register char* p; register char* s;){ dirprefix __PARAM__((char* p, char* s), (p, s)) __OTORP__(char* p; char* s;){
if (*p == '.' && !*(p + 1) && *s != '/' && (*s != '.' || *(s + 1) != '.' || *(s + 2) && *(s + 2) != '/')) if (*p == '.' && !*(p + 1) && *s != '/' && (*s != '.' || *(s + 1) != '.' || *(s + 2) && *(s + 2) != '/'))
return(1); return(1);
if (*p == '/' && !*(p + 1)) if (*p == '/' && !*(p + 1))
@ -663,8 +663,8 @@ dirprefix __PARAM__((register char* p, register char* s), (p, s)) __OTORP__(regi
int int
portable __PARAM__((const char* s), (s)) __OTORP__(const char* s;){ portable __PARAM__((const char* s), (s)) __OTORP__(const char* s;){
register unsigned char* u = (unsigned char*)s; unsigned char* u = (unsigned char*)s;
register int c; int c;
while (c = *s++) while (c = *s++)
if (c > 0177) if (c > 0177)

View file

@ -117,10 +117,10 @@ static const char id[] = "\n@(#)nocom (AT&T Bell Laboratories) 08/11/94\0\n";
*/ */
static void static void
nocom __PARAM__((register Sfio_t* sp, char* file), (sp, file)) __OTORP__(register Sfio_t* sp; char* file;){ nocom __PARAM__((Sfio_t* sp, char* file), (sp, file)) __OTORP__(Sfio_t* sp; char* file;){
register int c = 0; int c = 0;
register int p; int p;
register int data = 0; int data = 0;
int sync = 0; int sync = 0;
unsigned long line = 0; unsigned long line = 0;
unsigned long prev = 0; unsigned long prev = 0;
@ -403,9 +403,9 @@ nocom __PARAM__((register Sfio_t* sp, char* file), (sp, file)) __OTORP__(registe
} }
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register int c; int c;
register char* s; char* s;
register Sfio_t* sp; Sfio_t* sp;
NoP(argc); NoP(argc);
error_info.id = "nocom"; error_info.id = "nocom";

View file

@ -777,9 +777,9 @@ interrupt __PARAM__((int sig), (sig)) __OTORP__(int sig;){
*/ */
static void static void
substitute __PARAM__((Map_t** lastmap, register char* s), (lastmap, s)) __OTORP__(Map_t** lastmap; register char* s;){ substitute __PARAM__((Map_t** lastmap, char* s), (lastmap, s)) __OTORP__(Map_t** lastmap; char* s;){
register Map_t* mp; Map_t* mp;
register int n; int n;
char* p; char* p;
for (;;) for (;;)
@ -845,9 +845,9 @@ substitute __PARAM__((Map_t** lastmap, register char* s), (lastmap, s)) __OTORP_
static void static void
help __PARAM__((void), ()){ help __PARAM__((void), ()){
register char* s; char* s;
register char* e; char* e;
register Sfio_t* sp; Sfio_t* sp;
int n; int n;
sp = sfstropen(); sp = sfstropen();
@ -880,7 +880,7 @@ help __PARAM__((void), ()){
*/ */
int int
setoption __PARAM__((__V_* a, const __V_* p, register int n, register const char* v), (a, p, n, v)) __OTORP__(__V_* a; const __V_* p; register int n; register const char* v;){ setoption __PARAM__((__V_* a, const __V_* p, int n, const char* v), (a, p, n, v)) __OTORP__(__V_* a; const __V_* p; int n; const char* v;){
int c; int c;
char* e; char* e;
char* s; char* s;
@ -1358,7 +1358,7 @@ setoption __PARAM__((__V_* a, const __V_* p, register int n, register const char
static void static void
ignore __PARAM__((void), ()){ ignore __PARAM__((void), ()){
register Option_t* op; Option_t* op;
Hash_position_t* pos; Hash_position_t* pos;
char* all; char* all;
char* ext; char* ext;
@ -1383,9 +1383,9 @@ ignore __PARAM__((void), ()){
int int
main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){
register int i; int i;
register char* s; char* s;
register Archive_t* ap; Archive_t* ap;
char* p; char* p;
Hash_position_t* pos; Hash_position_t* pos;
Option_t* op; Option_t* op;
@ -1845,10 +1845,10 @@ main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char**
void void
finish __PARAM__((int code), (code)) __OTORP__(int code;){ finish __PARAM__((int code), (code)) __OTORP__(int code;){
register Archive_t* ap; Archive_t* ap;
register char* x1 = &state.tmp.buffer[0]; char* x1 = &state.tmp.buffer[0];
register char* x2 = &state.tmp.buffer[state.buffersize / 2]; char* x2 = &state.tmp.buffer[state.buffersize / 2];
register unsigned long n; unsigned long n;
while (state.proc) while (state.proc)
{ {

View file

@ -123,9 +123,9 @@ do case $info in
cat > $tmp.c <<! cat > $tmp.c <<!
main() main()
{ {
register unsigned long i; unsigned long i;
register unsigned long j; unsigned long j;
register unsigned long k = 0; unsigned long k = 0;
for (i = 0; i < 5000; i++) for (i = 0; i < 5000; i++)
for (j = 0; j < 50000; j++) for (j = 0; j < 50000; j++)
k += j; k += j;

View file

@ -125,7 +125,7 @@ extern __MANGLE__ void _exit __PROTO__((int));
int int
atexit __PARAM__((void (*func)(void)), (func)) __OTORP__(void (*func)();){ atexit __PARAM__((void (*func)(void)), (func)) __OTORP__(void (*func)();){
register struct list* p; struct list* p;
if (!(p = newof(0, struct list, 1, 0))) return(-1); if (!(p = newof(0, struct list, 1, 0))) return(-1);
p->func = func; p->func = func;
@ -136,7 +136,7 @@ atexit __PARAM__((void (*func)(void)), (func)) __OTORP__(void (*func)();){
void void
_ast_atexit __PARAM__((void), ()){ _ast_atexit __PARAM__((void), ()){
register struct list* p; struct list* p;
while (p = funclist) while (p = funclist)
{ {

View file

@ -116,7 +116,7 @@ ast_getgroups __PARAM__((int len, gid_t* set), (len, set)) __OTORP__(int len; gi
#undef NGROUPS_MAX #undef NGROUPS_MAX
#define NGROUPS_MAX 1 #define NGROUPS_MAX 1
#endif #endif
register int i; int i;
int big[NGROUPS_MAX]; int big[NGROUPS_MAX];
#else #else
#undef NGROUPS_MAX #undef NGROUPS_MAX

View file

@ -105,10 +105,10 @@ NoN(memccpy)
*/ */
__V_* __V_*
memccpy __PARAM__((__V_* as1, const __V_* as2, register int c, size_t n), (as1, as2, c, n)) __OTORP__(__V_* as1; const __V_* as2; register int c; size_t n;){ memccpy __PARAM__((__V_* as1, const __V_* as2, int c, size_t n), (as1, as2, c, n)) __OTORP__(__V_* as1; const __V_* as2; int c; size_t n;){
register char* s1 = (char*)as1; char* s1 = (char*)as1;
register const char* s2 = (char*)as2; const char* s2 = (char*)as2;
register const char* ep = s2 + n; const char* ep = s2 + n;
while (s2 < ep) while (s2 < ep)
if ((*s1++ = *s2++) == c) if ((*s1++ = *s2++) == c)

View file

@ -104,9 +104,9 @@ NoN(memchr)
*/ */
__V_* __V_*
memchr __PARAM__((const __V_* asp, register int c, size_t n), (asp, c, n)) __OTORP__(const __V_* asp; register int c; size_t n;){ memchr __PARAM__((const __V_* asp, int c, size_t n), (asp, c, n)) __OTORP__(const __V_* asp; int c; size_t n;){
register const char* sp = (char*)asp; const char* sp = (char*)asp;
register const char* ep = sp + n; const char* ep = sp + n;
while (sp < ep) while (sp < ep)
if (*sp++ == c) if (*sp++ == c)

View file

@ -100,9 +100,9 @@ NoN(memcmp)
int int
memcmp __PARAM__((const __V_* ab1, const __V_* ab2, size_t n), (ab1, ab2, n)) __OTORP__(const __V_* ab1; const __V_* ab2; size_t n;){ memcmp __PARAM__((const __V_* ab1, const __V_* ab2, size_t n), (ab1, ab2, n)) __OTORP__(const __V_* ab1; const __V_* ab2; size_t n;){
register const unsigned char* b1 = (const unsigned char*)ab1; const unsigned char* b1 = (const unsigned char*)ab1;
register const unsigned char* b2 = (const unsigned char*)ab2; const unsigned char* b2 = (const unsigned char*)ab2;
register const unsigned char* e = b1 + n; const unsigned char* e = b1 + n;
while (b1 < e) while (b1 < e)
if (*b1++ != *b2++) if (*b1++ != *b2++)

View file

@ -113,9 +113,9 @@ memcpy __PARAM__((__V_* s1, __V_* s2, size_t n), (s1, s2, n)) __OTORP__(__V_* s1
#else #else
__V_* __V_*
memcpy __PARAM__((__V_* as1, const __V_* as2, register size_t n), (as1, as2, n)) __OTORP__(__V_* as1; const __V_* as2; register size_t n;){ memcpy __PARAM__((__V_* as1, const __V_* as2, size_t n), (as1, as2, n)) __OTORP__(__V_* as1; const __V_* as2; size_t n;){
register char* s1 = (char*)as1; char* s1 = (char*)as1;
register const char* s2 = (const char*)as2; const char* s2 = (const char*)as2;
while (n-- > 0) while (n-- > 0)
*s1++ = *s2++; *s1++ = *s2++;

View file

@ -99,9 +99,9 @@ NoN(memmove)
#else #else
__V_* __V_*
memmove __PARAM__((__V_* to, const __V_* from, register size_t n), (to, from, n)) __OTORP__(__V_* to; const __V_* from; register size_t n;){ memmove __PARAM__((__V_* to, const __V_* from, size_t n), (to, from, n)) __OTORP__(__V_* to; const __V_* from; size_t n;){
register char* out = (char*)to; char* out = (char*)to;
register char* in = (char*)from; char* in = (char*)from;
if (n <= 0) /* works if size_t is signed or not */ if (n <= 0) /* works if size_t is signed or not */
; ;

View file

@ -99,8 +99,8 @@ NoN(memset)
#else #else
__V_* __V_*
memset __PARAM__((__V_* asp, register int c, register size_t n), (asp, c, n)) __OTORP__(__V_* asp; register int c; register size_t n;){ memset __PARAM__((__V_* asp, int c, size_t n), (asp, c, n)) __OTORP__(__V_* asp; int c; size_t n;){
register char* sp = (char*)asp; char* sp = (char*)asp;
while (n-- > 0) while (n-- > 0)
*sp++ = c; *sp++ = c;

View file

@ -104,7 +104,7 @@ NoN(mkdir)
int int
mkdir __PARAM__((const char* path, mode_t mode), (path, mode)) __OTORP__(const char* path; mode_t mode;){ mkdir __PARAM__((const char* path, mode_t mode), (path, mode)) __OTORP__(const char* path; mode_t mode;){
register int n; int n;
char* av[3]; char* av[3];
static char* cmd[] = { "/bin/mkdir", "/usr/5bin/mkdir", 0 }; static char* cmd[] = { "/bin/mkdir", "/usr/5bin/mkdir", 0 };

View file

@ -103,7 +103,7 @@ NoN(rmdir)
int int
rmdir __PARAM__((const char* path), (path)) __OTORP__(const char* path;){ rmdir __PARAM__((const char* path), (path)) __OTORP__(const char* path;){
register int n; int n;
struct stat st; struct stat st;
char* av[3]; char* av[3];

View file

@ -104,10 +104,10 @@ typedef struct
} Locale_t; } Locale_t;
char* char*
_ast_setlocale __PARAM__((register int category, const char* locale), (category, locale)) __OTORP__(register int category; const char* locale;){ _ast_setlocale __PARAM__((int category, const char* locale), (category, locale)) __OTORP__(int category; const char* locale;){
#if _hdr_locale && _lib_setlocale #if _hdr_locale && _lib_setlocale
register Locale_t* lc; Locale_t* lc;
register char* p; char* p;
static Locale_t def[] = static Locale_t def[] =
{ {

View file

@ -176,9 +176,9 @@ spawnveg __PARAM__((const char* cmd, char* const argv[], char* const envv[], pid
execve(cmd, argv, envv); execve(cmd, argv, envv);
if (errno == ENOEXEC) if (errno == ENOEXEC)
{ {
register char** o; char** o;
register char** p; char** p;
register char** v; char** v;
for (p = o = (char**)argv; *p; p++); for (p = o = (char**)argv; *p; p++);
if (v = newof(0, char*, p - o + 2, 0)) if (v = newof(0, char*, p - o + 2, 0))

View file

@ -126,7 +126,7 @@ NoN(statvfs)
#endif #endif
static void static void
us2v __PARAM__((register struct statfs* ufs, register struct stat* st, register struct statvfs* vfs), (ufs, st, vfs)) __OTORP__(register struct statfs* ufs; register struct stat* st; register struct statvfs* vfs;){ us2v __PARAM__((struct statfs* ufs, struct stat* st, struct statvfs* vfs), (ufs, st, vfs)) __OTORP__(struct statfs* ufs; struct stat* st; struct statvfs* vfs;){
memset(vfs, 0, sizeof(*vfs)); memset(vfs, 0, sizeof(*vfs));
vfs->f_bsize = vfs->f_frsize = ufs->f_bsize; vfs->f_bsize = vfs->f_frsize = ufs->f_bsize;
vfs->f_blocks = ufs->f_blocks; vfs->f_blocks = ufs->f_blocks;
@ -171,7 +171,7 @@ statvfs __PARAM__((const char* path, struct statvfs* vfs), (path, vfs)) __OTORP_
#else #else
static void static void
s2v __PARAM__((register struct stat* st, register struct statvfs* vfs), (st, vfs)) __OTORP__(register struct stat* st; register struct statvfs* vfs;){ s2v __PARAM__((struct stat* st, struct statvfs* vfs), (st, vfs)) __OTORP__(struct stat* st; struct statvfs* vfs;){
memset(vfs, 0, sizeof(*vfs)); memset(vfs, 0, sizeof(*vfs));
vfs->f_bsize = vfs->f_frsize = vfs->f_bsize = vfs->f_frsize =
#if _mem_st_blksize_stat #if _mem_st_blksize_stat

View file

@ -114,7 +114,7 @@ strchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;
#else #else
char* char*
strchr __PARAM__((register const char* s, register int c), (s, c)) __OTORP__(register const char* s; register int c;){ strchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;){
do if (*s == c) return((char*)s); while(*s++); do if (*s == c) return((char*)s); while(*s++);
return(0); return(0);
} }

View file

@ -114,8 +114,8 @@ strrchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c
#else #else
char* char*
strrchr __PARAM__((register const char* s, register int c), (s, c)) __OTORP__(register const char* s; register int c;){ strrchr __PARAM__((const char* s, int c), (s, c)) __OTORP__(const char* s; int c;){
register const char* r; const char* r;
r = 0; r = 0;
do if (*s == c) r = s; while(*s++); do if (*s == c) r = s; while(*s++);

View file

@ -103,7 +103,7 @@ NoN(strtod)
extern __MANGLE__ double atof __PROTO__((const char*)); extern __MANGLE__ double atof __PROTO__((const char*));
double double
strtod __PARAM__((register const char* s, char** e), (s, e)) __OTORP__(register const char* s; char** e;){ strtod __PARAM__((const char* s, char** e), (s, e)) __OTORP__(const char* s; char** e;){
double n; double n;
n = atof(s); n = atof(s);

View file

@ -106,9 +106,9 @@ NoN(strtol)
#define MBASE ('z' - 'a' + 1 + 10) #define MBASE ('z' - 'a' + 1 + 10)
long long
strtol __PARAM__((register const char* str, char** ptr, register int base), (str, ptr, base)) __OTORP__(register const char* str; char** ptr; register int base;){ strtol __PARAM__((const char* str, char** ptr, int base), (str, ptr, base)) __OTORP__(const char* str; char** ptr; int base;){
register long val; long val;
register int c; int c;
int xx, neg = 0; int xx, neg = 0;
if (ptr) if (ptr)

View file

@ -112,8 +112,8 @@ static char buf[L_tmpnam];
static char seed[] = { 'a', 'a', 'a', 0 }; static char seed[] = { 'a', 'a', 'a', 0 };
char* char*
tmpnam __PARAM__((register char* p), (p)) __OTORP__(register char* p;){ tmpnam __PARAM__((char* p), (p)) __OTORP__(char* p;){
register char* q; char* q;
if (!p) p = buf; if (!p) p = buf;
strcopy(strcopy(strcopy(p, P_tmpdir), seed), "XXXXXX"); strcopy(strcopy(strcopy(p, P_tmpdir), seed), "XXXXXX");

View file

@ -157,9 +157,9 @@ struct zombie
pid_t pid_t
waitpid __PARAM__((pid_t pid, int* status, int flags), (pid, status, flags)) __OTORP__(pid_t pid; int* status; int flags;){ waitpid __PARAM__((pid_t pid, int* status, int flags), (pid, status, flags)) __OTORP__(pid_t pid; int* status; int flags;){
register struct zombie* zp; struct zombie* zp;
register struct zombie* pp; struct zombie* pp;
register int p; int p;
int s; int s;
#if !_lib_wait2 && !_lib_wait3 #if !_lib_wait2 && !_lib_wait3
#if !defined(SIGCLD) #if !defined(SIGCLD)

View file

@ -144,8 +144,8 @@ getdents __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(in
#else #else
#if _lib_dirread #if _lib_dirread
{ {
register char* sp; /* system */ char* sp; /* system */
register struct dirent* up; /* user */ struct dirent* up; /* user */
char* u; char* u;
int n; int n;
int m; int m;
@ -187,10 +187,10 @@ getdents __PARAM__((int fd, __V_* buf, size_t siz), (fd, buf, siz)) __OTORP__(in
#define MAXREC roundof(sizeof(*up)-sizeof(up->d_name)+sizeof(sp->d_name)+1,8) #define MAXREC roundof(sizeof(*up)-sizeof(up->d_name)+sizeof(sp->d_name)+1,8)
register struct direct* sp; /* system */ struct direct* sp; /* system */
register struct dirent* up; /* user */ struct dirent* up; /* user */
register char* s; char* s;
register char* u; char* u;
int n; int n;
int m; int m;
char tmp[sizeof(sp->d_name) + 1]; char tmp[sizeof(sp->d_name) + 1];

View file

@ -103,9 +103,9 @@ static const char id_dir[] = "\n@(#)directory (AT&T Bell Laboratories) 04/01/93\
static DIR* freedirp; /* always keep one dirp */ static DIR* freedirp; /* always keep one dirp */
DIR* DIR*
opendir __PARAM__((register const char* path), (path)) __OTORP__(register const char* path;){ opendir __PARAM__((const char* path), (path)) __OTORP__(const char* path;){
register DIR* dirp = 0; DIR* dirp = 0;
register int fd; int fd;
struct stat st; struct stat st;
if ((fd = open(path, 0)) < 0) return(0); if ((fd = open(path, 0)) < 0) return(0);
@ -138,7 +138,7 @@ opendir __PARAM__((register const char* path), (path)) __OTORP__(register const
} }
void void
closedir __PARAM__((register DIR* dirp), (dirp)) __OTORP__(register DIR* dirp;){ closedir __PARAM__((DIR* dirp), (dirp)) __OTORP__(DIR* dirp;){
if (dirp) if (dirp)
{ {
close(dirp->dd_fd); close(dirp->dd_fd);

View file

@ -99,8 +99,8 @@ NoN(readdir)
#else #else
struct dirent* struct dirent*
readdir __PARAM__((register DIR* dirp), (dirp)) __OTORP__(register DIR* dirp;){ readdir __PARAM__((DIR* dirp), (dirp)) __OTORP__(DIR* dirp;){
register struct dirent* dp; struct dirent* dp;
for (;;) for (;;)
{ {

View file

@ -99,7 +99,7 @@ NoN(seekdir)
#else #else
void void
seekdir __PARAM__((register DIR* dirp, long loc), (dirp, loc)) __OTORP__(register DIR* dirp; long loc;){ seekdir __PARAM__((DIR* dirp, long loc), (dirp, loc)) __OTORP__(DIR* dirp; long loc;){
off_t base; /* file location of block */ off_t base; /* file location of block */
off_t offset; /* offset within block */ off_t offset; /* offset within block */

View file

@ -134,12 +134,12 @@ typedef union
#define initfield(f,s) ((f)->first = (f)->delimiter = *((f)->next = (s))) #define initfield(f,s) ((f)->first = (f)->delimiter = *((f)->next = (s)))
static char* static char*
getfield __PARAM__((register Field_t* f, int restore), (f, restore)) __OTORP__(register Field_t* f; int restore;){ getfield __PARAM__((Field_t* f, int restore), (f, restore)) __OTORP__(Field_t* f; int restore;){
register char* s; char* s;
register int n; int n;
register int c; int c;
register int lp; int lp;
register int rp; int rp;
char* b; char* b;
if (!f->delimiter) if (!f->delimiter)
@ -414,7 +414,7 @@ int aha = *f.next;
int int
sfkeyprintf __PARAM__((Sfio_t* sp, __V_* handle, const char* format, Sf_key_lookup_t lookup, Sf_key_convert_t convert), (sp, handle, format, lookup, convert)) __OTORP__(Sfio_t* sp; __V_* handle; const char* format; Sf_key_lookup_t lookup; Sf_key_convert_t convert;){ sfkeyprintf __PARAM__((Sfio_t* sp, __V_* handle, const char* format, Sf_key_lookup_t lookup, Sf_key_convert_t convert), (sp, handle, format, lookup, convert)) __OTORP__(Sfio_t* sp; __V_* handle; const char* format; Sf_key_lookup_t lookup; Sf_key_convert_t convert;){
register int i; int i;
for (i = 0; i < elementsof(state.tmp); i++) for (i = 0; i < elementsof(state.tmp); i++)
if (!state.tmp[i] && !(state.tmp[i] = sfstropen())) if (!state.tmp[i] && !(state.tmp[i] = sfstropen()))

View file

@ -118,9 +118,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main() main()
{ {
register int i; int i;
register int j; int j;
register int k; int k;
int align0; int align0;
int align1; int align1;

View file

@ -111,7 +111,7 @@ main()
#if _lib_getgroups #if _lib_getgroups
if (sizeof(gid_t) < sizeof(int)) if (sizeof(gid_t) < sizeof(int))
{ {
register int n; int n;
gid_t groups[32 * sizeof(int) / sizeof(gid_t)]; gid_t groups[32 * sizeof(int) / sizeof(gid_t)];
for (n = 0; n < sizeof(int) / sizeof(gid_t); n++) for (n = 0; n < sizeof(int) / sizeof(gid_t); n++)

View file

@ -132,9 +132,9 @@ static int size[] = { 1, 2, 4, 8 };
main() main()
{ {
register int t; int t;
register int s; int s;
register int m = 1; int m = 1;
for (s = 0; s < elementsof(size); s++) for (s = 0; s < elementsof(size); s++)
{ {

View file

@ -154,8 +154,8 @@ static char* cmd[] = { "/bin/echo", 0 };
main() main()
{ {
register int i; int i;
register int n; int n;
char c; char c;
unsigned char uc; unsigned char uc;

View file

@ -258,9 +258,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main() main()
{ {
register int i; int i;
register int j; int j;
register int k; int k;
k = 0; k = 0;
for (i = 0; map[i].name; i++) for (i = 0; map[i].name; i++)

View file

@ -110,9 +110,9 @@ extern __MANGLE__ int printf __PROTO__((const char*, ...));
main() main()
{ {
register int i; int i;
register int j; int j;
register int k; int k;
int align0; int align0;
int align1; int align1;

View file

@ -103,7 +103,7 @@ main()
#if _lib_getgroups #if _lib_getgroups
if (sizeof(gid_t) < sizeof(int)) if (sizeof(gid_t) < sizeof(int))
{ {
register int n; int n;
gid_t groups[32 * sizeof(int) / sizeof(gid_t)]; gid_t groups[32 * sizeof(int) / sizeof(gid_t)];
for (n = 0; n < sizeof(int) / sizeof(gid_t); n++) for (n = 0; n < sizeof(int) / sizeof(gid_t); n++)

View file

@ -124,9 +124,9 @@ static int size[] = { 1, 2, 4, 8 };
main() main()
{ {
register int t; int t;
register int s; int s;
register int m = 1; int m = 1;
for (s = 0; s < elementsof(size); s++) for (s = 0; s < elementsof(size); s++)
{ {

Some files were not shown because too many files have changed in this diff Show more