General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
This commit is contained in:
parent
af7a299930
commit
51295a4d3e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=17141
@ -126,7 +126,7 @@ TclGetTimeZone (currentTime)
|
|||||||
#if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE)
|
#if defined(HAVE_TM_GMTOFF) && !defined (TCL_GOT_TIMEZONE)
|
||||||
# define TCL_GOT_TIMEZONE
|
# define TCL_GOT_TIMEZONE
|
||||||
time_t curTime = (time_t) currentTime;
|
time_t curTime = (time_t) currentTime;
|
||||||
struct tm *timeDataPtr = localtime(¤tTime);
|
struct tm *timeDataPtr = localtime(&curTime);
|
||||||
int timeZone;
|
int timeZone;
|
||||||
|
|
||||||
timeZone = -(timeDataPtr->tm_gmtoff / 60);
|
timeZone = -(timeDataPtr->tm_gmtoff / 60);
|
||||||
|
@ -12,7 +12,5 @@ int abort_(void)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
sig_die("Fortran abort routine called", 1);
|
sig_die("Fortran abort routine called", 1);
|
||||||
#ifdef __cplusplus
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -8,14 +8,12 @@
|
|||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
extern VOID s_copy();
|
extern VOID s_copy();
|
||||||
ef1asc_(a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
|
int ef1asc_(a, la, b, lb) ftnint *a, *b; ftnlen *la, *lb;
|
||||||
#else
|
#else
|
||||||
extern void s_copy(char*,char*,ftnlen,ftnlen);
|
extern void s_copy(char*,char*,ftnlen,ftnlen);
|
||||||
int ef1asc_(ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
|
int ef1asc_(ftnint *a, ftnlen *la, ftnint *b, ftnlen *lb)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
|
s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
|
||||||
#ifdef __cplusplus
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ for(fp = fname ; fp < flast ; ++fp)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (ep = *env++)
|
while ( (ep = *env++) )
|
||||||
{
|
{
|
||||||
for(fp = fname; fp<flast ; )
|
for(fp = fname; fp<flast ; )
|
||||||
if(*fp++ != *ep++)
|
if(*fp++ != *ep++)
|
||||||
|
@ -90,6 +90,7 @@ sig_die("Trace trap", 1);
|
|||||||
int xargc;
|
int xargc;
|
||||||
char **xargv;
|
char **xargv;
|
||||||
|
|
||||||
|
int
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
main(argc, argv) int argc; char **argv;
|
main(argc, argv) int argc; char **argv;
|
||||||
#else
|
#else
|
||||||
|
@ -20,7 +20,5 @@ fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1
|
|||||||
while((i = *varn) && i != ' ')
|
while((i = *varn) && i != ' ')
|
||||||
putc(*varn++, stderr);
|
putc(*varn++, stderr);
|
||||||
sig_die(".", 1);
|
sig_die(".", 1);
|
||||||
#ifdef __cplusplus
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "fio.h"
|
#include "fio.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
|
|
||||||
|
int
|
||||||
y_rsk(Void)
|
y_rsk(Void)
|
||||||
{
|
{
|
||||||
if(f__curunit->uend || f__curunit->url <= f__recpos
|
if(f__curunit->uend || f__curunit->url <= f__recpos
|
||||||
@ -11,6 +12,8 @@ y_rsk(Void)
|
|||||||
} while(++f__recpos < f__curunit->url);
|
} while(++f__recpos < f__curunit->url);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
y_getc(Void)
|
y_getc(Void)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
@ -30,10 +33,10 @@ y_getc(Void)
|
|||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
err(f__elist->cierr,errno,"readingd");
|
err(f__elist->cierr,errno,"readingd");
|
||||||
#ifdef __cplusplus
|
|
||||||
return 0;
|
return 0;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
y_putc(c)
|
y_putc(c)
|
||||||
#else
|
#else
|
||||||
@ -47,6 +50,8 @@ y_putc(int c)
|
|||||||
err(f__elist->cierr,110,"dout");
|
err(f__elist->cierr,110,"dout");
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
y_rev(Void)
|
y_rev(Void)
|
||||||
{ /*what about work done?*/
|
{ /*what about work done?*/
|
||||||
if(f__curunit->url==1 || f__recpos==f__curunit->url)
|
if(f__curunit->url==1 || f__recpos==f__curunit->url)
|
||||||
@ -56,6 +61,8 @@ y_rev(Void)
|
|||||||
f__recpos=0;
|
f__recpos=0;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
y_err(Void)
|
y_err(Void)
|
||||||
{
|
{
|
||||||
err(f__elist->cierr, 110, "dfe");
|
err(f__elist->cierr, 110, "dfe");
|
||||||
@ -64,6 +71,7 @@ y_err(Void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
y_newrec(Void)
|
y_newrec(Void)
|
||||||
{
|
{
|
||||||
if(f__curunit->url == 1 || f__recpos == f__curunit->url) {
|
if(f__curunit->url == 1 || f__recpos == f__curunit->url) {
|
||||||
@ -77,6 +85,7 @@ y_newrec(Void)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_dfe(a) cilist *a;
|
c_dfe(a) cilist *a;
|
||||||
#else
|
#else
|
||||||
@ -108,7 +117,7 @@ integer s_rdfe(cilist *a)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
if(n=c_dfe(a))return(n);
|
if( (n=c_dfe(a)) )return(n);
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
||||||
err(a->cierr,errno,"read start");
|
err(a->cierr,errno,"read start");
|
||||||
@ -130,7 +139,7 @@ integer s_wdfe(cilist *a)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
if(n=c_dfe(a)) return(n);
|
if( (n=c_dfe(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
||||||
err(a->cierr,errno,"startwrt");
|
err(a->cierr,errno,"startwrt");
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "f2c.h"
|
#include "f2c.h"
|
||||||
#include "fio.h"
|
#include "fio.h"
|
||||||
|
|
||||||
|
int
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_due(a) cilist *a;
|
c_due(a) cilist *a;
|
||||||
#else
|
#else
|
||||||
@ -30,7 +31,7 @@ integer s_rdue(cilist *a)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(n=c_due(a)) return(n);
|
if( (n=c_due(a)) ) return(n);
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
||||||
err(a->cierr,errno,"read start");
|
err(a->cierr,errno,"read start");
|
||||||
@ -43,7 +44,7 @@ integer s_wdue(cilist *a)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(n=c_due(a)) return(n);
|
if( (n=c_due(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
||||||
err(a->cierr,errno,"write start");
|
err(a->cierr,errno,"write start");
|
||||||
|
@ -43,7 +43,7 @@ integer f_end(alist *a)
|
|||||||
(void) sprintf(nbuf,"fort.%ld",a->aunit);
|
(void) sprintf(nbuf,"fort.%ld",a->aunit);
|
||||||
#ifdef NON_UNIX_STDIO
|
#ifdef NON_UNIX_STDIO
|
||||||
{ FILE *tf;
|
{ FILE *tf;
|
||||||
if (tf = fopen(nbuf, f__w_mode[0]))
|
if ( (tf = fopen(nbuf, f__w_mode[0])) )
|
||||||
fclose(tf);
|
fclose(tf);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -63,7 +63,7 @@ copy(from, len, to) char *from, *to; register long len;
|
|||||||
copy(FILE *from, register long len, FILE *to)
|
copy(FILE *from, register long len, FILE *to)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int k, len1;
|
int len1;
|
||||||
char buf[BUFSIZ];
|
char buf[BUFSIZ];
|
||||||
|
|
||||||
while(fread(buf, len1 = len > BUFSIZ ? BUFSIZ : (int)len, 1, from)) {
|
while(fread(buf, len1 = len > BUFSIZ ? BUFSIZ : (int)len, 1, from)) {
|
||||||
|
@ -78,9 +78,9 @@ char *F_err[] =
|
|||||||
#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
|
#define MAXERR (sizeof(F_err)/sizeof(char *)+100)
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
f__canseek(f) FILE *f; /*SYSDEP*/
|
int f__canseek(f) FILE *f; /*SYSDEP*/
|
||||||
#else
|
#else
|
||||||
f__canseek(FILE *f) /*SYSDEP*/
|
int f__canseek(FILE *f) /*SYSDEP*/
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef NON_UNIX_STDIO
|
#ifdef NON_UNIX_STDIO
|
||||||
@ -187,9 +187,9 @@ f_init(Void)
|
|||||||
p->uwrt=1;
|
p->uwrt=1;
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
f__nowreading(x) unit *x;
|
int f__nowreading(x) unit *x;
|
||||||
#else
|
#else
|
||||||
f__nowreading(unit *x)
|
int f__nowreading(unit *x)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
long loc;
|
long loc;
|
||||||
@ -210,9 +210,9 @@ f__nowreading(unit *x)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
f__nowwriting(x) unit *x;
|
int f__nowwriting(x) unit *x;
|
||||||
#else
|
#else
|
||||||
f__nowwriting(unit *x)
|
int f__nowwriting(unit *x)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
long loc;
|
long loc;
|
||||||
|
@ -80,8 +80,8 @@ extern int (*f__doend)(Void);
|
|||||||
extern FILE *f__cf; /*current file*/
|
extern FILE *f__cf; /*current file*/
|
||||||
extern unit *f__curunit; /*current unit*/
|
extern unit *f__curunit; /*current unit*/
|
||||||
extern unit f__units[];
|
extern unit f__units[];
|
||||||
#define err(f,m,s) {if(f) errno= m; else f__fatal(m,s); return(m);}
|
#define err(f,m,s) {if( (f) ) errno=(m); else f__fatal((m),(s)); return((m));}
|
||||||
#define errfl(f,m,s) return err__fl((int)f,m,s)
|
#define errfl(f,m,s) return err__fl((int)(f),(m),(s))
|
||||||
|
|
||||||
/*Table sizes*/
|
/*Table sizes*/
|
||||||
#define MXUNIT 100
|
#define MXUNIT 100
|
||||||
@ -99,4 +99,4 @@ extern int f__hiwater; /* so TL doesn't confuse us */
|
|||||||
#define EXT 7
|
#define EXT 7
|
||||||
#define INT 8
|
#define INT 8
|
||||||
|
|
||||||
#define buf_end(x) (x->_flag & _IONBF ? x->_ptr : x->_base + BUFSIZ)
|
#define buf_end(x) ((x)->_flag & _IONBF ? (x)->_ptr : (x)->_base + BUFSIZ)
|
||||||
|
@ -40,9 +40,9 @@ char *ap_end(char *s)
|
|||||||
/*NOTREACHED*/ return 0;
|
/*NOTREACHED*/ return 0;
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
op_gen(a,b,c,d)
|
int op_gen(a,b,c,d)
|
||||||
#else
|
#else
|
||||||
op_gen(int a, int b, int c, int d)
|
int op_gen(int a, int b, int c, int d)
|
||||||
#endif
|
#endif
|
||||||
{ struct syl *p= &f__syl[f__pc];
|
{ struct syl *p= &f__syl[f__pc];
|
||||||
if(f__pc>=SYLMX)
|
if(f__pc>=SYLMX)
|
||||||
@ -99,9 +99,9 @@ char *f_s(char *s, int curloc)
|
|||||||
return(s);
|
return(s);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
ne_d(s,p) char *s,**p;
|
int ne_d(s,p) char *s,**p;
|
||||||
#else
|
#else
|
||||||
ne_d(char *s, char **p)
|
int ne_d(char *s, char **p)
|
||||||
#endif
|
#endif
|
||||||
{ int n,x,sign=0;
|
{ int n,x,sign=0;
|
||||||
struct syl *sp;
|
struct syl *sp;
|
||||||
@ -185,9 +185,9 @@ ne_d(char *s, char **p)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
e_d(s,p) char *s,**p;
|
int e_d(s,p) char *s,**p;
|
||||||
#else
|
#else
|
||||||
e_d(char *s, char **p)
|
int e_d(char *s, char **p)
|
||||||
#endif
|
#endif
|
||||||
{ int i,im,n,w,d,e,found=0,x=0;
|
{ int i,im,n,w,d,e,found=0,x=0;
|
||||||
char *sv=s;
|
char *sv=s;
|
||||||
@ -333,9 +333,9 @@ char *f_list(char *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
pars_f(s) char *s;
|
int pars_f(s) char *s;
|
||||||
#else
|
#else
|
||||||
pars_f(char *s)
|
int pars_f(char *s)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
f__parenlvl=f__revloc=f__pc=0;
|
f__parenlvl=f__revloc=f__pc=0;
|
||||||
@ -350,9 +350,9 @@ int f__cnt[STKSZ],f__ret[STKSZ],f__cp,f__rp;
|
|||||||
flag f__workdone, f__nonl;
|
flag f__workdone, f__nonl;
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
type_f(n)
|
int type_f(n)
|
||||||
#else
|
#else
|
||||||
type_f(int n)
|
int type_f(int n)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
switch(n)
|
switch(n)
|
||||||
@ -476,6 +476,8 @@ loop: switch(type_f((p= &f__syl[f__pc])->op))
|
|||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
en_fio(Void)
|
en_fio(Void)
|
||||||
{ ftnint one=1;
|
{ ftnint one=1;
|
||||||
return(do_fio(&one,(char *)NULL,(ftnint)0));
|
return(do_fio(&one,(char *)NULL,(ftnint)0));
|
||||||
|
@ -6,6 +6,8 @@ char *f__icend;
|
|||||||
extern icilist *f__svic;
|
extern icilist *f__svic;
|
||||||
int f__icnum;
|
int f__icnum;
|
||||||
extern int f__hiwater;
|
extern int f__hiwater;
|
||||||
|
|
||||||
|
int
|
||||||
z_getc(Void)
|
z_getc(Void)
|
||||||
{
|
{
|
||||||
if(f__recpos++ < f__svic->icirlen) {
|
if(f__recpos++ < f__svic->icirlen) {
|
||||||
@ -15,9 +17,9 @@ z_getc(Void)
|
|||||||
return '\n';
|
return '\n';
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
z_putc(c)
|
int z_putc(c)
|
||||||
#else
|
#else
|
||||||
z_putc(int c)
|
int z_putc(int c)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(f__icptr >= f__icend) err(f__svic->icierr,110,"inwrite");
|
if(f__icptr >= f__icend) err(f__svic->icierr,110,"inwrite");
|
||||||
@ -26,6 +28,8 @@ z_putc(int c)
|
|||||||
else err(f__svic->icierr,110,"recend");
|
else err(f__svic->icierr,110,"recend");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
z_rnew(Void)
|
z_rnew(Void)
|
||||||
{
|
{
|
||||||
f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
|
f__icptr = f__svic->iciunit + (++f__icnum)*f__svic->icirlen;
|
||||||
@ -43,9 +47,9 @@ z_endp(Void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_si(a) icilist *a;
|
int c_si(a) icilist *a;
|
||||||
#else
|
#else
|
||||||
c_si(icilist *a)
|
int c_si(icilist *a)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
f__elist = (cilist *)a;
|
f__elist = (cilist *)a;
|
||||||
@ -82,7 +86,7 @@ integer s_rsfi(a) icilist *a;
|
|||||||
integer s_rsfi(icilist *a)
|
integer s_rsfi(icilist *a)
|
||||||
#endif
|
#endif
|
||||||
{ int n;
|
{ int n;
|
||||||
if(n=c_si(a)) return(n);
|
if( (n=c_si(a)) ) return(n);
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
f__doed=rd_ed;
|
f__doed=rd_ed;
|
||||||
f__doned=rd_ned;
|
f__doned=rd_ned;
|
||||||
@ -93,6 +97,7 @@ integer s_rsfi(icilist *a)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
z_wnew(Void)
|
z_wnew(Void)
|
||||||
{
|
{
|
||||||
if (f__recpos < f__hiwater) {
|
if (f__recpos < f__hiwater) {
|
||||||
@ -113,7 +118,7 @@ integer s_wsfi(a) icilist *a;
|
|||||||
integer s_wsfi(icilist *a)
|
integer s_wsfi(icilist *a)
|
||||||
#endif
|
#endif
|
||||||
{ int n;
|
{ int n;
|
||||||
if(n=c_si(a)) return(n);
|
if( (n=c_si(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
f__doed=w_ed;
|
f__doed=w_ed;
|
||||||
f__doned=w_ned;
|
f__doned=w_ned;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <unistd.h>
|
||||||
#include "f2c.h"
|
#include "f2c.h"
|
||||||
#include "fio.h"
|
#include "fio.h"
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
@ -53,7 +54,7 @@ integer f_inqu(inlist *a)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(a->inex!=NULL)
|
if(a->inex!=NULL)
|
||||||
if(byfile && x != -1 || !byfile && p!=NULL)
|
if((byfile && x != -1) || (!byfile && p!=NULL))
|
||||||
*a->inex=1;
|
*a->inex=1;
|
||||||
else *a->inex=0;
|
else *a->inex=0;
|
||||||
if(a->inopen!=NULL)
|
if(a->inopen!=NULL)
|
||||||
@ -61,7 +62,7 @@ integer f_inqu(inlist *a)
|
|||||||
else *a->inopen=(p!=NULL && p->ufd!=NULL);
|
else *a->inopen=(p!=NULL && p->ufd!=NULL);
|
||||||
if(a->innum!=NULL) *a->innum= p-f__units;
|
if(a->innum!=NULL) *a->innum= p-f__units;
|
||||||
if(a->innamed!=NULL)
|
if(a->innamed!=NULL)
|
||||||
if(byfile || p!=NULL && p->ufnm!=NULL)
|
if(byfile || (p!=NULL && p->ufnm!=NULL))
|
||||||
*a->innamed=1;
|
*a->innamed=1;
|
||||||
else *a->innamed=0;
|
else *a->innamed=0;
|
||||||
if(a->inname!=NULL)
|
if(a->inname!=NULL)
|
||||||
|
@ -67,6 +67,7 @@ extern int ungetc(int, FILE*); /* for systems with a buggy stdio.h */
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
t_getc(Void)
|
t_getc(Void)
|
||||||
{ int ch;
|
{ int ch;
|
||||||
if(f__curunit->uend) return(EOF);
|
if(f__curunit->uend) return(EOF);
|
||||||
@ -87,14 +88,14 @@ flag f__lquit;
|
|||||||
int f__lcount,f__ltype,nml_read;
|
int f__lcount,f__ltype,nml_read;
|
||||||
char *f__lchar;
|
char *f__lchar;
|
||||||
double f__lx,f__ly;
|
double f__lx,f__ly;
|
||||||
#define ERR(x) if(n=(x)) return(n)
|
#define ERR(x) if( (n=(x)) ) return(n)
|
||||||
#define GETC(x) (x=(*l_getc)())
|
#define GETC(x) (x=(*l_getc)())
|
||||||
#define Ungetc(x,y) (*l_ungetc)(x,y)
|
#define Ungetc(x,y) (*l_ungetc)(x,y)
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
l_R(poststar) int poststar;
|
int l_R(poststar) int poststar;
|
||||||
#else
|
#else
|
||||||
l_R(int poststar)
|
int l_R(int poststar)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
char s[FMAX+EXPMAXDIGS+4];
|
char s[FMAX+EXPMAXDIGS+4];
|
||||||
@ -249,6 +250,7 @@ rd_count(register int ch)
|
|||||||
return f__lcount <= 0;
|
return f__lcount <= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
l_C(Void)
|
l_C(Void)
|
||||||
{ int ch, nml_save;
|
{ int ch, nml_save;
|
||||||
double lz;
|
double lz;
|
||||||
@ -285,7 +287,7 @@ l_C(Void)
|
|||||||
Ungetc(ch,f__cf);
|
Ungetc(ch,f__cf);
|
||||||
nml_save = nml_read;
|
nml_save = nml_read;
|
||||||
nml_read = 0;
|
nml_read = 0;
|
||||||
if (ch = l_R(1))
|
if ( (ch = l_R(1)) )
|
||||||
return ch;
|
return ch;
|
||||||
if (!f__ltype)
|
if (!f__ltype)
|
||||||
errfl(f__elist->cierr,112,"no real part");
|
errfl(f__elist->cierr,112,"no real part");
|
||||||
@ -297,7 +299,7 @@ l_C(Void)
|
|||||||
}
|
}
|
||||||
while(iswhit(GETC(ch)));
|
while(iswhit(GETC(ch)));
|
||||||
(void) Ungetc(ch,f__cf);
|
(void) Ungetc(ch,f__cf);
|
||||||
if (ch = l_R(1))
|
if ( (ch = l_R(1)) )
|
||||||
return ch;
|
return ch;
|
||||||
if (!f__ltype)
|
if (!f__ltype)
|
||||||
errfl(f__elist->cierr,112,"no imaginary part");
|
errfl(f__elist->cierr,112,"no imaginary part");
|
||||||
@ -311,6 +313,8 @@ l_C(Void)
|
|||||||
nml_read = nml_save;
|
nml_read = nml_save;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
l_L(Void)
|
l_L(Void)
|
||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
@ -357,6 +361,8 @@ l_L(Void)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
#define BUFSIZE 128
|
#define BUFSIZE 128
|
||||||
|
|
||||||
|
int
|
||||||
l_CHAR(Void)
|
l_CHAR(Void)
|
||||||
{ int ch,size,i;
|
{ int ch,size,i;
|
||||||
static char rafail[] = "realloc failure";
|
static char rafail[] = "realloc failure";
|
||||||
@ -479,9 +485,9 @@ l_CHAR(Void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_le(a) cilist *a;
|
int c_le(a) cilist *a;
|
||||||
#else
|
#else
|
||||||
c_le(cilist *a)
|
int c_le(cilist *a)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(!f__init)
|
if(!f__init)
|
||||||
@ -499,9 +505,9 @@ c_le(cilist *a)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
|
int l_read(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
|
||||||
#else
|
#else
|
||||||
l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
|
int l_read(ftnint *number, char *ptr, ftnlen len, ftnint type)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#define Ptr ((flex *)ptr)
|
#define Ptr ((flex *)ptr)
|
||||||
@ -639,7 +645,7 @@ integer s_rsle(cilist *a)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if(n=c_le(a)) return(n);
|
if( (n=c_le(a)) ) return(n);
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
f__external=1;
|
f__external=1;
|
||||||
f__formatted=1;
|
f__formatted=1;
|
||||||
|
@ -14,9 +14,9 @@ donewrec(Void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
t_putc(c)
|
int t_putc(c)
|
||||||
#else
|
#else
|
||||||
t_putc(int c)
|
int t_putc(int c)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
f__recpos++;
|
f__recpos++;
|
||||||
@ -141,7 +141,7 @@ l_g(char *buf, double n)
|
|||||||
switch(*b) {
|
switch(*b) {
|
||||||
#ifndef WANT_LEAD_0
|
#ifndef WANT_LEAD_0
|
||||||
case '0':
|
case '0':
|
||||||
while(b[0] = b[1])
|
while( (b[0] = b[1]) )
|
||||||
b++;
|
b++;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
@ -166,7 +166,7 @@ l_g(char *buf, double n)
|
|||||||
while(*++b);
|
while(*++b);
|
||||||
goto f__ret;
|
goto f__ret;
|
||||||
case 'E':
|
case 'E':
|
||||||
for(c1 = '.', c = 'E'; *b = c1;
|
for(c1 = '.', c = 'E'; (*b = c1);
|
||||||
c1 = c, c = *++b);
|
c1 = c, c = *++b);
|
||||||
goto f__ret;
|
goto f__ret;
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ l_put(register char *s)
|
|||||||
#else
|
#else
|
||||||
register int c, (*pn)(int) = f__putn;
|
register int c, (*pn)(int) = f__putn;
|
||||||
#endif
|
#endif
|
||||||
while(c = *s++)
|
while( (c = *s++) )
|
||||||
(*pn)(c);
|
(*pn)(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,9 +240,9 @@ lwrt_C(double a, double b)
|
|||||||
PUT(')');
|
PUT(')');
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
|
int l_write(number,ptr,len,type) ftnint *number,type; char *ptr; ftnlen len;
|
||||||
#else
|
#else
|
||||||
l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
|
int l_write(ftnint *number, char *ptr, ftnlen len, ftnint type)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#define Ptr ((flex *)ptr)
|
#define Ptr ((flex *)ptr)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include <unistd.h>
|
||||||
#ifndef NON_UNIX_STDIO
|
#ifndef NON_UNIX_STDIO
|
||||||
#include "sys/types.h"
|
#include "sys/types.h"
|
||||||
#include "sys/stat.h"
|
#include "sys/stat.h"
|
||||||
@ -28,9 +29,9 @@ char *f__w_mode[4] = {"wb", "w", "r+b", "r+"};
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
f__isdev(s) char *s;
|
int f__isdev(s) char *s;
|
||||||
#else
|
#else
|
||||||
f__isdev(char *s)
|
int f__isdev(char *s)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#ifdef NON_UNIX_STDIO
|
#ifdef NON_UNIX_STDIO
|
||||||
@ -164,7 +165,7 @@ integer f_open(olist *a)
|
|||||||
case 'R':
|
case 'R':
|
||||||
replace:
|
replace:
|
||||||
#ifdef NON_UNIX_STDIO
|
#ifdef NON_UNIX_STDIO
|
||||||
if (tf = fopen(buf,f__w_mode[0]))
|
if ( (tf = fopen(buf,f__w_mode[0])) )
|
||||||
fclose(tf);
|
fclose(tf);
|
||||||
#else
|
#else
|
||||||
(void) close(creat(buf, 0666));
|
(void) close(creat(buf, 0666));
|
||||||
@ -187,9 +188,9 @@ integer f_open(olist *a)
|
|||||||
else {
|
else {
|
||||||
if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) {
|
if(!(b->ufd = fopen(buf, f__r_mode[ufmt]))) {
|
||||||
#ifdef NON_UNIX_STDIO
|
#ifdef NON_UNIX_STDIO
|
||||||
if (b->ufd = fopen(buf, f__w_mode[ufmt|2]))
|
if ( (b->ufd = fopen(buf, f__w_mode[ufmt|2])) )
|
||||||
b->uwrt = 2;
|
b->uwrt = 2;
|
||||||
else if (b->ufd = fopen(buf, f__w_mode[ufmt]))
|
else if ( (b->ufd = fopen(buf, f__w_mode[ufmt])) )
|
||||||
b->uwrt = 1;
|
b->uwrt = 1;
|
||||||
else
|
else
|
||||||
#else
|
#else
|
||||||
@ -219,9 +220,9 @@ integer f_open(olist *a)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
fk_open(seq,fmt,n) ftnint n;
|
int fk_open(seq,fmt,n) ftnint n;
|
||||||
#else
|
#else
|
||||||
fk_open(int seq, int fmt, ftnint n)
|
int fk_open(int seq, int fmt, ftnint n)
|
||||||
#endif
|
#endif
|
||||||
{ char nbuf[10];
|
{ char nbuf[10];
|
||||||
olist a;
|
olist a;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
|
#ifndef __FreeBSD__
|
||||||
extern FILE *fdopen();
|
extern FILE *fdopen();
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
@ -14,17 +16,23 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#ifndef MSDOS
|
#ifndef MSDOS
|
||||||
#ifdef OPEN_DECL
|
#ifdef OPEN_DECL
|
||||||
|
#ifndef __FreeBSD__
|
||||||
extern int creat(const char*,int), open(const char*,int);
|
extern int creat(const char*,int), open(const char*,int);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef __FreeBSD__
|
||||||
extern int close(int);
|
extern int close(int);
|
||||||
extern int read(int,void*,size_t), write(int,void*,size_t);
|
extern int read(int,void*,size_t), write(int,void*,size_t);
|
||||||
extern int unlink(const char*);
|
extern int unlink(const char*);
|
||||||
|
#endif
|
||||||
#ifndef _POSIX_SOURCE
|
#ifndef _POSIX_SOURCE
|
||||||
#ifndef NON_UNIX_STDIO
|
#ifndef NON_UNIX_STDIO
|
||||||
|
#ifndef __FreeBSD__
|
||||||
extern FILE *fdopen(int, const char*);
|
extern FILE *fdopen(int, const char*);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
extern char *mktemp(char*);
|
extern char *mktemp(char*);
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@ rd_Z(Uint *n, int w, ftnlen len)
|
|||||||
|
|
||||||
if (!hex['0']) {
|
if (!hex['0']) {
|
||||||
s = "0123456789";
|
s = "0123456789";
|
||||||
while(ch = *s++)
|
while( (ch = *s++) )
|
||||||
hex[ch] = ch - '0' + 1;
|
hex[ch] = ch - '0' + 1;
|
||||||
s = "ABCDEF";
|
s = "ABCDEF";
|
||||||
while(ch = *s++)
|
while( (ch = *s++) )
|
||||||
hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11;
|
hex[ch] = hex[ch + 'a' - 'A'] = ch - 'A' + 11;
|
||||||
}
|
}
|
||||||
s = s0 = (char *)x;
|
s = s0 = (char *)x;
|
||||||
@ -61,7 +61,7 @@ rd_Z(Uint *n, int w, ftnlen len)
|
|||||||
return errno = 115;
|
return errno = 115;
|
||||||
w = (int)len;
|
w = (int)len;
|
||||||
w1 = s - s0;
|
w1 = s - s0;
|
||||||
w2 = w1+1 >> 1;
|
w2 = (w1+1) >> 1;
|
||||||
t = (char *)n;
|
t = (char *)n;
|
||||||
if (*(char *)&one) {
|
if (*(char *)&one) {
|
||||||
/* little endian */
|
/* little endian */
|
||||||
@ -83,7 +83,7 @@ rd_Z(Uint *n, int w, ftnlen len)
|
|||||||
t += i;
|
t += i;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
*t = hex[*s0 & 0xff]-1 << 4 | hex[s0[1] & 0xff]-1;
|
*t = ((hex[*s0 & 0xff]-1) << 4) | (hex[s0[1] & 0xff]-1);
|
||||||
t += i;
|
t += i;
|
||||||
s0 += 2;
|
s0 += 2;
|
||||||
}
|
}
|
||||||
@ -387,9 +387,9 @@ rd_POS(char *s)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
|
int rd_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
|
||||||
#else
|
#else
|
||||||
rd_ed(struct syl *p, char *ptr, ftnlen len)
|
int rd_ed(struct syl *p, char *ptr, ftnlen len)
|
||||||
#endif
|
#endif
|
||||||
{ int ch;
|
{ int ch;
|
||||||
for(;f__cursor>0;f__cursor--) if((ch=(*f__getn)())<0) return(ch);
|
for(;f__cursor>0;f__cursor--) if((ch=(*f__getn)())<0) return(ch);
|
||||||
@ -450,9 +450,9 @@ rd_ed(struct syl *p, char *ptr, ftnlen len)
|
|||||||
return(errno);
|
return(errno);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
rd_ned(p) struct syl *p;
|
int rd_ned(p) struct syl *p;
|
||||||
#else
|
#else
|
||||||
rd_ned(struct syl *p)
|
int rd_ned(struct syl *p)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
switch(p->op)
|
switch(p->op)
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
#include "fio.h"
|
#include "fio.h"
|
||||||
#include "fmt.h"
|
#include "fmt.h"
|
||||||
|
|
||||||
|
int
|
||||||
xrd_SL(Void)
|
xrd_SL(Void)
|
||||||
{ int ch;
|
{ int ch;
|
||||||
if(!f__curunit->uend)
|
if(!f__curunit->uend)
|
||||||
@ -14,6 +15,8 @@ xrd_SL(Void)
|
|||||||
f__cursor=f__recpos=0;
|
f__cursor=f__recpos=0;
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
x_getc(Void)
|
x_getc(Void)
|
||||||
{ int ch;
|
{ int ch;
|
||||||
if(f__curunit->uend) return(EOF);
|
if(f__curunit->uend) return(EOF);
|
||||||
@ -33,11 +36,15 @@ x_getc(Void)
|
|||||||
}
|
}
|
||||||
return(-1);
|
return(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
x_endp(Void)
|
x_endp(Void)
|
||||||
{
|
{
|
||||||
(void) xrd_SL();
|
(void) xrd_SL();
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
x_rev(Void)
|
x_rev(Void)
|
||||||
{
|
{
|
||||||
(void) xrd_SL();
|
(void) xrd_SL();
|
||||||
@ -50,7 +57,7 @@ integer s_rsfe(cilist *a) /* start */
|
|||||||
#endif
|
#endif
|
||||||
{ int n;
|
{ int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
if(n=c_sfe(a)) return(n);
|
if( (n=c_sfe(a)) ) return(n);
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
f__sequential=1;
|
f__sequential=1;
|
||||||
f__formatted=1;
|
f__formatted=1;
|
||||||
|
@ -78,7 +78,7 @@ hash(hashtab *ht, register char *s)
|
|||||||
register hashentry *h;
|
register hashentry *h;
|
||||||
char *s0 = s;
|
char *s0 = s;
|
||||||
|
|
||||||
for(x = 0; c = *s++; x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1)
|
for(x = 0; (c = *s++); x = x & 0x4000 ? ((x << 1) & 0x7fff) + 1 : x << 1)
|
||||||
x += c;
|
x += c;
|
||||||
for(h = *(zot = ht->tab + x % ht->htsize); h; h = h->next)
|
for(h = *(zot = ht->tab + x % ht->htsize); h; h = h->next)
|
||||||
if (!strcmp(s0, h->name))
|
if (!strcmp(s0, h->name))
|
||||||
@ -99,7 +99,7 @@ mk_hashtab(Namelist *nl)
|
|||||||
hashentry *he;
|
hashentry *he;
|
||||||
|
|
||||||
hashtab **x, **x0, *y;
|
hashtab **x, **x0, *y;
|
||||||
for(x = &nl_cache; y = *x; x0 = x, x = &y->next)
|
for(x = &nl_cache; (y = *x); x0 = x, x = &y->next)
|
||||||
if (nl == y->nl)
|
if (nl == y->nl)
|
||||||
return y;
|
return y;
|
||||||
if (n_nlcache >= MAX_NL_CACHE) {
|
if (n_nlcache >= MAX_NL_CACHE) {
|
||||||
@ -151,13 +151,13 @@ nl_init(Void) {
|
|||||||
|
|
||||||
if(!f__init)
|
if(!f__init)
|
||||||
f_init();
|
f_init();
|
||||||
for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; c = *s++; )
|
for(s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; (c = *s++); )
|
||||||
Alpha[c]
|
Alpha[c]
|
||||||
= Alphanum[c]
|
= Alphanum[c]
|
||||||
= Alpha[c + 'a' - 'A']
|
= Alpha[c + 'a' - 'A']
|
||||||
= Alphanum[c + 'a' - 'A']
|
= Alphanum[c + 'a' - 'A']
|
||||||
= c;
|
= c;
|
||||||
for(s = "0123456789_"; c = *s++; )
|
for(s = "0123456789_"; (c = *s++); )
|
||||||
Alphanum[c] = c;
|
Alphanum[c] = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ getname(register char *s, int slen)
|
|||||||
ch = 115;
|
ch = 115;
|
||||||
errfl(f__elist->cierr, ch, "namelist read");
|
errfl(f__elist->cierr, ch, "namelist read");
|
||||||
}
|
}
|
||||||
while(*s = Alphanum[GETC(ch) & 0xff])
|
while( (*s = Alphanum[GETC(ch) & 0xff]) )
|
||||||
if (s < se)
|
if (s < se)
|
||||||
s++;
|
s++;
|
||||||
if (ch == EOF)
|
if (ch == EOF)
|
||||||
@ -235,15 +235,15 @@ getdimen(int *chp, dimen *d, ftnlen delta, ftnlen extent, ftnlen *x1)
|
|||||||
register int k;
|
register int k;
|
||||||
ftnlen x2, x3;
|
ftnlen x2, x3;
|
||||||
|
|
||||||
if (k = getnum(chp, x1))
|
if ( (k = getnum(chp, x1)) )
|
||||||
return k;
|
return k;
|
||||||
x3 = 1;
|
x3 = 1;
|
||||||
if (*chp == ':') {
|
if (*chp == ':') {
|
||||||
if (k = getnum(chp, &x2))
|
if ( (k = getnum(chp, &x2)) )
|
||||||
return k;
|
return k;
|
||||||
x2 -= *x1;
|
x2 -= *x1;
|
||||||
if (*chp == ':') {
|
if (*chp == ':') {
|
||||||
if (k = getnum(chp, &x3))
|
if ( (k = getnum(chp, &x3)) )
|
||||||
return k;
|
return k;
|
||||||
if (!x3)
|
if (!x3)
|
||||||
return 123;
|
return 123;
|
||||||
@ -291,9 +291,9 @@ print_ne(cilist *a)
|
|||||||
static char where0[] = "namelist read start ";
|
static char where0[] = "namelist read start ";
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
x_rsne(a) cilist *a;
|
int x_rsne(a) cilist *a;
|
||||||
#else
|
#else
|
||||||
x_rsne(cilist *a)
|
int x_rsne(cilist *a)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int ch, got1, k, n, nd, quote, readall;
|
int ch, got1, k, n, nd, quote, readall;
|
||||||
@ -340,7 +340,7 @@ x_rsne(cilist *a)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
have_amp:
|
have_amp:
|
||||||
if (ch = getname(buf,sizeof(buf)))
|
if ( (ch = getname(buf,sizeof(buf))) )
|
||||||
return ch;
|
return ch;
|
||||||
nl = (Namelist *)a->cifmt;
|
nl = (Namelist *)a->cifmt;
|
||||||
if (strcmp(buf, nl->name))
|
if (strcmp(buf, nl->name))
|
||||||
@ -392,10 +392,10 @@ x_rsne(cilist *a)
|
|||||||
case '&':
|
case '&':
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
if (ch <= ' ' && ch >= 0 || ch == ',')
|
if ((ch <= ' ' && ch >= 0) || (ch == ','))
|
||||||
continue;
|
continue;
|
||||||
Ungetc(ch,f__cf);
|
Ungetc(ch,f__cf);
|
||||||
if (ch = getname(buf,sizeof(buf)))
|
if ( (ch = getname(buf,sizeof(buf))) )
|
||||||
return ch;
|
return ch;
|
||||||
goto havename;
|
goto havename;
|
||||||
}
|
}
|
||||||
@ -419,8 +419,8 @@ x_rsne(cilist *a)
|
|||||||
if (!(dims = v->dims)) {
|
if (!(dims = v->dims)) {
|
||||||
if (type != TYCHAR)
|
if (type != TYCHAR)
|
||||||
errfl(a->cierr, 122, where);
|
errfl(a->cierr, 122, where);
|
||||||
if (k = getdimen(&ch, dn, (ftnlen)size,
|
if ( (k = getdimen(&ch, dn, (ftnlen)size,
|
||||||
(ftnlen)size, &b))
|
(ftnlen)size, &b)) )
|
||||||
errfl(a->cierr, k, where);
|
errfl(a->cierr, k, where);
|
||||||
if (ch != ')')
|
if (ch != ')')
|
||||||
errfl(a->cierr, 115, where);
|
errfl(a->cierr, 115, where);
|
||||||
@ -436,7 +436,7 @@ x_rsne(cilist *a)
|
|||||||
nomax = span = dims[1];
|
nomax = span = dims[1];
|
||||||
ivae = iva + size*nomax;
|
ivae = iva + size*nomax;
|
||||||
colonseen = 0;
|
colonseen = 0;
|
||||||
if (k = getdimen(&ch, dn, size, nomax, &b))
|
if ( (k = getdimen(&ch, dn, size, nomax, &b)) )
|
||||||
errfl(a->cierr, k, where);
|
errfl(a->cierr, k, where);
|
||||||
no = dn->extent;
|
no = dn->extent;
|
||||||
b0 = dims[2];
|
b0 = dims[2];
|
||||||
@ -447,8 +447,8 @@ x_rsne(cilist *a)
|
|||||||
errfl(a->cierr, 115, where);
|
errfl(a->cierr, 115, where);
|
||||||
dn1 = dn + 1;
|
dn1 = dn + 1;
|
||||||
span /= *dims;
|
span /= *dims;
|
||||||
if (k = getdimen(&ch, dn1, dn->delta**dims,
|
if ( (k = getdimen(&ch, dn1, dn->delta**dims,
|
||||||
span, &b1))
|
span, &b1)) )
|
||||||
errfl(a->cierr, k, where);
|
errfl(a->cierr, k, where);
|
||||||
ex *= *dims;
|
ex *= *dims;
|
||||||
b += b1*ex;
|
b += b1*ex;
|
||||||
@ -467,7 +467,7 @@ x_rsne(cilist *a)
|
|||||||
no1 = 1;
|
no1 = 1;
|
||||||
dn0 = dimens;
|
dn0 = dimens;
|
||||||
if (type == TYCHAR && ch == '(' /*)*/) {
|
if (type == TYCHAR && ch == '(' /*)*/) {
|
||||||
if (k = getdimen(&ch, &substr, size, size, &b))
|
if ( (k = getdimen(&ch, &substr, size, size, &b)) )
|
||||||
errfl(a->cierr, k, where);
|
errfl(a->cierr, k, where);
|
||||||
if (ch != ')')
|
if (ch != ')')
|
||||||
errfl(a->cierr, 115, where);
|
errfl(a->cierr, 115, where);
|
||||||
@ -502,7 +502,7 @@ x_rsne(cilist *a)
|
|||||||
dn1->delta -= ex;
|
dn1->delta -= ex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (dims = v->dims) {
|
else if ( (dims = v->dims) ) {
|
||||||
no = no1 = dims[1];
|
no = no1 = dims[1];
|
||||||
ivae = iva + no*size;
|
ivae = iva + no*size;
|
||||||
}
|
}
|
||||||
@ -522,7 +522,7 @@ x_rsne(cilist *a)
|
|||||||
else if (iva + no1*size > ivae)
|
else if (iva + no1*size > ivae)
|
||||||
no1 = (ivae - iva)/size;
|
no1 = (ivae - iva)/size;
|
||||||
f__lquit = 0;
|
f__lquit = 0;
|
||||||
if (k = l_read(&no1, vaddr + iva, size, type))
|
if ( (k = l_read(&no1, vaddr + iva, size, type)) )
|
||||||
return k;
|
return k;
|
||||||
if (f__lquit == 1)
|
if (f__lquit == 1)
|
||||||
return 0;
|
return 0;
|
||||||
@ -533,8 +533,8 @@ x_rsne(cilist *a)
|
|||||||
if (no1 > f__lcount)
|
if (no1 > f__lcount)
|
||||||
no1 = f__lcount;
|
no1 = f__lcount;
|
||||||
iva += no1 * dn0->delta;
|
iva += no1 * dn0->delta;
|
||||||
if (k = l_read(&no1, vaddr + iva,
|
if ( (k = l_read(&no1, vaddr + iva,
|
||||||
size, type))
|
size, type)) )
|
||||||
return k;
|
return k;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -594,7 +594,7 @@ s_rsne(cilist *a)
|
|||||||
|
|
||||||
f__external=1;
|
f__external=1;
|
||||||
l_eof = 0;
|
l_eof = 0;
|
||||||
if(n = c_le(a))
|
if( (n = c_le(a)) )
|
||||||
return n;
|
return n;
|
||||||
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
||||||
err(a->cierr,errno,where0);
|
err(a->cierr,errno,where0);
|
||||||
|
@ -15,9 +15,9 @@ integer e_rsfe(Void)
|
|||||||
return(n);
|
return(n);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_sfe(a) cilist *a; /* check */
|
int c_sfe(a) cilist *a; /* check */
|
||||||
#else
|
#else
|
||||||
c_sfe(cilist *a) /* check */
|
int c_sfe(cilist *a) /* check */
|
||||||
#endif
|
#endif
|
||||||
{ unit *p;
|
{ unit *p;
|
||||||
if(a->ciunit >= MXUNIT || a->ciunit<0)
|
if(a->ciunit >= MXUNIT || a->ciunit<0)
|
||||||
|
@ -4,9 +4,9 @@ extern uiolen f__reclen;
|
|||||||
long f__recloc;
|
long f__recloc;
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
c_sue(a) cilist *a;
|
int c_sue(a) cilist *a;
|
||||||
#else
|
#else
|
||||||
c_sue(cilist *a)
|
int c_sue(cilist *a)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(a->ciunit >= MXUNIT || a->ciunit < 0)
|
if(a->ciunit >= MXUNIT || a->ciunit < 0)
|
||||||
@ -31,7 +31,7 @@ integer s_rsue(cilist *a)
|
|||||||
int n;
|
int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
f__reading=1;
|
f__reading=1;
|
||||||
if(n=c_sue(a)) return(n);
|
if( (n=c_sue(a)) ) return(n);
|
||||||
f__recpos=0;
|
f__recpos=0;
|
||||||
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
if(f__curunit->uwrt && f__nowreading(f__curunit))
|
||||||
err(a->cierr, errno, "read start");
|
err(a->cierr, errno, "read start");
|
||||||
@ -54,7 +54,7 @@ integer s_wsue(cilist *a)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
if(n=c_sue(a)) return(n);
|
if( (n=c_sue(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
f__reclen=0;
|
f__reclen=0;
|
||||||
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
if(f__curunit->uwrt != 1 && f__nowwriting(f__curunit))
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
uiolen f__reclen;
|
uiolen f__reclen;
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
|
int do_us(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
|
||||||
#else
|
#else
|
||||||
do_us(ftnint *number, char *ptr, ftnlen len)
|
int do_us(ftnint *number, char *ptr, ftnlen len)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(f__reading)
|
if(f__reading)
|
||||||
@ -23,6 +23,7 @@ do_us(ftnint *number, char *ptr, ftnlen len)
|
|||||||
(void) fwrite(ptr,(int)len,(int)(*number),f__cf);
|
(void) fwrite(ptr,(int)len,(int)(*number),f__cf);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
|
integer do_ud(number,ptr,len) ftnint *number; char *ptr; ftnlen len;
|
||||||
|
@ -15,9 +15,9 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
|
int wrt_E(p,w,d,e,len) ufloat *p; ftnlen len;
|
||||||
#else
|
#else
|
||||||
wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
|
int wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
char buf[FMAX+EXPMAXDIGS+4], *s, *se;
|
char buf[FMAX+EXPMAXDIGS+4], *s, *se;
|
||||||
@ -127,7 +127,7 @@ wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
|
|||||||
/* exponent field if it fits. */
|
/* exponent field if it fits. */
|
||||||
#else
|
#else
|
||||||
if (!e0) {
|
if (!e0) {
|
||||||
for(s -= 2, e1 = 2; s[0] = s[1]; s++)
|
for(s -= 2, e1 = 2; (s[0] = s[1]); s++)
|
||||||
#ifdef CRAY
|
#ifdef CRAY
|
||||||
delta--;
|
delta--;
|
||||||
if ((delta += 4) < 0)
|
if ((delta += 4) < 0)
|
||||||
@ -191,9 +191,9 @@ wrt_E(ufloat *p, int w, int d, int e, ftnlen len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
wrt_F(p,w,d,len) ufloat *p; ftnlen len;
|
int wrt_F(p,w,d,len) ufloat *p; ftnlen len;
|
||||||
#else
|
#else
|
||||||
wrt_F(ufloat *p, int w, int d, ftnlen len)
|
int wrt_F(ufloat *p, int w, int d, ftnlen len)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int d1, sign, n;
|
int d1, sign, n;
|
||||||
@ -217,7 +217,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n = f__scale)
|
if ( (n = f__scale) )
|
||||||
if (n > 0)
|
if (n > 0)
|
||||||
do x *= 10.; while(--n > 0);
|
do x *= 10.; while(--n > 0);
|
||||||
else
|
else
|
||||||
@ -267,7 +267,7 @@ wrt_F(ufloat *p, int w, int d, ftnlen len)
|
|||||||
PUT('-');
|
PUT('-');
|
||||||
else if (f__cplus)
|
else if (f__cplus)
|
||||||
PUT('+');
|
PUT('+');
|
||||||
while(n = *b++)
|
while( (n = *b++) )
|
||||||
PUT(n);
|
PUT(n);
|
||||||
while(--d1 >= 0)
|
while(--d1 >= 0)
|
||||||
PUT('0');
|
PUT('0');
|
||||||
|
@ -6,6 +6,8 @@ extern int f__cursor;
|
|||||||
int f__hiwater;
|
int f__hiwater;
|
||||||
icilist *f__svic;
|
icilist *f__svic;
|
||||||
char *f__icptr;
|
char *f__icptr;
|
||||||
|
|
||||||
|
int
|
||||||
mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */
|
mv_cur(Void) /* shouldn't use fseek because it insists on calling fflush */
|
||||||
/* instead we know too much about stdio */
|
/* instead we know too much about stdio */
|
||||||
{
|
{
|
||||||
@ -233,9 +235,9 @@ wrt_H(int a, char *s)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
wrt_L(n,len, sz) Uint *n; ftnlen sz;
|
int wrt_L(n,len, sz) Uint *n; ftnlen sz;
|
||||||
#else
|
#else
|
||||||
wrt_L(Uint *n, int len, ftnlen sz)
|
int wrt_L(Uint *n, int len, ftnlen sz)
|
||||||
#endif
|
#endif
|
||||||
{ int i;
|
{ int i;
|
||||||
long x;
|
long x;
|
||||||
@ -307,9 +309,9 @@ wrt_G(ufloat *p, int w, int d, int e, ftnlen len)
|
|||||||
return(wrt_E(p,w,d,e,len));
|
return(wrt_E(p,w,d,e,len));
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
|
int w_ed(p,ptr,len) struct syl *p; char *ptr; ftnlen len;
|
||||||
#else
|
#else
|
||||||
w_ed(struct syl *p, char *ptr, ftnlen len)
|
int w_ed(struct syl *p, char *ptr, ftnlen len)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if(f__cursor && mv_cur()) return(mv_cur());
|
if(f__cursor && mv_cur()) return(mv_cur());
|
||||||
@ -350,9 +352,9 @@ w_ed(struct syl *p, char *ptr, ftnlen len)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
w_ned(p) struct syl *p;
|
int w_ned(p) struct syl *p;
|
||||||
#else
|
#else
|
||||||
w_ned(struct syl *p)
|
int w_ned(struct syl *p)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
switch(p->op)
|
switch(p->op)
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
extern int f__hiwater;
|
extern int f__hiwater;
|
||||||
|
|
||||||
#ifdef KR_headers
|
#ifdef KR_headers
|
||||||
x_putc(c)
|
int x_putc(c)
|
||||||
#else
|
#else
|
||||||
x_putc(int c)
|
int x_putc(int c)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/* this uses \n as an indicator of record-end */
|
/* this uses \n as an indicator of record-end */
|
||||||
@ -27,6 +27,8 @@ x_putc(int c)
|
|||||||
#endif
|
#endif
|
||||||
return putc(c,f__cf);
|
return putc(c,f__cf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
x_wSL(Void)
|
x_wSL(Void)
|
||||||
{
|
{
|
||||||
(*f__putn)('\n');
|
(*f__putn)('\n');
|
||||||
@ -35,6 +37,8 @@ x_wSL(Void)
|
|||||||
f__hiwater = 0;
|
f__hiwater = 0;
|
||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
xw_end(Void)
|
xw_end(Void)
|
||||||
{
|
{
|
||||||
if(f__nonl == 0)
|
if(f__nonl == 0)
|
||||||
@ -42,6 +46,8 @@ xw_end(Void)
|
|||||||
f__hiwater = f__recpos = f__cursor = 0;
|
f__hiwater = f__recpos = f__cursor = 0;
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
xw_rev(Void)
|
xw_rev(Void)
|
||||||
{
|
{
|
||||||
if(f__workdone) (*f__putn)('\n');
|
if(f__workdone) (*f__putn)('\n');
|
||||||
@ -56,7 +62,7 @@ integer s_wsfe(cilist *a) /*start*/
|
|||||||
#endif
|
#endif
|
||||||
{ int n;
|
{ int n;
|
||||||
if(!f__init) f_init();
|
if(!f__init) f_init();
|
||||||
if(n=c_sfe(a)) return(n);
|
if( (n=c_sfe(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
f__sequential=1;
|
f__sequential=1;
|
||||||
f__formatted=1;
|
f__formatted=1;
|
||||||
|
@ -10,7 +10,7 @@ integer s_wsle(cilist *a)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
if(n=c_le(a)) return(n);
|
if( (n=c_le(a)) ) return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
f__external=1;
|
f__external=1;
|
||||||
f__formatted=1;
|
f__formatted=1;
|
||||||
|
@ -11,7 +11,7 @@ s_wsne(cilist *a)
|
|||||||
{
|
{
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if(n=c_le(a))
|
if( (n=c_le(a)) )
|
||||||
return(n);
|
return(n);
|
||||||
f__reading=0;
|
f__reading=0;
|
||||||
f__external=1;
|
f__external=1;
|
||||||
|
@ -30,15 +30,16 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_RCS) && !defined(lint)
|
#if defined(LIBC_RCS) && !defined(lint)
|
||||||
static const char rcsid[] = "$Id$";
|
static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $";
|
||||||
#endif /* LIBC_RCS and not lint */
|
#endif /* LIBC_RCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
int
|
||||||
isnan(d)
|
isnan(d)
|
||||||
double d;
|
double d;
|
||||||
{
|
{
|
||||||
@ -52,6 +53,7 @@ isnan(d)
|
|||||||
return(p->exp == 2047 && (p->manh || p->manl));
|
return(p->exp == 2047 && (p->manh || p->manl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
isinf(d)
|
isinf(d)
|
||||||
double d;
|
double d;
|
||||||
{
|
{
|
||||||
|
@ -37,6 +37,7 @@ static char sccsid[] = "@(#)creat.c 8.1 (Berkeley) 6/2/93";
|
|||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
int
|
||||||
#if __STDC__
|
#if __STDC__
|
||||||
creat(const char *path, mode_t mode)
|
creat(const char *path, mode_t mode)
|
||||||
#else
|
#else
|
||||||
|
@ -47,7 +47,7 @@ getwd(buf)
|
|||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (p = getcwd(buf, MAXPATHLEN))
|
if ( (p = getcwd(buf, MAXPATHLEN)) )
|
||||||
return(p);
|
return(p);
|
||||||
(void)strcpy(buf, strerror(errno));
|
(void)strcpy(buf, strerror(errno));
|
||||||
return((char *)NULL);
|
return((char *)NULL);
|
||||||
|
@ -42,6 +42,7 @@ static char sccsid[] = "@(#)killpg.c 8.1 (Berkeley) 6/2/93";
|
|||||||
/*
|
/*
|
||||||
* Backwards-compatible killpg().
|
* Backwards-compatible killpg().
|
||||||
*/
|
*/
|
||||||
|
int
|
||||||
#if __STDC__
|
#if __STDC__
|
||||||
killpg(pid_t pgid, int sig)
|
killpg(pid_t pgid, int sig)
|
||||||
#else
|
#else
|
||||||
|
@ -38,6 +38,7 @@ static char sccsid[] = "@(#)setpgrp.c 8.1 (Berkeley) 6/2/93";
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int
|
||||||
#if __STDC__
|
#if __STDC__
|
||||||
setpgrp(pid_t pid, pid_t pgid)
|
setpgrp(pid_t pid, pid_t pgid)
|
||||||
#else
|
#else
|
||||||
|
@ -38,6 +38,7 @@ static char sccsid[] = "@(#)sigcompat.c 8.1 (Berkeley) 6/2/93";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
|
int
|
||||||
sigvec(signo, sv, osv)
|
sigvec(signo, sv, osv)
|
||||||
int signo;
|
int signo;
|
||||||
struct sigvec *sv, *osv;
|
struct sigvec *sv, *osv;
|
||||||
@ -52,6 +53,7 @@ sigvec(signo, sv, osv)
|
|||||||
return (ret);
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigsetmask(mask)
|
sigsetmask(mask)
|
||||||
int mask;
|
int mask;
|
||||||
{
|
{
|
||||||
@ -63,6 +65,7 @@ sigsetmask(mask)
|
|||||||
return (omask);
|
return (omask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigblock(mask)
|
sigblock(mask)
|
||||||
int mask;
|
int mask;
|
||||||
{
|
{
|
||||||
@ -74,6 +77,7 @@ sigblock(mask)
|
|||||||
return (omask);
|
return (omask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigpause(mask)
|
sigpause(mask)
|
||||||
int mask;
|
int mask;
|
||||||
{
|
{
|
||||||
|
@ -125,7 +125,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
|
|||||||
*/
|
*/
|
||||||
if (b.psize &&
|
if (b.psize &&
|
||||||
(b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
|
(b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
|
||||||
b.psize & sizeof(indx_t) - 1))
|
b.psize & (sizeof(indx_t) - 1) ))
|
||||||
goto einval;
|
goto einval;
|
||||||
|
|
||||||
/* Minimum number of keys per page; absolute minimum is 2. */
|
/* Minimum number of keys per page; absolute minimum is 2. */
|
||||||
@ -245,7 +245,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
|
|||||||
if (m.magic != BTREEMAGIC || m.version != BTREEVERSION)
|
if (m.magic != BTREEMAGIC || m.version != BTREEVERSION)
|
||||||
goto eftype;
|
goto eftype;
|
||||||
if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
|
if (m.psize < MINPSIZE || m.psize > MAX_PAGE_OFFSET + 1 ||
|
||||||
m.psize & sizeof(indx_t) - 1)
|
m.psize & (sizeof(indx_t) - 1) )
|
||||||
goto eftype;
|
goto eftype;
|
||||||
if (m.flags & ~SAVEMETA)
|
if (m.flags & ~SAVEMETA)
|
||||||
goto eftype;
|
goto eftype;
|
||||||
@ -278,8 +278,8 @@ __bt_open(fname, flags, mode, openinfo, dflags)
|
|||||||
t->bt_psize = b.psize;
|
t->bt_psize = b.psize;
|
||||||
|
|
||||||
/* Set the cache size; must be a multiple of the page size. */
|
/* Set the cache size; must be a multiple of the page size. */
|
||||||
if (b.cachesize && b.cachesize & b.psize - 1)
|
if (b.cachesize && b.cachesize & (b.psize - 1) )
|
||||||
b.cachesize += (~b.cachesize & b.psize - 1) + 1;
|
b.cachesize += (~b.cachesize & (b.psize - 1) ) + 1;
|
||||||
if (b.cachesize < b.psize * MINCACHE)
|
if (b.cachesize < b.psize * MINCACHE)
|
||||||
b.cachesize = b.psize * MINCACHE;
|
b.cachesize = b.psize * MINCACHE;
|
||||||
|
|
||||||
|
@ -875,7 +875,7 @@ hash_realloc(p_ptr, oldsize, newsize)
|
|||||||
{
|
{
|
||||||
register void *p;
|
register void *p;
|
||||||
|
|
||||||
if (p = malloc(newsize)) {
|
if ( (p = malloc(newsize)) ) {
|
||||||
memmove(p, *p_ptr, oldsize);
|
memmove(p, *p_ptr, oldsize);
|
||||||
memset((char *)p + oldsize, 0, newsize - oldsize);
|
memset((char *)p + oldsize, 0, newsize - oldsize);
|
||||||
free(*p_ptr);
|
free(*p_ptr);
|
||||||
|
@ -590,7 +590,7 @@ __big_split(hashp, op, np, big_keyp, addr, obucket, ret)
|
|||||||
return (-1);
|
return (-1);
|
||||||
change = (__call_hash(hashp, key.data, key.size) != obucket);
|
change = (__call_hash(hashp, key.data, key.size) != obucket);
|
||||||
|
|
||||||
if (ret->next_addr = __find_last_page(hashp, &big_keyp)) {
|
if ( (ret->next_addr = __find_last_page(hashp, &big_keyp)) ) {
|
||||||
if (!(ret->nextp =
|
if (!(ret->nextp =
|
||||||
__get_buf(hashp, ret->next_addr, big_keyp, 0)))
|
__get_buf(hashp, ret->next_addr, big_keyp, 0)))
|
||||||
return (-1);;
|
return (-1);;
|
||||||
|
@ -40,6 +40,8 @@ static char sccsid[] = "@(#)closedir.c 8.1 (Berkeley) 6/10/93";
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
extern void _reclaim_telldir __P(( const DIR * ));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* close a directory.
|
* close a directory.
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +105,7 @@ execl(name, arg, va_alist)
|
|||||||
#else
|
#else
|
||||||
va_start(ap);
|
va_start(ap);
|
||||||
#endif
|
#endif
|
||||||
if (argv = buildargv(ap, arg, NULL))
|
if ( (argv = buildargv(ap, arg, NULL)) )
|
||||||
(void)execve(name, argv, environ);
|
(void)execve(name, argv, environ);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
sverrno = errno;
|
sverrno = errno;
|
||||||
@ -133,7 +133,7 @@ execle(name, arg, va_alist)
|
|||||||
#else
|
#else
|
||||||
va_start(ap);
|
va_start(ap);
|
||||||
#endif
|
#endif
|
||||||
if (argv = buildargv(ap, arg, &envp))
|
if ( (argv = buildargv(ap, arg, &envp)) )
|
||||||
(void)execve(name, argv, envp);
|
(void)execve(name, argv, envp);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
sverrno = errno;
|
sverrno = errno;
|
||||||
@ -161,7 +161,7 @@ execlp(name, arg, va_alist)
|
|||||||
#else
|
#else
|
||||||
va_start(ap);
|
va_start(ap);
|
||||||
#endif
|
#endif
|
||||||
if (argv = buildargv(ap, arg, NULL))
|
if ( (argv = buildargv(ap, arg, NULL)) )
|
||||||
(void)execvp(name, argv);
|
(void)execvp(name, argv);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
sverrno = errno;
|
sverrno = errno;
|
||||||
@ -204,7 +204,7 @@ execvp(name, argv)
|
|||||||
cur = path = strdup(path);
|
cur = path = strdup(path);
|
||||||
|
|
||||||
eacces = etxtbsy = 0;
|
eacces = etxtbsy = 0;
|
||||||
while (p = strsep(&cur, ":")) {
|
while ( (p = strsep(&cur, ":")) ) {
|
||||||
/*
|
/*
|
||||||
* It's a SHELL path -- double, leading and trailing colons
|
* It's a SHELL path -- double, leading and trailing colons
|
||||||
* mean the current directory.
|
* mean the current directory.
|
||||||
|
@ -147,7 +147,7 @@ rangematch(pattern, test, flags)
|
|||||||
* consistency with the regular expression syntax.
|
* consistency with the regular expression syntax.
|
||||||
* J.T. Conklin (conklin@ngai.kaleida.com)
|
* J.T. Conklin (conklin@ngai.kaleida.com)
|
||||||
*/
|
*/
|
||||||
if (negate = (*pattern == '!' || *pattern == '^'))
|
if ( (negate = (*pattern == '!' || *pattern == '^')) )
|
||||||
++pattern;
|
++pattern;
|
||||||
|
|
||||||
for (ok = 0; (c = *pattern++) != ']';) {
|
for (ok = 0; (c = *pattern++) != ']';) {
|
||||||
|
@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t));
|
|||||||
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
|
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
|
||||||
static u_short fts_stat __P((FTS *, FTSENT *, int));
|
static u_short fts_stat __P((FTS *, FTSENT *, int));
|
||||||
|
|
||||||
#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
|
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) )
|
||||||
|
|
||||||
#define ISSET(opt) (sp->fts_options & opt)
|
#define ISSET(opt) (sp->fts_options & opt)
|
||||||
#define SET(opt) (sp->fts_options |= opt)
|
#define SET(opt) (sp->fts_options |= opt)
|
||||||
@ -304,7 +304,7 @@ fts_read(sp)
|
|||||||
if (p->fts_info == FTS_D) {
|
if (p->fts_info == FTS_D) {
|
||||||
/* If skipped or crossed mount point, do post-order visit. */
|
/* If skipped or crossed mount point, do post-order visit. */
|
||||||
if (instr == FTS_SKIP ||
|
if (instr == FTS_SKIP ||
|
||||||
ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
|
(ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) {
|
||||||
if (p->fts_flags & FTS_SYMFOLLOW)
|
if (p->fts_flags & FTS_SYMFOLLOW)
|
||||||
(void)close(p->fts_symfd);
|
(void)close(p->fts_symfd);
|
||||||
if (sp->fts_child) {
|
if (sp->fts_child) {
|
||||||
@ -354,7 +354,7 @@ fts_read(sp)
|
|||||||
|
|
||||||
/* Move to the next node on this level. */
|
/* Move to the next node on this level. */
|
||||||
next: tmp = p;
|
next: tmp = p;
|
||||||
if (p = p->fts_link) {
|
if ( (p = p->fts_link) ) {
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -640,7 +640,7 @@ fts_build(sp, type)
|
|||||||
|
|
||||||
/* Read the directory, attaching each entry to the `link' pointer. */
|
/* Read the directory, attaching each entry to the `link' pointer. */
|
||||||
adjaddr = NULL;
|
adjaddr = NULL;
|
||||||
for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) {
|
for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) {
|
||||||
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
|
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -680,8 +680,8 @@ mem1: saved_errno = errno;
|
|||||||
p->fts_accpath = cur->fts_accpath;
|
p->fts_accpath = cur->fts_accpath;
|
||||||
} else if (nlinks == 0
|
} else if (nlinks == 0
|
||||||
#ifdef DT_DIR
|
#ifdef DT_DIR
|
||||||
|| nlinks > 0 &&
|
|| (nlinks > 0 &&
|
||||||
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
|
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
p->fts_accpath =
|
p->fts_accpath =
|
||||||
@ -909,7 +909,7 @@ fts_lfree(head)
|
|||||||
register FTSENT *p;
|
register FTSENT *p;
|
||||||
|
|
||||||
/* Free a linked list of structures. */
|
/* Free a linked list of structures. */
|
||||||
while (p = head) {
|
while ( (p = head) ) {
|
||||||
head = head->fts_link;
|
head = head->fts_link;
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
@ -56,7 +56,7 @@ static int fts_palloc __P((FTS *, size_t));
|
|||||||
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
|
static FTSENT *fts_sort __P((FTS *, FTSENT *, int));
|
||||||
static u_short fts_stat __P((FTS *, FTSENT *, int));
|
static u_short fts_stat __P((FTS *, FTSENT *, int));
|
||||||
|
|
||||||
#define ISDOT(a) (a[0] == '.' && (!a[1] || a[1] == '.' && !a[2]))
|
#define ISDOT(a) (a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])) )
|
||||||
|
|
||||||
#define ISSET(opt) (sp->fts_options & opt)
|
#define ISSET(opt) (sp->fts_options & opt)
|
||||||
#define SET(opt) (sp->fts_options |= opt)
|
#define SET(opt) (sp->fts_options |= opt)
|
||||||
@ -304,7 +304,7 @@ fts_read(sp)
|
|||||||
if (p->fts_info == FTS_D) {
|
if (p->fts_info == FTS_D) {
|
||||||
/* If skipped or crossed mount point, do post-order visit. */
|
/* If skipped or crossed mount point, do post-order visit. */
|
||||||
if (instr == FTS_SKIP ||
|
if (instr == FTS_SKIP ||
|
||||||
ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) {
|
(ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev) ) {
|
||||||
if (p->fts_flags & FTS_SYMFOLLOW)
|
if (p->fts_flags & FTS_SYMFOLLOW)
|
||||||
(void)close(p->fts_symfd);
|
(void)close(p->fts_symfd);
|
||||||
if (sp->fts_child) {
|
if (sp->fts_child) {
|
||||||
@ -354,7 +354,7 @@ fts_read(sp)
|
|||||||
|
|
||||||
/* Move to the next node on this level. */
|
/* Move to the next node on this level. */
|
||||||
next: tmp = p;
|
next: tmp = p;
|
||||||
if (p = p->fts_link) {
|
if ( (p = p->fts_link) ) {
|
||||||
free(tmp);
|
free(tmp);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -640,7 +640,7 @@ fts_build(sp, type)
|
|||||||
|
|
||||||
/* Read the directory, attaching each entry to the `link' pointer. */
|
/* Read the directory, attaching each entry to the `link' pointer. */
|
||||||
adjaddr = NULL;
|
adjaddr = NULL;
|
||||||
for (head = tail = NULL, nitems = 0; dp = readdir(dirp);) {
|
for (head = tail = NULL, nitems = 0; (dp = readdir(dirp)); ) {
|
||||||
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
|
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -680,8 +680,8 @@ mem1: saved_errno = errno;
|
|||||||
p->fts_accpath = cur->fts_accpath;
|
p->fts_accpath = cur->fts_accpath;
|
||||||
} else if (nlinks == 0
|
} else if (nlinks == 0
|
||||||
#ifdef DT_DIR
|
#ifdef DT_DIR
|
||||||
|| nlinks > 0 &&
|
|| (nlinks > 0 &&
|
||||||
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN
|
dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
|
||||||
#endif
|
#endif
|
||||||
) {
|
) {
|
||||||
p->fts_accpath =
|
p->fts_accpath =
|
||||||
@ -909,7 +909,7 @@ fts_lfree(head)
|
|||||||
register FTSENT *p;
|
register FTSENT *p;
|
||||||
|
|
||||||
/* Free a linked list of structures. */
|
/* Free a linked list of structures. */
|
||||||
while (p = head) {
|
while ( (p = head) ) {
|
||||||
head = head->fts_link;
|
head = head->fts_link;
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ static char sccsid[] = "@(#)getcwd.c 8.1 (Berkeley) 6/4/93";
|
|||||||
|
|
||||||
#define ISDOT(dp) \
|
#define ISDOT(dp) \
|
||||||
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
|
(dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
|
||||||
dp->d_name[1] == '.' && dp->d_name[2] == '\0'))
|
(dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
|
||||||
|
|
||||||
char *
|
char *
|
||||||
getcwd(pt, size)
|
getcwd(pt, size)
|
||||||
|
@ -68,7 +68,7 @@ getgrouplist(uname, agroup, groups, grpcnt)
|
|||||||
* Scan the group file to find additional groups.
|
* Scan the group file to find additional groups.
|
||||||
*/
|
*/
|
||||||
setgrent();
|
setgrent();
|
||||||
while (grp = getgrent()) {
|
while ( (grp = getgrent()) ) {
|
||||||
for (i = 0; i < ngroups; i++) {
|
for (i = 0; i < ngroups; i++) {
|
||||||
if (grp->gr_gid == groups[i])
|
if (grp->gr_gid == groups[i])
|
||||||
goto skip;
|
goto skip;
|
||||||
|
@ -280,7 +280,7 @@ int len;
|
|||||||
{
|
{
|
||||||
char *ptr = list;
|
char *ptr = list;
|
||||||
|
|
||||||
while (ptr = strstr(ptr, group)) {
|
while ( (ptr = strstr(ptr, group)) ) {
|
||||||
|
|
||||||
ptr += strlen(group);
|
ptr += strlen(group);
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ int *rotation;
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
innetgr(group, host, user, dom)
|
innetgr(group, host, user, dom)
|
||||||
char *group, *host, *user, *dom;
|
const char *group, *host, *user, *dom;
|
||||||
{
|
{
|
||||||
char *hst, *usr, *dm;
|
char *hst, *usr, *dm;
|
||||||
#ifdef YP
|
#ifdef YP
|
||||||
|
@ -83,7 +83,6 @@ getpass(prompt)
|
|||||||
register int ch;
|
register int ch;
|
||||||
register char *p;
|
register char *p;
|
||||||
FILE *outfp;
|
FILE *outfp;
|
||||||
long omask;
|
|
||||||
static char buf[_PASSWORD_LEN + 1];
|
static char buf[_PASSWORD_LEN + 1];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -49,6 +49,10 @@ static char sccsid[] = "@(#)getpwent.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
|
extern void setnetgrent __P(( char * ));
|
||||||
|
extern int getnetgrent __P(( char **, char **, char ** ));
|
||||||
|
extern int innetgr __P(( const char *, const char *, const char *, const char * ));
|
||||||
|
|
||||||
static struct passwd _pw_passwd; /* password structure */
|
static struct passwd _pw_passwd; /* password structure */
|
||||||
static DB *_pw_db; /* password database */
|
static DB *_pw_db; /* password database */
|
||||||
static int _pw_keynum; /* key counter */
|
static int _pw_keynum; /* key counter */
|
||||||
@ -237,7 +241,7 @@ endpwent()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static int
|
||||||
__initdb()
|
__initdb()
|
||||||
{
|
{
|
||||||
static int warned;
|
static int warned;
|
||||||
@ -273,7 +277,7 @@ __initdb()
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static int
|
||||||
__hashpw(key)
|
__hashpw(key)
|
||||||
DBT *key;
|
DBT *key;
|
||||||
{
|
{
|
||||||
@ -289,7 +293,7 @@ __hashpw(key)
|
|||||||
return(0);
|
return(0);
|
||||||
|
|
||||||
t = line;
|
t = line;
|
||||||
#define EXPAND(e) e = t; while (*t++ = *p++);
|
#define EXPAND(e) e = t; while ( (*t++ = *p++) );
|
||||||
EXPAND(_pw_passwd.pw_name);
|
EXPAND(_pw_passwd.pw_name);
|
||||||
EXPAND(_pw_passwd.pw_passwd);
|
EXPAND(_pw_passwd.pw_passwd);
|
||||||
bcopy(p, (char *)&_pw_passwd.pw_uid, sizeof(int));
|
bcopy(p, (char *)&_pw_passwd.pw_uid, sizeof(int));
|
||||||
|
@ -50,7 +50,7 @@ getttynam(tty)
|
|||||||
register struct ttyent *t;
|
register struct ttyent *t;
|
||||||
|
|
||||||
setttyent();
|
setttyent();
|
||||||
while (t = getttyent())
|
while ( (t = getttyent()) )
|
||||||
if (!strcmp(tty, t->ty_name))
|
if (!strcmp(tty, t->ty_name))
|
||||||
break;
|
break;
|
||||||
endttyent();
|
endttyent();
|
||||||
@ -120,7 +120,7 @@ getttyent()
|
|||||||
tty.ty_comment = p;
|
tty.ty_comment = p;
|
||||||
if (*p == 0)
|
if (*p == 0)
|
||||||
tty.ty_comment = 0;
|
tty.ty_comment = 0;
|
||||||
if (p = index(p, '\n'))
|
if ( (p = index(p, '\n')) )
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
return (&tty);
|
return (&tty);
|
||||||
}
|
}
|
||||||
@ -180,7 +180,7 @@ setttyent()
|
|||||||
if (tf) {
|
if (tf) {
|
||||||
rewind(tf);
|
rewind(tf);
|
||||||
return (1);
|
return (1);
|
||||||
} else if (tf = fopen(_PATH_TTYS, "r"))
|
} else if ( (tf = fopen(_PATH_TTYS, "r")) )
|
||||||
return (1);
|
return (1);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ static char sccsid[] = "@(#)initgroups.c 8.1 (Berkeley) 6/4/93";
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
initgroups(uname, agroup)
|
initgroups(uname, agroup)
|
||||||
|
@ -46,6 +46,8 @@ static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int __fdnlist __P(( int, struct nlist * ));
|
||||||
|
|
||||||
int
|
int
|
||||||
nlist(name, list)
|
nlist(name, list)
|
||||||
const char *name;
|
const char *name;
|
||||||
|
@ -64,7 +64,7 @@ popen(program, type)
|
|||||||
FILE *iop;
|
FILE *iop;
|
||||||
int pdes[2], pid;
|
int pdes[2], pid;
|
||||||
|
|
||||||
if (*type != 'r' && *type != 'w' || type[1])
|
if ( (*type != 'r' && *type != 'w') || type[1])
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if ((cur = malloc(sizeof(struct pid))) == NULL)
|
if ((cur = malloc(sizeof(struct pid))) == NULL)
|
||||||
|
@ -44,7 +44,7 @@ static char sccsid[] = "@(#)pwcache.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <utmp.h>
|
#include <utmp.h>
|
||||||
|
|
||||||
#define NCACHE 64 /* power of 2 */
|
#define NCACHE 64 /* power of 2 */
|
||||||
#define MASK NCACHE - 1 /* bits to store with */
|
#define MASK (NCACHE - 1) /* bits to store with */
|
||||||
|
|
||||||
char *
|
char *
|
||||||
user_from_uid(uid, nouser)
|
user_from_uid(uid, nouser)
|
||||||
|
@ -38,6 +38,7 @@ static char sccsid[] = "@(#)raise.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int
|
||||||
raise(s)
|
raise(s)
|
||||||
int s;
|
int s;
|
||||||
{
|
{
|
||||||
|
@ -38,6 +38,8 @@ static char sccsid[] = "@(#)rewinddir.c 8.1 (Berkeley) 6/8/93";
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
extern void _seekdir __P(( DIR *, long ));
|
||||||
|
|
||||||
void
|
void
|
||||||
rewinddir(dirp)
|
rewinddir(dirp)
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
|
@ -38,6 +38,8 @@ static char sccsid[] = "@(#)seekdir.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
extern void _seekdir __P(( DIR *, long ));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Seek to an entry in a directory.
|
* Seek to an entry in a directory.
|
||||||
* _seekdir is in telldir.c so that it can share opaque data structures.
|
* _seekdir is in telldir.c so that it can share opaque data structures.
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* 3. Absolutely no warranty of function or purpose is made by the author
|
* 3. Absolutely no warranty of function or purpose is made by the author
|
||||||
* Peter Wemm.
|
* Peter Wemm.
|
||||||
*
|
*
|
||||||
* $Id: setproctitle.c,v 1.1 1995/12/26 22:50:08 peter Exp $
|
* $Id: setproctitle.c,v 1.2 1996/02/24 14:37:29 peter Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -67,7 +67,6 @@ setproctitle(fmt, va_alist)
|
|||||||
va_dcl
|
va_dcl
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
char *p;
|
|
||||||
static char buf[SPT_BUFSIZE];
|
static char buf[SPT_BUFSIZE];
|
||||||
static char *ps_argv[2];
|
static char *ps_argv[2];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -41,6 +41,7 @@ static char sccsid[] = "@(#)siginterrupt.c 8.1 (Berkeley) 6/4/93";
|
|||||||
* Set signal state to prevent restart of system calls
|
* Set signal state to prevent restart of system calls
|
||||||
* after an instance of the indicated signal.
|
* after an instance of the indicated signal.
|
||||||
*/
|
*/
|
||||||
|
int
|
||||||
siginterrupt(sig, flag)
|
siginterrupt(sig, flag)
|
||||||
int sig, flag;
|
int sig, flag;
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,7 @@ static char sccsid[] = "@(#)sigsetops.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#undef sigdelset
|
#undef sigdelset
|
||||||
#undef sigismember
|
#undef sigismember
|
||||||
|
|
||||||
|
int
|
||||||
sigemptyset(set)
|
sigemptyset(set)
|
||||||
sigset_t *set;
|
sigset_t *set;
|
||||||
{
|
{
|
||||||
@ -52,6 +53,7 @@ sigemptyset(set)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigfillset(set)
|
sigfillset(set)
|
||||||
sigset_t *set;
|
sigset_t *set;
|
||||||
{
|
{
|
||||||
@ -59,6 +61,7 @@ sigfillset(set)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigaddset(set, signo)
|
sigaddset(set, signo)
|
||||||
sigset_t *set;
|
sigset_t *set;
|
||||||
int signo;
|
int signo;
|
||||||
@ -67,6 +70,7 @@ sigaddset(set, signo)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigdelset(set, signo)
|
sigdelset(set, signo)
|
||||||
sigset_t *set;
|
sigset_t *set;
|
||||||
int signo;
|
int signo;
|
||||||
@ -75,6 +79,7 @@ sigdelset(set, signo)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
sigismember(set, signo)
|
sigismember(set, signo)
|
||||||
const sigset_t *set;
|
const sigset_t *set;
|
||||||
int signo;
|
int signo;
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94";
|
static char sccsid[] = "From: @(#)syslog.c 8.4 (Berkeley) 3/18/94";
|
||||||
*/
|
*/
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"$Id: syslog.c,v 1.7 1995/10/22 14:37:08 phk Exp $";
|
"$Id: syslog.c,v 1.8 1996/03/02 19:56:16 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -202,7 +202,7 @@ vsyslog(pri, fmt, ap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Substitute error message for %m. */
|
/* Substitute error message for %m. */
|
||||||
for ( ; ch = *fmt; ++fmt)
|
for ( ; (ch = *fmt); ++fmt)
|
||||||
if (ch == '%' && fmt[1] == 'm') {
|
if (ch == '%' && fmt[1] == 'm') {
|
||||||
++fmt;
|
++fmt;
|
||||||
fputs(strerror(saved_errno), fmt_fp);
|
fputs(strerror(saved_errno), fmt_fp);
|
||||||
|
@ -62,8 +62,8 @@ timezone(zone, dst)
|
|||||||
register char *beg,
|
register char *beg,
|
||||||
*end;
|
*end;
|
||||||
|
|
||||||
if (beg = getenv("TZNAME")) { /* set in environment */
|
if ( (beg = getenv("TZNAME")) ) { /* set in environment */
|
||||||
if (end = index(beg, ',')) { /* "PST,PDT" */
|
if ( (end = index(beg, ',')) ) {/* "PST,PDT" */
|
||||||
if (dst)
|
if (dst)
|
||||||
return(++end);
|
return(++end);
|
||||||
*end = '\0';
|
*end = '\0';
|
||||||
@ -82,22 +82,22 @@ static struct zone {
|
|||||||
char *stdzone;
|
char *stdzone;
|
||||||
char *dlzone;
|
char *dlzone;
|
||||||
} zonetab[] = {
|
} zonetab[] = {
|
||||||
-1*60, "MET", "MET DST", /* Middle European */
|
{-1*60, "MET", "MET DST"}, /* Middle European */
|
||||||
-2*60, "EET", "EET DST", /* Eastern European */
|
{-2*60, "EET", "EET DST"}, /* Eastern European */
|
||||||
4*60, "AST", "ADT", /* Atlantic */
|
{4*60, "AST", "ADT"}, /* Atlantic */
|
||||||
5*60, "EST", "EDT", /* Eastern */
|
{5*60, "EST", "EDT"}, /* Eastern */
|
||||||
6*60, "CST", "CDT", /* Central */
|
{6*60, "CST", "CDT"}, /* Central */
|
||||||
7*60, "MST", "MDT", /* Mountain */
|
{7*60, "MST", "MDT"}, /* Mountain */
|
||||||
8*60, "PST", "PDT", /* Pacific */
|
{8*60, "PST", "PDT"}, /* Pacific */
|
||||||
#ifdef notdef
|
#ifdef notdef
|
||||||
/* there's no way to distinguish this from WET */
|
/* there's no way to distinguish this from WET */
|
||||||
0, "GMT", 0, /* Greenwich */
|
{0, "GMT", 0}, /* Greenwich */
|
||||||
#endif
|
#endif
|
||||||
0*60, "WET", "WET DST", /* Western European */
|
{0*60, "WET", "WET DST"}, /* Western European */
|
||||||
-10*60, "EST", "EST", /* Aust: Eastern */
|
{-10*60,"EST", "EST"}, /* Aust: Eastern */
|
||||||
-10*60+30, "CST", "CST", /* Aust: Central */
|
{-10*60+30,"CST", "CST"}, /* Aust: Central */
|
||||||
-8*60, "WST", 0, /* Aust: Western */
|
{-8*60, "WST", 0}, /* Aust: Western */
|
||||||
-1
|
{-1}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -177,7 +177,7 @@ ttyname(fd)
|
|||||||
if (fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
|
if (fstat(fd, &sb) || !S_ISCHR(sb.st_mode))
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
if (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) {
|
if ( (db = dbopen(_PATH_DEVDB, O_RDONLY, 0, DB_HASH, NULL)) ) {
|
||||||
memset(&bkey, 0, sizeof(bkey));
|
memset(&bkey, 0, sizeof(bkey));
|
||||||
bkey.type = S_IFCHR;
|
bkey.type = S_IFCHR;
|
||||||
bkey.dev = sb.st_rdev;
|
bkey.dev = sb.st_rdev;
|
||||||
@ -206,7 +206,7 @@ oldttyname(fd, sb)
|
|||||||
if ((dp = opendir(_PATH_DEV)) == NULL)
|
if ((dp = opendir(_PATH_DEV)) == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
while (dirp = readdir(dp)) {
|
while ( (dirp = readdir(dp)) ) {
|
||||||
if (dirp->d_fileno != sb->st_ino)
|
if (dirp->d_fileno != sb->st_ino)
|
||||||
continue;
|
continue;
|
||||||
bcopy(dirp->d_name, buf + sizeof(_PATH_DEV) - 1,
|
bcopy(dirp->d_name, buf + sizeof(_PATH_DEV) - 1,
|
||||||
|
@ -51,12 +51,12 @@ ttyslot()
|
|||||||
|
|
||||||
setttyent();
|
setttyent();
|
||||||
for (cnt = 0; cnt < 3; ++cnt)
|
for (cnt = 0; cnt < 3; ++cnt)
|
||||||
if (name = ttyname(cnt)) {
|
if ( (name = ttyname(cnt)) ) {
|
||||||
if (p = rindex(name, '/'))
|
if ( (p = rindex(name, '/')) )
|
||||||
++p;
|
++p;
|
||||||
else
|
else
|
||||||
p = name;
|
p = name;
|
||||||
for (slot = 1; ttyp = getttyent(); ++slot)
|
for (slot = 1; (ttyp = getttyent()); ++slot)
|
||||||
if (!strcmp(ttyp->ty_name, p)) {
|
if (!strcmp(ttyp->ty_name, p)) {
|
||||||
endttyent();
|
endttyent();
|
||||||
return(slot);
|
return(slot);
|
||||||
|
@ -224,7 +224,7 @@ strunvis(dst, src)
|
|||||||
char *start = dst;
|
char *start = dst;
|
||||||
int state = 0;
|
int state = 0;
|
||||||
|
|
||||||
while (c = *src++) {
|
while ( (c = *src++) ) {
|
||||||
again:
|
again:
|
||||||
switch (unvis(dst, c, &state, 0)) {
|
switch (unvis(dst, c, &state, 0)) {
|
||||||
case UNVIS_VALID:
|
case UNVIS_VALID:
|
||||||
|
@ -159,7 +159,7 @@ strvis(dst, src, flag)
|
|||||||
register char c;
|
register char c;
|
||||||
char *start;
|
char *start;
|
||||||
|
|
||||||
for (start = dst; c = *src;)
|
for (start = dst; (c = *src); )
|
||||||
dst = vis(dst, c, flag, *++src);
|
dst = vis(dst, c, flag, *++src);
|
||||||
*dst = '\0';
|
*dst = '\0';
|
||||||
return (dst - start);
|
return (dst - start);
|
||||||
|
@ -30,15 +30,16 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* $Id$
|
* $Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_RCS) && !defined(lint)
|
#if defined(LIBC_RCS) && !defined(lint)
|
||||||
static const char rcsid[] = "$Id$";
|
static const char rcsid[] = "$Id: isinf.c,v 1.2 1995/01/23 01:27:00 davidg Exp $";
|
||||||
#endif /* LIBC_RCS and not lint */
|
#endif /* LIBC_RCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
int
|
||||||
isnan(d)
|
isnan(d)
|
||||||
double d;
|
double d;
|
||||||
{
|
{
|
||||||
@ -52,6 +53,7 @@ isnan(d)
|
|||||||
return(p->exp == 2047 && (p->manh || p->manl));
|
return(p->exp == 2047 && (p->manh || p->manl));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
isinf(d)
|
isinf(d)
|
||||||
double d;
|
double d;
|
||||||
{
|
{
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
* Center for Telecommunications Research
|
* Center for Telecommunications Research
|
||||||
* Columbia University, New York City
|
* Columbia University, New York City
|
||||||
*
|
*
|
||||||
* $Id: ether_addr.c,v 1.2 1995/08/07 03:42:14 wpaul Exp $
|
* $Id: ether_addr.c,v 1.3 1996/03/16 21:25:59 wpaul Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -90,11 +90,20 @@ struct ether_addr *ether_aton(a)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
static struct ether_addr o;
|
static struct ether_addr o;
|
||||||
|
unsigned int o0, o1, o2, o3, o4, o5;
|
||||||
|
|
||||||
|
i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
|
||||||
|
|
||||||
i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2],
|
|
||||||
o.octet[3], o.octet[4], o.octet[5]);
|
|
||||||
if (i != 6)
|
if (i != 6)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|
||||||
|
o.octet[0]=o0;
|
||||||
|
o.octet[1]=o1;
|
||||||
|
o.octet[2]=o2;
|
||||||
|
o.octet[3]=o3;
|
||||||
|
o.octet[4]=o4;
|
||||||
|
o.octet[5]=o5;
|
||||||
|
|
||||||
return ((struct ether_addr *)&o);
|
return ((struct ether_addr *)&o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
|
static char rcsid[] = "$Id: gethostbydns.c,v 1.8 1996/01/13 09:03:40 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -73,6 +73,8 @@ static char rcsid[] = "$Id: gethostbydns.c,v 1.7 1995/10/22 14:39:02 phk Exp $";
|
|||||||
|
|
||||||
#include "res_config.h"
|
#include "res_config.h"
|
||||||
|
|
||||||
|
extern void _res_close __P((void));
|
||||||
|
|
||||||
#define MAXALIASES 35
|
#define MAXALIASES 35
|
||||||
#define MAXADDRS 35
|
#define MAXADDRS 35
|
||||||
|
|
||||||
@ -85,8 +87,6 @@ static struct hostent host;
|
|||||||
static char *host_aliases[MAXALIASES];
|
static char *host_aliases[MAXALIASES];
|
||||||
static char hostbuf[8*1024];
|
static char hostbuf[8*1024];
|
||||||
static struct in_addr host_addr;
|
static struct in_addr host_addr;
|
||||||
static FILE *hostf = NULL;
|
|
||||||
static int stayopen = 0;
|
|
||||||
|
|
||||||
#ifdef RESOLVSORT
|
#ifdef RESOLVSORT
|
||||||
static void addrsort __P((char **, int));
|
static void addrsort __P((char **, int));
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: gethostbyht.c,v 1.2 1995/05/30 05:40:44 rgrimes Exp $";
|
static char rcsid[] = "$Id: gethostbyht.c,v 1.3 1996/01/13 09:03:45 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -135,7 +135,7 @@ gethostent()
|
|||||||
cp++;
|
cp++;
|
||||||
host.h_name = cp;
|
host.h_name = cp;
|
||||||
q = host.h_aliases = host_aliases;
|
q = host.h_aliases = host_aliases;
|
||||||
if (cp = strpbrk(cp, " \t"))
|
if ( (cp = strpbrk(cp, " \t")) )
|
||||||
*cp++ = '\0';
|
*cp++ = '\0';
|
||||||
while (cp && *cp) {
|
while (cp && *cp) {
|
||||||
if (*cp == ' ' || *cp == '\t') {
|
if (*cp == ' ' || *cp == '\t') {
|
||||||
@ -144,7 +144,7 @@ gethostent()
|
|||||||
}
|
}
|
||||||
if (q < &host_aliases[MAXALIASES - 1])
|
if (q < &host_aliases[MAXALIASES - 1])
|
||||||
*q++ = cp;
|
*q++ = cp;
|
||||||
if (cp = strpbrk(cp, " \t"))
|
if ( (cp = strpbrk(cp, " \t")) )
|
||||||
*cp++ = '\0';
|
*cp++ = '\0';
|
||||||
}
|
}
|
||||||
*q = NULL;
|
*q = NULL;
|
||||||
@ -160,7 +160,7 @@ _gethostbyhtname(name)
|
|||||||
register char **cp;
|
register char **cp;
|
||||||
|
|
||||||
sethostent(0);
|
sethostent(0);
|
||||||
while (p = gethostent()) {
|
while ( (p = gethostent()) ) {
|
||||||
if (strcasecmp(p->h_name, name) == 0)
|
if (strcasecmp(p->h_name, name) == 0)
|
||||||
break;
|
break;
|
||||||
for (cp = p->h_aliases; *cp != 0; cp++)
|
for (cp = p->h_aliases; *cp != 0; cp++)
|
||||||
@ -180,7 +180,7 @@ _gethostbyhtaddr(addr, len, type)
|
|||||||
register struct hostent *p;
|
register struct hostent *p;
|
||||||
|
|
||||||
sethostent(0);
|
sethostent(0);
|
||||||
while (p = gethostent())
|
while ( (p = gethostent()) )
|
||||||
if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len))
|
if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len))
|
||||||
break;
|
break;
|
||||||
endhostent();
|
endhostent();
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
|
static char sccsid[] = "@(#)$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
|
||||||
static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
|
static char rcsid[] = "$Id: gethostbynis.c,v 1.2 1996/03/16 21:25:58 wpaul Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -34,6 +34,7 @@ static char rcsid[] = "$Id: gethostbynis.c,v 1.1 1994/09/25 02:12:14 pst Exp $";
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
|
static char sccsid[] = "@(#)$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
|
||||||
static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $";
|
static char rcsid[] = "$Id: gethostnamadr.c,v 1.7 1995/05/30 05:40:45 rgrimes Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -38,6 +38,11 @@ static char rcsid[] = "$Id: gethostnamadr.c,v 1.6 1995/03/24 15:38:54 ache Exp $
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
extern void _sethosthtent __P(( int ));
|
||||||
|
extern void _endhosthtent __P(( void ));
|
||||||
|
extern void _sethostdnsent __P(( int ));
|
||||||
|
extern void _endhostdnsent __P(( void ));
|
||||||
|
|
||||||
extern struct hostent * _gethostbyhtname __P((const char *));
|
extern struct hostent * _gethostbyhtname __P((const char *));
|
||||||
extern struct hostent * _gethostbydnsname __P((const char *));
|
extern struct hostent * _gethostbydnsname __P((const char *));
|
||||||
extern struct hostent * _gethostbynisname __P((const char *));
|
extern struct hostent * _gethostbynisname __P((const char *));
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)gethostnamadr.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
|
static char rcsid[] = "$Id: getnetbydns.c,v 1.5 1996/01/13 09:03:51 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -80,6 +80,7 @@ static char rcsid[] = "$Id: getnetbydns.c,v 1.4 1995/10/22 14:39:04 phk Exp $";
|
|||||||
|
|
||||||
#include "res_config.h"
|
#include "res_config.h"
|
||||||
|
|
||||||
|
extern void _res_close __P((void));
|
||||||
extern int h_errno;
|
extern int h_errno;
|
||||||
|
|
||||||
#define BYADDR 0
|
#define BYADDR 0
|
||||||
|
@ -141,7 +141,7 @@ _getnetbyhtname(name)
|
|||||||
register char **cp;
|
register char **cp;
|
||||||
|
|
||||||
setnetent(_net_stayopen);
|
setnetent(_net_stayopen);
|
||||||
while (p = getnetent()) {
|
while ( (p = getnetent()) ) {
|
||||||
if (strcasecmp(p->n_name, name) == 0)
|
if (strcasecmp(p->n_name, name) == 0)
|
||||||
break;
|
break;
|
||||||
for (cp = p->n_aliases; *cp != 0; cp++)
|
for (cp = p->n_aliases; *cp != 0; cp++)
|
||||||
@ -162,7 +162,7 @@ _getnetbyhtaddr(net, type)
|
|||||||
register struct netent *p;
|
register struct netent *p;
|
||||||
|
|
||||||
setnetent(_net_stayopen);
|
setnetent(_net_stayopen);
|
||||||
while (p = getnetent())
|
while ( (p = getnetent()) )
|
||||||
if (p->n_addrtype == type && p->n_net == net)
|
if (p->n_addrtype == type && p->n_net == net)
|
||||||
break;
|
break;
|
||||||
if (!_net_stayopen)
|
if (!_net_stayopen)
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
|
static char sccsid[] = "@(#)$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
|
||||||
static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $";
|
static char rcsid[] = "$Id: getnetnamadr.c,v 1.4 1995/05/30 05:40:48 rgrimes Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -38,6 +38,13 @@ static char rcsid[] = "$Id: getnetnamadr.c,v 1.3 1995/03/24 15:51:30 ache Exp $"
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
extern void _setnetent __P(( int ));
|
||||||
|
extern void _endnetent __P(( void ));
|
||||||
|
extern void _setnethtent __P(( int ));
|
||||||
|
extern void _endnethtent __P(( void ));
|
||||||
|
extern void _setnetdnsent __P(( int ));
|
||||||
|
extern void _endnetdnsent __P(( void ));
|
||||||
|
|
||||||
extern struct netent * _getnetbyhtname __P((const char *));
|
extern struct netent * _getnetbyhtname __P((const char *));
|
||||||
extern struct netent * _getnetbydnsname __P((const char *));
|
extern struct netent * _getnetbydnsname __P((const char *));
|
||||||
extern struct netent * _getnetbynisname __P((const char *));
|
extern struct netent * _getnetbynisname __P((const char *));
|
||||||
|
@ -46,7 +46,7 @@ getprotobynumber(proto)
|
|||||||
register struct protoent *p;
|
register struct protoent *p;
|
||||||
|
|
||||||
setprotoent(_proto_stayopen);
|
setprotoent(_proto_stayopen);
|
||||||
while (p = getprotoent())
|
while ( (p = getprotoent()) )
|
||||||
if (p->p_proto == proto)
|
if (p->p_proto == proto)
|
||||||
break;
|
break;
|
||||||
if (!_proto_stayopen)
|
if (!_proto_stayopen)
|
||||||
|
@ -48,7 +48,7 @@ getprotobyname(name)
|
|||||||
register char **cp;
|
register char **cp;
|
||||||
|
|
||||||
setprotoent(_proto_stayopen);
|
setprotoent(_proto_stayopen);
|
||||||
while (p = getprotoent()) {
|
while ( (p = getprotoent()) ) {
|
||||||
if (strcmp(p->p_name, name) == 0)
|
if (strcmp(p->p_name, name) == 0)
|
||||||
break;
|
break;
|
||||||
for (cp = p->p_aliases; *cp != 0; cp++)
|
for (cp = p->p_aliases; *cp != 0; cp++)
|
||||||
|
@ -56,7 +56,7 @@ getservbyname(name, proto)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
setservent(_serv_stayopen);
|
setservent(_serv_stayopen);
|
||||||
while (p = getservent()) {
|
while ( (p = getservent()) ) {
|
||||||
if (strcmp(name, p->s_name) == 0)
|
if (strcmp(name, p->s_name) == 0)
|
||||||
goto gotname;
|
goto gotname;
|
||||||
for (cp = p->s_aliases; *cp; cp++)
|
for (cp = p->s_aliases; *cp; cp++)
|
||||||
|
@ -56,7 +56,7 @@ getservbyport(port, proto)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
setservent(_serv_stayopen);
|
setservent(_serv_stayopen);
|
||||||
while (p = getservent()) {
|
while ( (p = getservent()) ) {
|
||||||
if (p->s_port != port)
|
if (p->s_port != port)
|
||||||
continue;
|
continue;
|
||||||
if (proto == 0 || strcmp(p->s_proto, proto) == 0)
|
if (proto == 0 || strcmp(p->s_proto, proto) == 0)
|
||||||
|
@ -48,6 +48,8 @@ static char sccsid[] = "@(#)getservent.c 8.1 (Berkeley) 6/4/93";
|
|||||||
static int serv_stepping_yp = 0;
|
static int serv_stepping_yp = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int _yp_check __P(( char ** ));
|
||||||
|
|
||||||
#define MAXALIASES 35
|
#define MAXALIASES 35
|
||||||
|
|
||||||
static FILE *servf = NULL;
|
static FILE *servf = NULL;
|
||||||
|
@ -60,7 +60,7 @@ inet_network(cp)
|
|||||||
base = 8, cp++;
|
base = 8, cp++;
|
||||||
if (*cp == 'x' || *cp == 'X')
|
if (*cp == 'x' || *cp == 'X')
|
||||||
base = 16, cp++;
|
base = 16, cp++;
|
||||||
while (c = *cp) {
|
while ( (c = *cp) ) {
|
||||||
if (isdigit(c)) {
|
if (isdigit(c)) {
|
||||||
val = (val * base) + (c - '0');
|
val = (val * base) + (c - '0');
|
||||||
cp++;
|
cp++;
|
||||||
|
@ -57,6 +57,8 @@ static char sccsid[] = "@(#)rcmd.c 8.3 (Berkeley) 3/26/94";
|
|||||||
#include <rpcsvc/ypclnt.h>
|
#include <rpcsvc/ypclnt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern int innetgr __P(( const char *, const char *, const char *, const char * ));
|
||||||
|
|
||||||
#define max(a, b) ((a > b) ? a : b)
|
#define max(a, b) ((a > b) ? a : b)
|
||||||
|
|
||||||
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
|
int __ivaliduser __P((FILE *, u_long, const char *, const char *));
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)res_comp.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: res_comp.c,v 1.3 1995/05/30 05:40:54 rgrimes Exp $";
|
static char rcsid[] = "$Id: res_comp.c,v 1.4 1996/01/07 09:14:54 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -95,7 +95,7 @@ dn_expand(msg, eomorig, comp_dn, exp_dn, length)
|
|||||||
/*
|
/*
|
||||||
* fetch next label in domain name
|
* fetch next label in domain name
|
||||||
*/
|
*/
|
||||||
while (n = *cp++) {
|
while ( (n = *cp++) ) {
|
||||||
/*
|
/*
|
||||||
* Check for indirection
|
* Check for indirection
|
||||||
*/
|
*/
|
||||||
@ -298,7 +298,7 @@ dn_find(exp_dn, msg, dnptrs, lastdnptr)
|
|||||||
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
|
for (cpp = dnptrs; cpp < lastdnptr; cpp++) {
|
||||||
dn = exp_dn;
|
dn = exp_dn;
|
||||||
sp = cp = *cpp;
|
sp = cp = *cpp;
|
||||||
while (n = *cp++) {
|
while ( (n = *cp++) ) {
|
||||||
/*
|
/*
|
||||||
* check for indirection
|
* check for indirection
|
||||||
*/
|
*/
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)res_debug.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: res_debug.c,v 1.6 1996/01/07 09:14:55 peter Exp $";
|
static char rcsid[] = "$Id: res_debug.c,v 1.7 1996/02/06 20:35:48 wollman Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
@ -171,7 +171,7 @@ do_rrset(msg, len, cp, cnt, pflag, file, hs)
|
|||||||
* Print answer records.
|
* Print answer records.
|
||||||
*/
|
*/
|
||||||
sflag = (_res.pfcode & pflag);
|
sflag = (_res.pfcode & pflag);
|
||||||
if (n = ntohs(cnt)) {
|
if ( (n = ntohs(cnt)) ) {
|
||||||
if ((!_res.pfcode) ||
|
if ((!_res.pfcode) ||
|
||||||
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
|
((sflag) && (_res.pfcode & RES_PRF_HEAD1)))
|
||||||
fprintf(file, hs);
|
fprintf(file, hs);
|
||||||
@ -286,7 +286,7 @@ __fp_nquery(msg, len, file)
|
|||||||
/*
|
/*
|
||||||
* Print question records.
|
* Print question records.
|
||||||
*/
|
*/
|
||||||
if (n = ntohs(hp->qdcount)) {
|
if ( (n = ntohs(hp->qdcount)) ) {
|
||||||
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
|
if ((!_res.pfcode) || (_res.pfcode & RES_PRF_QUES))
|
||||||
fprintf(file, ";; QUESTIONS:\n");
|
fprintf(file, ";; QUESTIONS:\n");
|
||||||
while (--n >= 0) {
|
while (--n >= 0) {
|
||||||
@ -490,7 +490,7 @@ __p_rr(cp, msg, file)
|
|||||||
case T_HINFO:
|
case T_HINFO:
|
||||||
case T_ISDN:
|
case T_ISDN:
|
||||||
cp2 = cp + dlen;
|
cp2 = cp + dlen;
|
||||||
if (n = *cp++) {
|
if ( (n = *cp++) ) {
|
||||||
fprintf(file, "\t%.*s", n, cp);
|
fprintf(file, "\t%.*s", n, cp);
|
||||||
cp += n;
|
cp += n;
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ __p_rr(cp, msg, file)
|
|||||||
(void) fputs("\t\"", file);
|
(void) fputs("\t\"", file);
|
||||||
cp2 = cp1 + dlen;
|
cp2 = cp1 + dlen;
|
||||||
while (cp < cp2) {
|
while (cp < cp2) {
|
||||||
if (n = (unsigned char) *cp++) {
|
if ( (n = (unsigned char) *cp++) ) {
|
||||||
for (c = n; c > 0 && cp < cp2; c--)
|
for (c = n; c > 0 && cp < cp2; c--)
|
||||||
if ((*cp == '\n') || (*cp == '"')) {
|
if ((*cp == '\n') || (*cp == '"')) {
|
||||||
(void) putc('\\', file);
|
(void) putc('\\', file);
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#if defined(LIBC_SCCS) && !defined(lint)
|
||||||
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)res_send.c 8.1 (Berkeley) 6/4/93";
|
||||||
static char rcsid[] = "$Id: res_send.c,v 1.6 1995/08/21 09:15:40 bde Exp $";
|
static char rcsid[] = "$Id: res_send.c,v 1.7 1996/01/07 09:15:02 peter Exp $";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
/* change this to "0"
|
/* change this to "0"
|
||||||
@ -716,7 +716,7 @@ res_send(buf, buflen, ans, anssiz)
|
|||||||
* This routine is not expected to be user visible.
|
* This routine is not expected to be user visible.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
_res_close()
|
_res_close(void)
|
||||||
{
|
{
|
||||||
if (s >= 0) {
|
if (s >= 0) {
|
||||||
(void) close(s);
|
(void) close(s);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: msgcat.c,v 1.3 1995/06/17 03:02:21 ache Exp $ */
|
/* $Id: msgcat.c,v 1.4 1995/10/22 14:39:22 phk Exp $ */
|
||||||
|
|
||||||
/***********************************************************
|
/***********************************************************
|
||||||
Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
|
Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
|
||||||
@ -312,13 +312,13 @@ int type;
|
|||||||
if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT();
|
if (strncmp(header.magic, MCMagic, MCMagicLen) != 0) CORRUPT();
|
||||||
|
|
||||||
if (header.majorVer != MCMajorVer) {
|
if (header.majorVer != MCMajorVer) {
|
||||||
fprintf(stderr, "%s: %s is version %d, we need %d.\n", ERRNAME,
|
fprintf(stderr, "%s: %s is version %ld, we need %ld.\n", ERRNAME,
|
||||||
catpath, header.majorVer, MCMajorVer);
|
catpath, header.majorVer, MCMajorVer);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.numSets <= 0) {
|
if (header.numSets <= 0) {
|
||||||
fprintf(stderr, "%s: %s has %d sets!\n", ERRNAME, catpath,
|
fprintf(stderr, "%s: %s has %ld sets!\n", ERRNAME, catpath,
|
||||||
header.numSets);
|
header.numSets);
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $Id: msgcat.h,v 1.1 1995/03/30 12:47:27 jkh Exp $ */
|
/* $Id: msgcat.h,v 1.2 1995/05/30 05:41:00 rgrimes Exp $ */
|
||||||
|
|
||||||
/* -*-c++-*- */
|
/* -*-c++-*- */
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ up-to-date. Many thanks.
|
|||||||
#define MCLastMsg 0
|
#define MCLastMsg 0
|
||||||
#define MCLastSet 0
|
#define MCLastSet 0
|
||||||
|
|
||||||
#define MCMajorVer 1
|
#define MCMajorVer 1L
|
||||||
#define MCMinorVer 0
|
#define MCMinorVer 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -43,28 +43,28 @@ static struct cclass {
|
|||||||
char *chars;
|
char *chars;
|
||||||
char *multis;
|
char *multis;
|
||||||
} cclasses[] = {
|
} cclasses[] = {
|
||||||
"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
{"alnum", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
||||||
0123456789", "",
|
0123456789", ""},
|
||||||
"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
{"alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||||
"",
|
""},
|
||||||
"blank", " \t", "",
|
{"blank", " \t", ""},
|
||||||
"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
|
{"cntrl", "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\
|
||||||
\25\26\27\30\31\32\33\34\35\36\37\177", "",
|
\25\26\27\30\31\32\33\34\35\36\37\177", ""},
|
||||||
"digit", "0123456789", "",
|
{"digit", "0123456789", ""},
|
||||||
"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
{"graph", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
||||||
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
||||||
"",
|
""},
|
||||||
"lower", "abcdefghijklmnopqrstuvwxyz",
|
{"lower", "abcdefghijklmnopqrstuvwxyz",
|
||||||
"",
|
""},
|
||||||
"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
{"print", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\
|
||||||
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
|
0123456789!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
|
||||||
"",
|
""},
|
||||||
"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
{"punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
|
||||||
"",
|
""},
|
||||||
"space", "\t\n\v\f\r ", "",
|
{"space", "\t\n\v\f\r ", ""},
|
||||||
"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
{"upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||||
"",
|
""},
|
||||||
"xdigit", "0123456789ABCDEFabcdef",
|
{"xdigit", "0123456789ABCDEFabcdef",
|
||||||
"",
|
""},
|
||||||
NULL, 0, ""
|
{NULL, 0, ""}
|
||||||
};
|
};
|
||||||
|
@ -42,100 +42,100 @@ static struct cname {
|
|||||||
char *name;
|
char *name;
|
||||||
char code;
|
char code;
|
||||||
} cnames[] = {
|
} cnames[] = {
|
||||||
"NUL", '\0',
|
{"NUL", '\0'},
|
||||||
"SOH", '\001',
|
{"SOH", '\001'},
|
||||||
"STX", '\002',
|
{"STX", '\002'},
|
||||||
"ETX", '\003',
|
{"ETX", '\003'},
|
||||||
"EOT", '\004',
|
{"EOT", '\004'},
|
||||||
"ENQ", '\005',
|
{"ENQ", '\005'},
|
||||||
"ACK", '\006',
|
{"ACK", '\006'},
|
||||||
"BEL", '\007',
|
{"BEL", '\007'},
|
||||||
"alert", '\007',
|
{"alert", '\007'},
|
||||||
"BS", '\010',
|
{"BS", '\010'},
|
||||||
"backspace", '\b',
|
{"backspace", '\b'},
|
||||||
"HT", '\011',
|
{"HT", '\011'},
|
||||||
"tab", '\t',
|
{"tab", '\t'},
|
||||||
"LF", '\012',
|
{"LF", '\012'},
|
||||||
"newline", '\n',
|
{"newline", '\n'},
|
||||||
"VT", '\013',
|
{"VT", '\013'},
|
||||||
"vertical-tab", '\v',
|
{"vertical-tab", '\v'},
|
||||||
"FF", '\014',
|
{"FF", '\014'},
|
||||||
"form-feed", '\f',
|
{"form-feed", '\f'},
|
||||||
"CR", '\015',
|
{"CR", '\015'},
|
||||||
"carriage-return", '\r',
|
{"carriage-return", '\r'},
|
||||||
"SO", '\016',
|
{"SO", '\016'},
|
||||||
"SI", '\017',
|
{"SI", '\017'},
|
||||||
"DLE", '\020',
|
{"DLE", '\020'},
|
||||||
"DC1", '\021',
|
{"DC1", '\021'},
|
||||||
"DC2", '\022',
|
{"DC2", '\022'},
|
||||||
"DC3", '\023',
|
{"DC3", '\023'},
|
||||||
"DC4", '\024',
|
{"DC4", '\024'},
|
||||||
"NAK", '\025',
|
{"NAK", '\025'},
|
||||||
"SYN", '\026',
|
{"SYN", '\026'},
|
||||||
"ETB", '\027',
|
{"ETB", '\027'},
|
||||||
"CAN", '\030',
|
{"CAN", '\030'},
|
||||||
"EM", '\031',
|
{"EM", '\031'},
|
||||||
"SUB", '\032',
|
{"SUB", '\032'},
|
||||||
"ESC", '\033',
|
{"ESC", '\033'},
|
||||||
"IS4", '\034',
|
{"IS4", '\034'},
|
||||||
"FS", '\034',
|
{"FS", '\034'},
|
||||||
"IS3", '\035',
|
{"IS3", '\035'},
|
||||||
"GS", '\035',
|
{"GS", '\035'},
|
||||||
"IS2", '\036',
|
{"IS2", '\036'},
|
||||||
"RS", '\036',
|
{"RS", '\036'},
|
||||||
"IS1", '\037',
|
{"IS1", '\037'},
|
||||||
"US", '\037',
|
{"US", '\037'},
|
||||||
"space", ' ',
|
{"space", ' '},
|
||||||
"exclamation-mark", '!',
|
{"exclamation-mark", '!'},
|
||||||
"quotation-mark", '"',
|
{"quotation-mark", '"'},
|
||||||
"number-sign", '#',
|
{"number-sign", '#'},
|
||||||
"dollar-sign", '$',
|
{"dollar-sign", '$'},
|
||||||
"percent-sign", '%',
|
{"percent-sign", '%'},
|
||||||
"ampersand", '&',
|
{"ampersand", '&'},
|
||||||
"apostrophe", '\'',
|
{"apostrophe", '\''},
|
||||||
"left-parenthesis", '(',
|
{"left-parenthesis", '('},
|
||||||
"right-parenthesis", ')',
|
{"right-parenthesis", ')'},
|
||||||
"asterisk", '*',
|
{"asterisk", '*'},
|
||||||
"plus-sign", '+',
|
{"plus-sign", '+'},
|
||||||
"comma", ',',
|
{"comma", ','},
|
||||||
"hyphen", '-',
|
{"hyphen", '-'},
|
||||||
"hyphen-minus", '-',
|
{"hyphen-minus", '-'},
|
||||||
"period", '.',
|
{"period", '.'},
|
||||||
"full-stop", '.',
|
{"full-stop", '.'},
|
||||||
"slash", '/',
|
{"slash", '/'},
|
||||||
"solidus", '/',
|
{"solidus", '/'},
|
||||||
"zero", '0',
|
{"zero", '0'},
|
||||||
"one", '1',
|
{"one", '1'},
|
||||||
"two", '2',
|
{"two", '2'},
|
||||||
"three", '3',
|
{"three", '3'},
|
||||||
"four", '4',
|
{"four", '4'},
|
||||||
"five", '5',
|
{"five", '5'},
|
||||||
"six", '6',
|
{"six", '6'},
|
||||||
"seven", '7',
|
{"seven", '7'},
|
||||||
"eight", '8',
|
{"eight", '8'},
|
||||||
"nine", '9',
|
{"nine", '9'},
|
||||||
"colon", ':',
|
{"colon", ':'},
|
||||||
"semicolon", ';',
|
{"semicolon", ';'},
|
||||||
"less-than-sign", '<',
|
{"less-than-sign", '<'},
|
||||||
"equals-sign", '=',
|
{"equals-sign", '='},
|
||||||
"greater-than-sign", '>',
|
{"greater-than-sign", '>'},
|
||||||
"question-mark", '?',
|
{"question-mark", '?'},
|
||||||
"commercial-at", '@',
|
{"commercial-at", '@'},
|
||||||
"left-square-bracket", '[',
|
{"left-square-bracket", '['},
|
||||||
"backslash", '\\',
|
{"backslash", '\\'},
|
||||||
"reverse-solidus", '\\',
|
{"reverse-solidus", '\\'},
|
||||||
"right-square-bracket", ']',
|
{"right-square-bracket",']'},
|
||||||
"circumflex", '^',
|
{"circumflex", '^'},
|
||||||
"circumflex-accent", '^',
|
{"circumflex-accent", '^'},
|
||||||
"underscore", '_',
|
{"underscore", '_'},
|
||||||
"low-line", '_',
|
{"low-line", '_'},
|
||||||
"grave-accent", '`',
|
{"grave-accent", '`'},
|
||||||
"left-brace", '{',
|
{"left-brace", '{'},
|
||||||
"left-curly-bracket", '{',
|
{"left-curly-bracket", '{'},
|
||||||
"vertical-line", '|',
|
{"vertical-line", '|'},
|
||||||
"right-brace", '}',
|
{"right-brace", '}'},
|
||||||
"right-curly-bracket", '}',
|
{"right-curly-bracket", '}'},
|
||||||
"tilde", '~',
|
{"tilde", '~'},
|
||||||
"DEL", '\177',
|
{"DEL", '\177'},
|
||||||
NULL, 0,
|
{NULL, 0}
|
||||||
};
|
};
|
||||||
|
@ -148,8 +148,8 @@ int eflags;
|
|||||||
struct match mv;
|
struct match mv;
|
||||||
register struct match *m = &mv;
|
register struct match *m = &mv;
|
||||||
register char *dp;
|
register char *dp;
|
||||||
const register sopno gf = g->firststate+1; /* +1 for OEND */
|
register const sopno gf = g->firststate+1; /* +1 for OEND */
|
||||||
const register sopno gl = g->laststate;
|
register const sopno gl = g->laststate;
|
||||||
char *start;
|
char *start;
|
||||||
char *stop;
|
char *stop;
|
||||||
|
|
||||||
|
@ -103,9 +103,11 @@ static int freezeset __P((struct parse *p, cset *cs));
|
|||||||
static int firstch __P((struct parse *p, cset *cs));
|
static int firstch __P((struct parse *p, cset *cs));
|
||||||
static int nch __P((struct parse *p, cset *cs));
|
static int nch __P((struct parse *p, cset *cs));
|
||||||
static void mcadd __P((struct parse *p, cset *cs, char *cp));
|
static void mcadd __P((struct parse *p, cset *cs, char *cp));
|
||||||
|
#if used
|
||||||
static void mcsub __P((cset *cs, char *cp));
|
static void mcsub __P((cset *cs, char *cp));
|
||||||
static int mcin __P((cset *cs, char *cp));
|
static int mcin __P((cset *cs, char *cp));
|
||||||
static char *mcfind __P((cset *cs, char *cp));
|
static char *mcfind __P((cset *cs, char *cp));
|
||||||
|
#endif
|
||||||
static void mcinvert __P((struct parse *p, cset *cs));
|
static void mcinvert __P((struct parse *p, cset *cs));
|
||||||
static void mccase __P((struct parse *p, cset *cs));
|
static void mccase __P((struct parse *p, cset *cs));
|
||||||
static int isinsets __P((struct re_guts *g, int c));
|
static int isinsets __P((struct re_guts *g, int c));
|
||||||
@ -295,7 +297,7 @@ int stop; /* character this ERE should end at */
|
|||||||
conc = HERE();
|
conc = HERE();
|
||||||
while (MORE() && (c = PEEK()) != '|' && c != stop)
|
while (MORE() && (c = PEEK()) != '|' && c != stop)
|
||||||
p_ere_exp(p);
|
p_ere_exp(p);
|
||||||
REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */
|
(void)REQUIRE(HERE() != conc, REG_EMPTY); /* require nonempty */
|
||||||
|
|
||||||
if (!EAT('|'))
|
if (!EAT('|'))
|
||||||
break; /* NOTE BREAK OUT */
|
break; /* NOTE BREAK OUT */
|
||||||
@ -342,7 +344,7 @@ register struct parse *p;
|
|||||||
pos = HERE();
|
pos = HERE();
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '(':
|
case '(':
|
||||||
REQUIRE(MORE(), REG_EPAREN);
|
(void)REQUIRE(MORE(), REG_EPAREN);
|
||||||
p->g->nsub++;
|
p->g->nsub++;
|
||||||
subno = p->g->nsub;
|
subno = p->g->nsub;
|
||||||
if (subno < NPAREN)
|
if (subno < NPAREN)
|
||||||
@ -355,7 +357,7 @@ register struct parse *p;
|
|||||||
assert(p->pend[subno] != 0);
|
assert(p->pend[subno] != 0);
|
||||||
}
|
}
|
||||||
EMIT(ORPAREN, subno);
|
EMIT(ORPAREN, subno);
|
||||||
MUSTEAT(')', REG_EPAREN);
|
(void)MUSTEAT(')', REG_EPAREN);
|
||||||
break;
|
break;
|
||||||
#ifndef POSIX_MISTAKE
|
#ifndef POSIX_MISTAKE
|
||||||
case ')': /* happens only if no current unmatched ( */
|
case ')': /* happens only if no current unmatched ( */
|
||||||
@ -398,12 +400,12 @@ register struct parse *p;
|
|||||||
p_bracket(p);
|
p_bracket(p);
|
||||||
break;
|
break;
|
||||||
case '\\':
|
case '\\':
|
||||||
REQUIRE(MORE(), REG_EESCAPE);
|
(void)REQUIRE(MORE(), REG_EESCAPE);
|
||||||
c = GETNEXT();
|
c = GETNEXT();
|
||||||
ordinary(p, c);
|
ordinary(p, c);
|
||||||
break;
|
break;
|
||||||
case '{': /* okay as ordinary except if digit follows */
|
case '{': /* okay as ordinary except if digit follows */
|
||||||
REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
|
(void)REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
ordinary(p, c);
|
ordinary(p, c);
|
||||||
@ -419,7 +421,7 @@ register struct parse *p;
|
|||||||
return; /* no repetition, we're done */
|
return; /* no repetition, we're done */
|
||||||
NEXT();
|
NEXT();
|
||||||
|
|
||||||
REQUIRE(!wascaret, REG_BADRPT);
|
(void)REQUIRE(!wascaret, REG_BADRPT);
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '*': /* implemented as +? */
|
case '*': /* implemented as +? */
|
||||||
/* this case does not require the (y|) trick, noKLUDGE */
|
/* this case does not require the (y|) trick, noKLUDGE */
|
||||||
@ -446,7 +448,7 @@ register struct parse *p;
|
|||||||
if (EAT(',')) {
|
if (EAT(',')) {
|
||||||
if (isdigit(PEEK())) {
|
if (isdigit(PEEK())) {
|
||||||
count2 = p_count(p);
|
count2 = p_count(p);
|
||||||
REQUIRE(count <= count2, REG_BADBR);
|
(void)REQUIRE(count <= count2, REG_BADBR);
|
||||||
} else /* single number with comma */
|
} else /* single number with comma */
|
||||||
count2 = INFINITY;
|
count2 = INFINITY;
|
||||||
} else /* just a single number */
|
} else /* just a single number */
|
||||||
@ -455,7 +457,7 @@ register struct parse *p;
|
|||||||
if (!EAT('}')) { /* error heuristics */
|
if (!EAT('}')) { /* error heuristics */
|
||||||
while (MORE() && PEEK() != '}')
|
while (MORE() && PEEK() != '}')
|
||||||
NEXT();
|
NEXT();
|
||||||
REQUIRE(MORE(), REG_EBRACE);
|
(void)REQUIRE(MORE(), REG_EBRACE);
|
||||||
SETERROR(REG_BADBR);
|
SETERROR(REG_BADBR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -478,7 +480,7 @@ static void
|
|||||||
p_str(p)
|
p_str(p)
|
||||||
register struct parse *p;
|
register struct parse *p;
|
||||||
{
|
{
|
||||||
REQUIRE(MORE(), REG_EMPTY);
|
(void)REQUIRE(MORE(), REG_EMPTY);
|
||||||
while (MORE())
|
while (MORE())
|
||||||
ordinary(p, GETNEXT());
|
ordinary(p, GETNEXT());
|
||||||
}
|
}
|
||||||
@ -521,7 +523,7 @@ register int end2; /* second terminating character */
|
|||||||
p->g->neol++;
|
p->g->neol++;
|
||||||
}
|
}
|
||||||
|
|
||||||
REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */
|
(void)REQUIRE(HERE() != start, REG_EMPTY); /* require nonempty */
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -546,7 +548,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
|||||||
assert(MORE()); /* caller should have ensured this */
|
assert(MORE()); /* caller should have ensured this */
|
||||||
c = GETNEXT();
|
c = GETNEXT();
|
||||||
if (c == '\\') {
|
if (c == '\\') {
|
||||||
REQUIRE(MORE(), REG_EESCAPE);
|
(void)REQUIRE(MORE(), REG_EESCAPE);
|
||||||
c = BACKSL | (unsigned char)GETNEXT();
|
c = BACKSL | (unsigned char)GETNEXT();
|
||||||
}
|
}
|
||||||
switch (c) {
|
switch (c) {
|
||||||
@ -576,7 +578,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
|||||||
assert(p->pend[subno] != 0);
|
assert(p->pend[subno] != 0);
|
||||||
}
|
}
|
||||||
EMIT(ORPAREN, subno);
|
EMIT(ORPAREN, subno);
|
||||||
REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
|
(void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
|
||||||
break;
|
break;
|
||||||
case BACKSL|')': /* should not get here -- must be user */
|
case BACKSL|')': /* should not get here -- must be user */
|
||||||
case BACKSL|'}':
|
case BACKSL|'}':
|
||||||
@ -606,7 +608,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
|||||||
p->g->backrefs = 1;
|
p->g->backrefs = 1;
|
||||||
break;
|
break;
|
||||||
case '*':
|
case '*':
|
||||||
REQUIRE(starordinary, REG_BADRPT);
|
(void)REQUIRE(starordinary, REG_BADRPT);
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
default:
|
default:
|
||||||
ordinary(p, c &~ BACKSL);
|
ordinary(p, c &~ BACKSL);
|
||||||
@ -624,7 +626,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
|||||||
if (EAT(',')) {
|
if (EAT(',')) {
|
||||||
if (MORE() && isdigit(PEEK())) {
|
if (MORE() && isdigit(PEEK())) {
|
||||||
count2 = p_count(p);
|
count2 = p_count(p);
|
||||||
REQUIRE(count <= count2, REG_BADBR);
|
(void)REQUIRE(count <= count2, REG_BADBR);
|
||||||
} else /* single number with comma */
|
} else /* single number with comma */
|
||||||
count2 = INFINITY;
|
count2 = INFINITY;
|
||||||
} else /* just a single number */
|
} else /* just a single number */
|
||||||
@ -633,7 +635,7 @@ int starordinary; /* is a leading * an ordinary character? */
|
|||||||
if (!EATTWO('\\', '}')) { /* error heuristics */
|
if (!EATTWO('\\', '}')) { /* error heuristics */
|
||||||
while (MORE() && !SEETWO('\\', '}'))
|
while (MORE() && !SEETWO('\\', '}'))
|
||||||
NEXT();
|
NEXT();
|
||||||
REQUIRE(MORE(), REG_EBRACE);
|
(void)REQUIRE(MORE(), REG_EBRACE);
|
||||||
SETERROR(REG_BADBR);
|
SETERROR(REG_BADBR);
|
||||||
}
|
}
|
||||||
} else if (c == (unsigned char)'$') /* $ (but not \$) ends it */
|
} else if (c == (unsigned char)'$') /* $ (but not \$) ends it */
|
||||||
@ -658,7 +660,7 @@ register struct parse *p;
|
|||||||
ndigits++;
|
ndigits++;
|
||||||
}
|
}
|
||||||
|
|
||||||
REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
|
(void)REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
|
||||||
return(count);
|
return(count);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -698,7 +700,7 @@ register struct parse *p;
|
|||||||
p_b_term(p, cs);
|
p_b_term(p, cs);
|
||||||
if (EAT('-'))
|
if (EAT('-'))
|
||||||
CHadd(cs, '-');
|
CHadd(cs, '-');
|
||||||
MUSTEAT(']', REG_EBRACK);
|
(void)MUSTEAT(']', REG_EBRACK);
|
||||||
|
|
||||||
if (p->error != 0) /* don't mess things up further */
|
if (p->error != 0) /* don't mess things up further */
|
||||||
return;
|
return;
|
||||||
@ -769,21 +771,21 @@ register cset *cs;
|
|||||||
switch (c) {
|
switch (c) {
|
||||||
case ':': /* character class */
|
case ':': /* character class */
|
||||||
NEXT2();
|
NEXT2();
|
||||||
REQUIRE(MORE(), REG_EBRACK);
|
(void)REQUIRE(MORE(), REG_EBRACK);
|
||||||
c = PEEK();
|
c = PEEK();
|
||||||
REQUIRE(c != '-' && c != ']', REG_ECTYPE);
|
(void)REQUIRE(c != '-' && c != ']', REG_ECTYPE);
|
||||||
p_b_cclass(p, cs);
|
p_b_cclass(p, cs);
|
||||||
REQUIRE(MORE(), REG_EBRACK);
|
(void)REQUIRE(MORE(), REG_EBRACK);
|
||||||
REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
|
(void)REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
|
||||||
break;
|
break;
|
||||||
case '=': /* equivalence class */
|
case '=': /* equivalence class */
|
||||||
NEXT2();
|
NEXT2();
|
||||||
REQUIRE(MORE(), REG_EBRACK);
|
(void)REQUIRE(MORE(), REG_EBRACK);
|
||||||
c = PEEK();
|
c = PEEK();
|
||||||
REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
|
(void)REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
|
||||||
p_b_eclass(p, cs);
|
p_b_eclass(p, cs);
|
||||||
REQUIRE(MORE(), REG_EBRACK);
|
(void)REQUIRE(MORE(), REG_EBRACK);
|
||||||
REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
|
(void)REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
|
||||||
break;
|
break;
|
||||||
default: /* symbol, ordinary character, or range */
|
default: /* symbol, ordinary character, or range */
|
||||||
/* xxx revision needed for multichar stuff */
|
/* xxx revision needed for multichar stuff */
|
||||||
@ -798,7 +800,7 @@ register cset *cs;
|
|||||||
} else
|
} else
|
||||||
finish = start;
|
finish = start;
|
||||||
/* xxx what about signed chars here... */
|
/* xxx what about signed chars here... */
|
||||||
REQUIRE(start <= finish, REG_ERANGE);
|
(void)REQUIRE(start <= finish, REG_ERANGE);
|
||||||
for (i = start; i <= finish; i++)
|
for (i = start; i <= finish; i++)
|
||||||
CHadd(cs, i);
|
CHadd(cs, i);
|
||||||
break;
|
break;
|
||||||
@ -866,13 +868,13 @@ register struct parse *p;
|
|||||||
{
|
{
|
||||||
register char value;
|
register char value;
|
||||||
|
|
||||||
REQUIRE(MORE(), REG_EBRACK);
|
(void)REQUIRE(MORE(), REG_EBRACK);
|
||||||
if (!EATTWO('[', '.'))
|
if (!EATTWO('[', '.'))
|
||||||
return(GETNEXT());
|
return(GETNEXT());
|
||||||
|
|
||||||
/* collating symbol */
|
/* collating symbol */
|
||||||
value = p_b_coll_elem(p, '.');
|
value = p_b_coll_elem(p, '.');
|
||||||
REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
|
(void)REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
|
||||||
return(value);
|
return(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1264,6 +1266,7 @@ register char *cp;
|
|||||||
cs->multis[cs->smultis - 1] = '\0';
|
cs->multis[cs->smultis - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if used
|
||||||
/*
|
/*
|
||||||
- mcsub - subtract a collating element from a cset
|
- mcsub - subtract a collating element from a cset
|
||||||
== static void mcsub(register cset *cs, register char *cp);
|
== static void mcsub(register cset *cs, register char *cp);
|
||||||
@ -1321,6 +1324,7 @@ register char *cp;
|
|||||||
return(p);
|
return(p);
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- mcinvert - invert the list of collating elements in a cset
|
- mcinvert - invert the list of collating elements in a cset
|
||||||
|
@ -88,23 +88,23 @@ static struct rerr {
|
|||||||
char *name;
|
char *name;
|
||||||
char *explain;
|
char *explain;
|
||||||
} rerrs[] = {
|
} rerrs[] = {
|
||||||
REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match",
|
{REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
|
||||||
REG_BADPAT, "REG_BADPAT", "invalid regular expression",
|
{REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
|
||||||
REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element",
|
{REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
|
||||||
REG_ECTYPE, "REG_ECTYPE", "invalid character class",
|
{REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
|
||||||
REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)",
|
{REG_EESCAPE, "REG_EESCAPE", "trailing backslash (\\)"},
|
||||||
REG_ESUBREG, "REG_ESUBREG", "invalid backreference number",
|
{REG_ESUBREG, "REG_ESUBREG", "invalid backreference number"},
|
||||||
REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced",
|
{REG_EBRACK, "REG_EBRACK", "brackets ([ ]) not balanced"},
|
||||||
REG_EPAREN, "REG_EPAREN", "parentheses not balanced",
|
{REG_EPAREN, "REG_EPAREN", "parentheses not balanced"},
|
||||||
REG_EBRACE, "REG_EBRACE", "braces not balanced",
|
{REG_EBRACE, "REG_EBRACE", "braces not balanced"},
|
||||||
REG_BADBR, "REG_BADBR", "invalid repetition count(s)",
|
{REG_BADBR, "REG_BADBR", "invalid repetition count(s)"},
|
||||||
REG_ERANGE, "REG_ERANGE", "invalid character range",
|
{REG_ERANGE, "REG_ERANGE", "invalid character range"},
|
||||||
REG_ESPACE, "REG_ESPACE", "out of memory",
|
{REG_ESPACE, "REG_ESPACE", "out of memory"},
|
||||||
REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid",
|
{REG_BADRPT, "REG_BADRPT", "repetition-operator operand invalid"},
|
||||||
REG_EMPTY, "REG_EMPTY", "empty (sub)expression",
|
{REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
|
||||||
REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug",
|
{REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
|
||||||
REG_INVARG, "REG_INVARG", "invalid argument to regex routine",
|
{REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
|
||||||
0, "", "*** unknown regexp error code ***",
|
{0, "", "*** unknown regexp error code ***"}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -38,6 +38,7 @@ static char sccsid[] = "@(#)atoi.c 8.1 (Berkeley) 6/4/93";
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
int
|
||||||
atoi(str)
|
atoi(str)
|
||||||
const char *str;
|
const char *str;
|
||||||
{
|
{
|
||||||
|
@ -46,7 +46,7 @@ calloc(num, size)
|
|||||||
register void *p;
|
register void *p;
|
||||||
|
|
||||||
size *= num;
|
size *= num;
|
||||||
if (p = malloc(size))
|
if ( (p = malloc(size)) )
|
||||||
bzero(p, size);
|
bzero(p, size);
|
||||||
return(p);
|
return(p);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@ static char sccsid[] = "@(#)getsubopt.c 8.1 (Berkeley) 6/4/93";
|
|||||||
*/
|
*/
|
||||||
char *suboptarg;
|
char *suboptarg;
|
||||||
|
|
||||||
|
int
|
||||||
getsubopt(optionp, tokens, valuep)
|
getsubopt(optionp, tokens, valuep)
|
||||||
register char **optionp, **valuep;
|
register char **optionp, **valuep;
|
||||||
register char * const *tokens;
|
register char * const *tokens;
|
||||||
|
@ -46,6 +46,7 @@ char *__findenv __P((const char *, int *));
|
|||||||
* Set the value of the environmental variable "name" to be
|
* Set the value of the environmental variable "name" to be
|
||||||
* "value". If rewrite is set, replace any current value.
|
* "value". If rewrite is set, replace any current value.
|
||||||
*/
|
*/
|
||||||
|
int
|
||||||
setenv(name, value, rewrite)
|
setenv(name, value, rewrite)
|
||||||
register const char *name;
|
register const char *name;
|
||||||
register const char *value;
|
register const char *value;
|
||||||
@ -63,7 +64,7 @@ setenv(name, value, rewrite)
|
|||||||
if (!rewrite)
|
if (!rewrite)
|
||||||
return (0);
|
return (0);
|
||||||
if (strlen(c) >= l_value) { /* old larger; copy over */
|
if (strlen(c) >= l_value) { /* old larger; copy over */
|
||||||
while (*c++ = *value++);
|
while ( (*c++ = *value++) );
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
} else { /* create new slot */
|
} else { /* create new slot */
|
||||||
@ -93,7 +94,7 @@ setenv(name, value, rewrite)
|
|||||||
malloc((size_t)((int)(c - name) + l_value + 2))))
|
malloc((size_t)((int)(c - name) + l_value + 2))))
|
||||||
return (-1);
|
return (-1);
|
||||||
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
|
for (c = environ[offset]; (*c = *name++) && *c != '='; ++c);
|
||||||
for (*c++ = '='; *c++ = *value++;);
|
for (*c++ = '='; (*c++ = *value++); );
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ Balloc
|
|||||||
int x;
|
int x;
|
||||||
Bigint *rv;
|
Bigint *rv;
|
||||||
|
|
||||||
if (rv = freelist[k]) {
|
if ( (rv = freelist[k]) ) {
|
||||||
freelist[k] = rv->next;
|
freelist[k] = rv->next;
|
||||||
} else {
|
} else {
|
||||||
x = 1 << k;
|
x = 1 << k;
|
||||||
@ -628,7 +628,7 @@ mult
|
|||||||
xc0 = c->x;
|
xc0 = c->x;
|
||||||
#ifdef Pack_32
|
#ifdef Pack_32
|
||||||
for (; xb < xbe; xb++, xc0++) {
|
for (; xb < xbe; xb++, xc0++) {
|
||||||
if (y = *xb & 0xffff) {
|
if ( (y = *xb & 0xffff) ) {
|
||||||
x = xa;
|
x = xa;
|
||||||
xc = xc0;
|
xc = xc0;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
@ -641,7 +641,7 @@ mult
|
|||||||
} while (x < xae);
|
} while (x < xae);
|
||||||
*xc = carry;
|
*xc = carry;
|
||||||
}
|
}
|
||||||
if (y = *xb >> 16) {
|
if ( (y = *xb >> 16) ) {
|
||||||
x = xa;
|
x = xa;
|
||||||
xc = xc0;
|
xc = xc0;
|
||||||
carry = 0;
|
carry = 0;
|
||||||
@ -690,7 +690,7 @@ pow5mult
|
|||||||
int i;
|
int i;
|
||||||
static int p05[3] = { 5, 25, 125 };
|
static int p05[3] = { 5, 25, 125 };
|
||||||
|
|
||||||
if (i = k & 3)
|
if ( (i = k & 3) )
|
||||||
b = multadd(b, p05[i-1], 0);
|
b = multadd(b, p05[i-1], 0);
|
||||||
|
|
||||||
if (!(k >>= 2))
|
if (!(k >>= 2))
|
||||||
@ -752,7 +752,7 @@ lshift
|
|||||||
*x1++ = *x << k | z;
|
*x1++ = *x << k | z;
|
||||||
z = *x++ >> k1;
|
z = *x++ >> k1;
|
||||||
} while (x < xe);
|
} while (x < xe);
|
||||||
if (*x1 = z)
|
if ( (*x1 = z) )
|
||||||
++n1;
|
++n1;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -918,7 +918,7 @@ ulp
|
|||||||
} else {
|
} else {
|
||||||
word0(a) = 0;
|
word0(a) = 0;
|
||||||
L -= Exp_shift;
|
L -= Exp_shift;
|
||||||
word1(a) = L >= 31 ? 1 : 1 << 31 - L;
|
word1(a) = L >= 31 ? 1 : 1 << (31 - L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -953,16 +953,16 @@ b2d
|
|||||||
*e = 32 - k;
|
*e = 32 - k;
|
||||||
#ifdef Pack_32
|
#ifdef Pack_32
|
||||||
if (k < Ebits) {
|
if (k < Ebits) {
|
||||||
d0 = Exp_1 | y >> Ebits - k;
|
d0 = Exp_1 | (y >> (Ebits - k));
|
||||||
w = xa > xa0 ? *--xa : 0;
|
w = xa > xa0 ? *--xa : 0;
|
||||||
d1 = y << (32-Ebits) + k | w >> Ebits - k;
|
d1 = (y << ((32-Ebits) + k)) | (w >> (Ebits - k));
|
||||||
goto ret_d;
|
goto ret_d;
|
||||||
}
|
}
|
||||||
z = xa > xa0 ? *--xa : 0;
|
z = xa > xa0 ? *--xa : 0;
|
||||||
if (k -= Ebits) {
|
if (k -= Ebits) {
|
||||||
d0 = Exp_1 | y << k | z >> 32 - k;
|
d0 = Exp_1 | (y << k) | (z >> (32 - k));
|
||||||
y = xa > xa0 ? *--xa : 0;
|
y = xa > xa0 ? *--xa : 0;
|
||||||
d1 = z << k | y >> 32 - k;
|
d1 = (z << k) | (y >> (32 - k));
|
||||||
} else {
|
} else {
|
||||||
d0 = Exp_1 | y;
|
d0 = Exp_1 | y;
|
||||||
d1 = z;
|
d1 = z;
|
||||||
@ -1029,13 +1029,13 @@ d2b
|
|||||||
z |= Exp_msk11;
|
z |= Exp_msk11;
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
if (de = (int)(d0 >> Exp_shift))
|
if ( (de = (int)(d0 >> Exp_shift)) )
|
||||||
z |= Exp_msk1;
|
z |= Exp_msk1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef Pack_32
|
#ifdef Pack_32
|
||||||
if (y = d1) {
|
if ( (y = d1) ) {
|
||||||
if (k = lo0bits(&y)) {
|
if ( (k = lo0bits(&y)) ) {
|
||||||
x[0] = y | z << 32 - k;
|
x[0] = y | (z << (32 - k));
|
||||||
z >>= k;
|
z >>= k;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1371,9 +1371,9 @@ strtod
|
|||||||
/* Get starting approximation = rv * 10**e1 */
|
/* Get starting approximation = rv * 10**e1 */
|
||||||
|
|
||||||
if (e1 > 0) {
|
if (e1 > 0) {
|
||||||
if (i = e1 & 15)
|
if ( (i = e1 & 15) )
|
||||||
rv *= tens[i];
|
rv *= tens[i];
|
||||||
if (e1 &= ~15) {
|
if ( (e1 &= ~15) ) {
|
||||||
if (e1 > DBL_MAX_10_EXP) {
|
if (e1 > DBL_MAX_10_EXP) {
|
||||||
ovfl:
|
ovfl:
|
||||||
errno = ERANGE;
|
errno = ERANGE;
|
||||||
@ -1413,9 +1413,9 @@ strtod
|
|||||||
}
|
}
|
||||||
} else if (e1 < 0) {
|
} else if (e1 < 0) {
|
||||||
e1 = -e1;
|
e1 = -e1;
|
||||||
if (i = e1 & 15)
|
if ( (i = e1 & 15) )
|
||||||
rv /= tens[i];
|
rv /= tens[i];
|
||||||
if (e1 &= ~15) {
|
if ( (e1 &= ~15) ) {
|
||||||
e1 >>= 4;
|
e1 >>= 4;
|
||||||
for (j = 0; e1 > 1; j++, e1 >>= 1)
|
for (j = 0; e1 > 1; j++, e1 >>= 1)
|
||||||
if (e1 & 1)
|
if (e1 & 1)
|
||||||
@ -1946,13 +1946,13 @@ __dtoa
|
|||||||
#ifdef Sudden_Underflow
|
#ifdef Sudden_Underflow
|
||||||
i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
|
i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1));
|
||||||
#else
|
#else
|
||||||
if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) {
|
if ( (i = (int)((word0(d) >> Exp_shift1) & (Exp_mask>>Exp_shift1))) ) {
|
||||||
#endif
|
#endif
|
||||||
d2 = d;
|
d2 = d;
|
||||||
word0(d2) &= Frac_mask1;
|
word0(d2) &= Frac_mask1;
|
||||||
word0(d2) |= Exp_11;
|
word0(d2) |= Exp_11;
|
||||||
#ifdef IBM
|
#ifdef IBM
|
||||||
if (j = 11 - hi0bits(word0(d2) & Frac_mask))
|
if ( (j = 11 - hi0bits(word0(d2) & Frac_mask)) )
|
||||||
d2 /= 1 << j;
|
d2 /= 1 << j;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1989,8 +1989,8 @@ __dtoa
|
|||||||
/* d is denormalized */
|
/* d is denormalized */
|
||||||
|
|
||||||
i = bbits + be + (Bias + (P-1) - 1);
|
i = bbits + be + (Bias + (P-1) - 1);
|
||||||
x = i > 32 ? word0(d) << 64 - i | word1(d) >> i - 32
|
x = i > 32 ? ((word0(d) << (64 - i)) | (word1(d) >> (i - 32)))
|
||||||
: word1(d) << 32 - i;
|
: (word1(d) << (32 - i));
|
||||||
d2 = x;
|
d2 = x;
|
||||||
word0(d2) -= 31*Exp_msk1; /* adjust exponent */
|
word0(d2) -= 31*Exp_msk1; /* adjust exponent */
|
||||||
i -= (Bias + (P-1) - 1) + 1;
|
i -= (Bias + (P-1) - 1) + 1;
|
||||||
@ -2087,7 +2087,7 @@ __dtoa
|
|||||||
ds *= bigtens[i];
|
ds *= bigtens[i];
|
||||||
}
|
}
|
||||||
d /= ds;
|
d /= ds;
|
||||||
} else if (j1 = -k) {
|
} else if ( (j1 = -k) ) {
|
||||||
d *= tens[j1 & 0xf];
|
d *= tens[j1 & 0xf];
|
||||||
for (j = j1 >> 4; j; j >>= 1, i++)
|
for (j = j1 >> 4; j; j >>= 1, i++)
|
||||||
if (j & 1) {
|
if (j & 1) {
|
||||||
@ -2186,7 +2186,7 @@ __dtoa
|
|||||||
*s++ = '0' + (int)L;
|
*s++ = '0' + (int)L;
|
||||||
if (i == ilim) {
|
if (i == ilim) {
|
||||||
d += d;
|
d += d;
|
||||||
if (d > ds || d == ds && L & 1) {
|
if (d > ds || (d == ds && L & 1)) {
|
||||||
bump_up:
|
bump_up:
|
||||||
while (*--s == '9')
|
while (*--s == '9')
|
||||||
if (s == s0) {
|
if (s == s0) {
|
||||||
@ -2250,7 +2250,7 @@ __dtoa
|
|||||||
Bfree(b);
|
Bfree(b);
|
||||||
b = b1;
|
b = b1;
|
||||||
}
|
}
|
||||||
if (j = b5 - m5)
|
if ( (j = b5 - m5) )
|
||||||
b = pow5mult(b, j);
|
b = pow5mult(b, j);
|
||||||
} else
|
} else
|
||||||
b = pow5mult(b, b5);
|
b = pow5mult(b, b5);
|
||||||
@ -2283,10 +2283,10 @@ __dtoa
|
|||||||
* can do shifts and ors to compute the numerator for q.
|
* can do shifts and ors to compute the numerator for q.
|
||||||
*/
|
*/
|
||||||
#ifdef Pack_32
|
#ifdef Pack_32
|
||||||
if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f)
|
if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) )
|
||||||
i = 32 - i;
|
i = 32 - i;
|
||||||
#else
|
#else
|
||||||
if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf)
|
if ( (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) )
|
||||||
i = 16 - i;
|
i = 16 - i;
|
||||||
#endif
|
#endif
|
||||||
if (i > 4) {
|
if (i > 4) {
|
||||||
@ -2359,15 +2359,15 @@ __dtoa
|
|||||||
goto ret;
|
goto ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (j < 0 || j == 0 && !mode
|
if (j < 0 || (j == 0 && !mode
|
||||||
#ifndef ROUND_BIASED
|
#ifndef ROUND_BIASED
|
||||||
&& !(word1(d) & 1)
|
&& !(word1(d) & 1)
|
||||||
#endif
|
#endif
|
||||||
) {
|
)) {
|
||||||
if (j1 > 0) {
|
if (j1 > 0) {
|
||||||
b = lshift(b, 1);
|
b = lshift(b, 1);
|
||||||
j1 = cmp(b, S);
|
j1 = cmp(b, S);
|
||||||
if ((j1 > 0 || j1 == 0 && dig & 1)
|
if ((j1 > 0 || (j1 == 0 && dig & 1))
|
||||||
&& dig++ == '9')
|
&& dig++ == '9')
|
||||||
goto round_9_up;
|
goto round_9_up;
|
||||||
}
|
}
|
||||||
@ -2406,7 +2406,7 @@ __dtoa
|
|||||||
|
|
||||||
b = lshift(b, 1);
|
b = lshift(b, 1);
|
||||||
j = cmp(b, S);
|
j = cmp(b, S);
|
||||||
if (j > 0 || j == 0 && dig & 1) {
|
if (j > 0 || (j == 0 && dig & 1)) {
|
||||||
roundoff:
|
roundoff:
|
||||||
while (*--s == '9')
|
while (*--s == '9')
|
||||||
if (s == s0) {
|
if (s == s0) {
|
||||||
|
@ -112,7 +112,7 @@ strtol(nptr, endptr, base)
|
|||||||
break;
|
break;
|
||||||
if (c >= base)
|
if (c >= base)
|
||||||
break;
|
break;
|
||||||
if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
|
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||||
any = -1;
|
any = -1;
|
||||||
else {
|
else {
|
||||||
any = 1;
|
any = 1;
|
||||||
|
@ -119,7 +119,7 @@ strtoq(nptr, endptr, base)
|
|||||||
break;
|
break;
|
||||||
if (c >= base)
|
if (c >= base)
|
||||||
break;
|
break;
|
||||||
if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
|
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||||
any = -1;
|
any = -1;
|
||||||
else {
|
else {
|
||||||
any = 1;
|
any = 1;
|
||||||
|
@ -119,7 +119,7 @@ strtoq(nptr, endptr, base)
|
|||||||
break;
|
break;
|
||||||
if (c >= base)
|
if (c >= base)
|
||||||
break;
|
break;
|
||||||
if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
|
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||||
any = -1;
|
any = -1;
|
||||||
else {
|
else {
|
||||||
any = 1;
|
any = 1;
|
||||||
|
@ -90,7 +90,7 @@ strtoul(nptr, endptr, base)
|
|||||||
break;
|
break;
|
||||||
if (c >= base)
|
if (c >= base)
|
||||||
break;
|
break;
|
||||||
if (any < 0 || acc > cutoff || acc == cutoff && c > cutlim)
|
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||||
any = -1;
|
any = -1;
|
||||||
else {
|
else {
|
||||||
any = 1;
|
any = 1;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user