# include "../handy.h"
#endif
-#undef Nullfp
-#define Nullfp Null(FILE*)
-
#define Nullop 0
#define OPROG 1
EXT char buf[2048];
EXT char *bufptr INIT(buf);
-EXT STR *linestr INIT(Nullstr);
+EXT STR *linestr INIT(NULL);
EXT char tokenbuf[2048];
EXT int expectterm INIT(TRUE);
# endif
#endif
-EXT STR *freestrroot INIT(Nullstr);
+EXT STR *freestrroot INIT(NULL);
EXT STR str_no;
EXT STR str_yes;
EXT bool nomemok INIT(FALSE);
EXT char const_FS INIT(0);
-EXT char *namelist INIT(Nullch);
+EXT char *namelist INIT(NULL);
EXT char fswitch INIT(0);
EXT bool old_awk INIT(0);
/* open script */
- if (argv[0] == Nullch) {
+ if (argv[0] == NULL) {
#if defined(OS2) || defined(WIN32) || defined(NETWARE)
if ( isatty(fileno(stdin)) )
usage();
rsfp = stdin;
else
rsfp = fopen(argv[0],"r");
- if (rsfp == Nullfp)
+ if (rsfp == NULL)
fatal("Awk script \"%s\" doesn't seem to exist.\n",filename);
/* init tokener */
if (!rsfp)
RETURN(0);
line++;
- if ((s = str_gets(linestr, rsfp)) == Nullch) {
+ if ((s = str_gets(linestr, rsfp)) == NULL) {
if (rsfp != stdin)
fclose(rsfp);
- rsfp = Nullfp;
+ rsfp = NULL;
s = str_get(linestr);
RETURN(0);
}
* buffer, so we getc() it back out and stuff it in the buffer.
*/
i = getc(fp);
- if (i == EOF) return Nullch;
+ if (i == EOF) return NULL;
*(--((*fp)->_ptr)) = (unsigned char) i;
(*fp)->_cnt++;
#endif
static char buf[4192];
- if (fgets(buf, sizeof buf, fp) != Nullch)
+ if (fgets(buf, sizeof buf, fp) != NULL)
str_set(str, buf);
else
str_set(str, No);
#endif /* USE_STDIO_PTR && STDIO_PTR_LVALUE && STDIO_CNT_LVALUE */
- return str->str_cur ? str->str_ptr : Nullch;
+ return str->str_cur ? str->str_ptr : NULL;
}
STR *
char str_nok; /* state of str_nval */
};
-#define Nullstr Null(STR*)
-
/* the following macro updates any magic values this str is associated with */
#define STABSET(x) (x->str_link.str_magic && stabset(x->str_link.str_magic,x))
fprintf(stderr,"0x%lx: (%05d) malloc %ld bytes\n",(unsigned long)ptr,
an++,(long)size);
#endif
- if (ptr != Nullch)
+ if (ptr != NULL)
return ptr;
else {
fputs(nomem,stdout) FLUSH;
fprintf(stderr,"0x%lx: (%05d) realloc %ld bytes\n",(unsigned long)ptr,an++,(long)size);
}
#endif
- if (ptr != Nullch)
+ if (ptr != NULL)
return ptr;
else {
fputs(nomem,stdout) FLUSH;
for (t = big; *t; t++) {
for (x=t,s=little; *s; x++,s++) {
if (!*x)
- return Nullch;
+ return NULL;
if (*s != *x)
break;
}
if (!*s)
return t;
}
- return Nullch;
+ return NULL;
}
/* copy a string to a safe spot */
const char *rparen;
const char *limit;
STR *subs;
-STR *curargs = Nullstr;
+STR *curargs = NULL;
static void addsemi ( STR *str );
static void emit_split ( STR *str, int level );
str_cat(curargs,",");
tmp2str=walk(1,level,ops[node+5].ival,&numarg,P_MIN);
str_free(curargs);
- curargs = Nullstr;
+ curargs = NULL;
level--;
subretnum |= numarg;
- s = Nullch;
+ s = NULL;
t = tmp2str->str_ptr;
while ((t = instr(t,"return ")))
s = t++;
}
}
else {
- str = Nullstr;
+ str = NULL;
}
break;
}