2 /* This is a hack. I totally deny writing it. If this code breaks,
3 * you get to keep all the pieces. JRS, 23 feb 99.
19 int nh_stdout ( void )
25 int nh_stderr ( void )
31 int nh_open ( char* fname, int wr )
35 f = fopen ( fname, (wr==0) ? "r": ((wr==1) ? "w" : "a") );
39 void nh_close ( FILE* f )
46 void nh_flush ( FILE* f )
52 void nh_write ( FILE* f, int c )
56 if (f==stderr) { fflush(f); }
57 if (f==stdout) { fflush(f); }
60 int nh_read ( FILE* f )
71 int nh_malloc ( int n )
77 void nh_free ( int n )
82 void nh_store ( int p, int ch )
89 return (int)(*(char*)p);
92 int nh_getenv ( int p )
94 return (int)getenv ( (const char *)p );
101 int nh_init_args ( int argc, char *argv[] )
112 int nh_argvb ( int argno, int offset )
114 return prog_argv[argno][offset];