!a () [] -> . !b ! ~ ++ -- - (type) * & sizeof !c * / % !d + - !e << >> !f < <= > >= !g == != !h & !i ^ !j | !k && !l || !m ?: !n = += -= *= /= %= <<= >>= &= ^= |= !o , $$cl16() close all channels $$ctim(buffer) char* Sun Sep 16 01:03:52 1973\0\0 struct TIME buffer; $$ctype is...() functions $$dtoa(buff,conv,field,dplace,value) char * pointer to trailing null byte char *buff; result here char conv; lowercase 'g' | 'e' | 'f' int field; max field width int dplace; decimal part width double value; input $$exst int exit status value $$fadd(a,b) double; double a,b; floating add $$fail(); immediate exit $$flow FILE *; NULL, or gets trace $$fmul(a,b) double; double a,b; floating mul $$fopa RT11 file open $$fopr RT11 file open $$fopt decode options for fopen() etc $$frta OBSOLETE return FP to caller a $$frtb OBSOLETE return FP to caller b $$fsav OBSOLETE save FP $$fsub(a,b) double; double a,b; floating sub $$gcmd(text,in,out,avp,task) int argc char * text; command line (modified) char ** in; default stdin filename char ** out; default stdout filename char ***avp; gets argv[] location char * task; default task name $$get get a record $$getc get a byte $$init runtime system O/S-depndnt code $$link() display memory links to stderr $$locate(t,key) PAIR*; TABLE*t; char*key; hash table, internal worker $$ltoa(buff,radix,value) convert long to ascii char * buff; result here char radix; 'd'=10 'o'=8 'u', 'X', 'x' long value; input $$main() kickstart runtime system int $$opsy; operating system code number int $$rsts; TRUE if rsts/e int $$vms; TRUE if vms int $$pos; TRUE if pox (dec calls it p/os) int $$uic; RSX: default uic int $$stnd; stack end point int $$scca; RT11: .scca control char * $$task; RSX: task name int $$tick; clock interrupt rate (Hz) int (*$$pptr)(); profile printer int $$argc; argc char ***$$argv; argv char * $$mtop; start of free memory char * $$mend; end of free memory $$mchk() panicif memory management wedged $$narg int TRUE if no prompt wanted $$prmt char * user's prefered prompt string $$prnt(fmt,argv,f);char*fmt;char**argv;FILE*f; formatted output worker $$prof(); write execution profile int $$prnl; number of profile entries/line char * $$pfil; NULL, or name of profile file $$put write record $$putc write byte $$qiow do an I/O (rsx) $$rtim(buffer) return GTIM$ to buffer struct TIME buffer; $$scan(fmt,argv,f)char*fmt;char**argv;FILE*f; formatted scan worker $$scan(fmt,argv,iov)char*fmt,**argv;FILE*iov; scanf() worker. _doscan() $$sstt RSX synchronous trap vector $$svr1 save R1:R5 co-routine $$t410 RT vector 4 & 10 traps $$utim(buffer) long; struct TIME buffer; number seconds since 1jan1970 $_$cas(s); char * s; Modify string, "word" -> "Word" $_$np(n,in,d,out);char *in, *out, d; int n; get n'th part of in, delimiter d $_$rtb(s); char * s; OBSOLETE use trim() $_$uc(s); char *s; uppercase whole string $_$xs(out,in,len);char *out, *in; unsigned len; extract substring PAIR struct{ char * key; string key int value; ? }; used in tables.c TABLE struct{ int tsize; ? struct PAIR tdata[]; ? }; hash table in tables.c TIME struct{ int year; G.TIYR year-1900 int month; G.TIMO jan == 1 int day; G.TIDA int hour; G.TIHR 00 : 23 int minute; G.TIMI 00 : 59 int second; G.TISC 00 : 59 int tick; G.TICT 00 : tsec-1 int tsec; G.TICP ticks/second }; (rsx GTIM$ compliant) VSTRING struct{ char* vsdata; the variable-length string unsigned vslen; used size (cahrs) unsigned vsdim; current size (chars) unsigned vsext; extension size (chars) }; abort() close files, die on BPT abs(val) int; int val; absolute value alloc(n) char *; int n; OBSOLETE -1 if can't.cf malloc() ascr50(count,in,out);int count;char*in;int*out; convertcount chars to rad50 asctime(tm)char*; struct TIME*tm; time buffer -> ascii asl$i(i,j)int; int i,j; i << j asl$l(l,n) long; long l; long n,maybe <0; arithmetic shift left (32bits) asl$li(l,n) long; long l; int n,maybe <0; arithmetic shift left (32bits) asl$r(l,n) long; long l; long n,maybe <0; arithmetic shift right (32bits) asl$ri(l,n) long; long l; int n,maybe <0; arithmetic shift right (32bits) asr$i(i,j)int; int i,j; i >> j asr$u(u,n) unsigned; unsigned u; int n; u>>n, n may be -ve atod(input) double; char * input; ascii -> double precision atof(buffer) float ascii -> single precision char * buffer; input atofd(buffer) double DUMMY atof() - crash if called atoi(string) int ascii -> integer char * string; input string atol(string) long ascii -> long integer char * string; input string blkcmp(a,b,len)int; char *a, *b; unsigned len; -1,0,+1 a&b have len chars blkeq(a,b,len)int; char *a, *b; unsigned len; 0 unless len chars of a,b same brk(addr) char*; char*addr; declare top-of-memory.cf sbrk() call(subr,n,&arg1...&argn)int; call FORTRAN subr, n arguments caller() char*; return string name of caller calloc(nitems,length) char*; int nitems,length; alloc space for vector. 0=fail calltrace(ofd); FILE * ofd; print calling path on ofd chrtab char[128]; ascii character characteristics clearerr(iop); FILE * iop; clear any error flags of file clrttab(t,max); char t[]; unsigned max; clear a translation table concat(out,in0,...inn,0)char*;char*out,in0...; concatenate all input strings copy(out,in,nchars)char*;char*out,in; copy nchars bytes cpystr(out,in)char*;char*out,in); strcpy, but return END of out cret$ standard entry utility cspawn(tsk,cmnd,efn)int;char*tsk,*cmnd;int efn; spawn command, wait for status csv$ standard return utility ctime(tvecp)char*; long* tvecp; long time -> ascii ctos(c) char*; char c; new string containing a char ddtoa() dummy dtoa() crash if called delete(filename); char * filename; delete the file, 0=fail devpar(str,&dev,&unt); char*str; int dev,unt; ascii -> RSX device,unit div$i(i,j)int; int i,j; i / j div$l(long,long) long; quotient div$li(long,int) long; quotient envreset(frame,hval,lval);int *frame,hval,lval; cf envsave()hval:lval->frame envsave() int *; save environment for envreset() error(format,args...); char*format; printf->stderr, exit()stat=error esc(ppc) ; char ** ppc; get next char, understand \... eval(str,result) int; char * str; ... *result; string -> number, error-code exit(); exit, no return exits(stat); int stat; exit, emit status stat fabs(val) double; double val; absolute value fclear(iop); FILE * iop; clear error flags of file fclose(iop); FILE * iop; close file. 0=OK feof(iop) int; FILE * iop; 1=file is at end, 0=not at end ferr(iop) int; FILE * iop; OBSOLETE subsumed by ferror() ferror(iop) int; FILE * iop; 1=error, 0=ok status of file fflush(iop); FILE * iop; flush output buffers of file fget(buf,max,iop)int;char*buf;int max;FILE*iop; return # chars actually read fgetname(iop,buf)char*; FILE * iop; char*buf; file's name -> buffer fgets(buf,mx,f)char*;char*buf;int mx;FILE*f; NULL=error fgetss(buf,mx,f)char*;char*buf;int mx;FILE*f; NULL=error fileno(iop) int; FILE * iop; file number (LUN or channel) fill(addr,ch,count); char *addr,ch; int count; fill a space with ch flex(dim,siz,ext); int dim,siz,ext; create a new flex flun(iop) int; FILE * iop; OBSOLETE subsumed by fileno() fmatch(name,pattern) int; char *name, *pattern; TRUE if name matches pattern fmkdl(iop) int; FILE * iop; close & delete a file. 0=ok fnext(iop) FILE *; open next file NELL=end fopen(name,mode) FILE*; char* name,mode; open file NULL=bad fopenr(filnam,siz)FILE*; char*filnam;int siz; create of fopenx() fopenr(filnam,siz)FILE*; char*filnam;int siz; readonly of fopenx() fopenx(filnam,siz)FILE*; char*filnam;int siz; update file: fixed-leng records fprintf(iop,fmt,args...) FILE*iop; char*fmt; formatted print to file fps(stat); int stat; set floating point status fput(buf,len,f)int;char*buf;int len;FILE*f; output record, no '\n' fiddles fputs(str,f); char * str; FILE * f; string -> file fputss(str,f); char * str; FILE * f; string + '\n' -> file fread(ob,sz,n,f)int;char*ob;int sz,n;FILE*f; read n objects of size sz frec(iop) int; FILE * iop; TRUE if file is record-oriented freopen(name,mode) FILE*; char* name,mode; close, open new file NULL=bad frget(buf,siz,f,n)int;char *buf;FILE*f;long n; get n'th record from file frput(buf,siz,f,n)int;char *buf;FILE*f;long n; put n'th record from file fscanf(f,fmt,pointer(s)) int;FILE*f;char*fmt; scan a line from file fscanf(f,fmt,pointers...)int; FILE*f; char*fmt; return number of pointers used fseek(f,offset,0) int; FILE * f; long offset; 0=OK EOF=error fsize(f) long; FILE *f; return file size (bytes) fspool(f) FILE * f; close file then print it ftell(f) long; FILE * f; report position in file ftime(tbp) long; struct timeb * tbp; time of day (seconds), ->tbp ftty(iop) int; FILE * iop; 1 = terminal file fwild(name,mode) FILE*; char* name,mode; open file(s) NULL=bad fwrite(ob,sz,n,f)int;char*ob;int sz,n;FILE*f; write n objects of size sz fxadd(fx,item) FLEX*; FLEX*fx; char* item; add item to flex fxaddo(fx,itm,ord)FLEX*;FLEX*fx;char*itm;ord(); add item in flex, in order fxejec(fx,n) FLEX*fx; unsigned n; remove item # n from flex fxfree(fx); FLEX*fx; free a flex fxinject(fx,itm,n)FLEX*;FLEX*fx;char*itm;int n; add item to a flex, slot # n fxitem(fx,n) char *; FLEX * fx; unsigned n; return address of flex item # n fxneed(fx,n) FLEX*; FLEX*fx; unsigned n; make flex room for n more items fxset(fx,itm,n)FLEX*;FLEX*fx;char*itm; int n; make nth item in flex = ... getc(f) int; FILE * f; EOF = error, or file-end getchar() int; EOF = error, or file-end gets(buf) char *; char * buf; '\n' -> '\0' in buf NULL=bad gettty(buf); char * buf; control terminal name getw(f) FILE * f; yields next 16 bits from stream inchr(str,chr) int; char *str, chr; -1,or 0-base index of chr in str index(str,chr) char *; char *str, chr; OBSOLETE subsumed by strchr() instr(str,pat)char*; char *str, *pat; address of 1st pattern in str ioerr(); report last file error to stderr iov FILE * $$luns[]; IOV pointer table FILE * $$lune; end of $$luns char * $$lmax; RSX $$luns limit char ** $$ifil; stdin file name char ** $$ofil; stdout file name int $$nlun; RSX: number of luns FILE * $$eiov; stderr iov for RSX int $$iosb[2]; RSX: I/O status block for QIOW$ iovtoa(f,str)char*; FILE*f; char*str; OBSOLETE subsumed by fgetname() irand(arg) int; int arg (0 means 32768); random range [0:arg-1]. isalfnum(c)int; char c; isalnu() isalloc(p) int; char * p; 1=in use, -1=free, 0=error isalnu(c) int; char c; TRUE if alphanumeric isalph(c) int; char c; TRUE if alphabetic isasci(c) int; char c; TRUE if c < 8 bits isatty(cnl) int; int cnl (channel number); 1=opened terminal iscntrl(c) int; char c; TRUE if control character isdigi(c) int; char c; TRUE if decimal digit isgrap(c) int; char c; TRUE if it needs ink to print islowe(c) int; char c; TRUE if lowercase alphabetic isprin(c) int; char c; TRUE if isgraph() or if space ispunc(c) int; char c; TRUE if ??? punctuation ??? isspac(c) int; char c; TRUE if of " \b\n\r\t\f" isuppe(c) int; char c; TRUE if uppercase alphabetic iswhit(c) int; char c; TRUE if of " \t\n\v\f" isxdig(c) int; char c; TRUE : "0123456789abcdefABCDEF" itoa(val,str) char *; int val; char * str; val -> signed decimal string itoa8(val,str) char *; int val; char * str; val -> unsigned octal string itoax(val,str) char *; int val; char * str; val -> hexadecimal string kbin() int; unechoed console read 1 char kbinr() int; kbin(), -1 means nothing yet left(s,l); char*s; unsigned l; new string, l leftmost chars localtime(tvp) struct tm *; long * tvec; unix time -> vector longjmp(env); jmp_buf env; restore context. malloc(siz) char *; unsigned siz; NULL = fail, allocate memory match(str,pat)char*; char *str, *pat; leading string match max(a,b) int; int a, b; signed maximum maxu(a,b) unsigned; unsigned a, b; unsigned maximum memdmp(start,end); char * start, end (0=stack); formatted memory dump -> stderr mfree(p) char * p; de-allocate memory mid(s,n,l); char*s; unsigned s,l; new string, s[n:n+l-1] min(a,b) int; int a, b; signed minimum minu(a,b) unsigned; unsigned a, b; unsigned minimum mod$i(i,j)int; int i,j; i % j mod$l(long,long) long; remainder mod$li(long,int) long; remainder msg(text); char * text; msg -> stderr mul$i(i,j)int; int i,j; i * j mul$l(a,b) long; long a, b; multiply mul$li(a,b) long; long a; int b; multiply peek(loc) int; char * loc; examine memory. BPT if not RSTS perror(text); char * text; print text + error-explanation pmatch(str,pat)int; char * str, *pat; UNIX file pattern match printf(fmt,args...) int; char * fmt; ... formatted print to stderr putc(c,f) int; char c; FILE * f; output char to file EOF=bad putchar(c) int; char c; output char to stdout EOF=bad puts(str); char * str; string + '\n' -> stdout putw(word, f)int; int word; FILE * f; 16 bits -> file. 0=OK EOF=bad qset(nelements); int nelements; RT-11 add queue elements qsort(array,nlmnts,lmntsiz,compare); ...; quicksort in memory r50toa(buf,r5vec,len);char*buf;int *r5vec,len; len words of rad50 -> ascii ranacc(f); FILE *f; set random access mode rand() long; pseudo-random number int seed; seed for next random number rb struct{ unsigned rb_len; item length (chars) char * rb_in; next slot to fill, NULL=empty char * rb_out; next slot to empty char * rb_beg; 1st char of ring buffer char * rb_end; just after last char of ringbufr }; used for rbnew() rbin() rbout() rbin(r,item); struct rb * r; char * item; ring buffer, add an item rbnew(r,buf,siz,num); struct rb *r; char * buf; ring buffer, begin rbout(r,item); struct rb * r; char * item; ring buffer, take an item realloc(p,siz) char*; char *p; unsigned siz; might move block @ p recnum(f,n); FILE *f; long n; set next record for I/O recsiz(f,siz); FILE *f; int siz; set new record size regdmp(); register dump -> stderr replace(str,from,to)char*;char*str,from[],to[]; map s: from->to rewind(f); FILE * f; -1=bad 0=OK right(s,r); char*s; unsigned r; new string, r rightmost chars rindex(str,chr) char *; char *str, chr; point @ last chr in str, or NULL rstsys(emt) int; int emt; return error code of RSTS emt rtemt(emt,r0val) int; int emt,r0val; return error code of RT emt sallocsiz) char*; int siz; allocate siz chars, on stack sassoc(t,k)char*; char **t; *k; string associative memory savestr(s) char *; char * s; make a copy of a string sbrk(siz) char *; int siz; get siz chars from operating sys scanf(fmt,pointer(s)) int; char * fmt; scan a line from stdin scat(s,t) char*; char *s, *t; new catenation of strings; scdown(); screen. roll down. scerln(row,col); screen. erase to line end scerpg(row,col); screen. erase to page end scget(buf,siz,text) char *; screen. prompt then read sclmargin(lmarg) int; int lmarg; screen. set left margin scopy(s) char*; char *s; new copy of string scout(row,col,text); int row,col; char * text; screen. write text scput(oldbf); char * oldbf; screen. reset buffer mode scset(newbf,siz,oldp);char *newbf, siz, **oldp; screen. use a new buffer scsettype(typ) int; int typ; screen. force new terminal type sctype() int; screen. terminal type seg(s,n,m); char*s; unsigned n,m; new string, s[n:m] setcc(fn); int fn(); set control-c trap function setexit(); return 0. for unwind() setjmp(env); jmp_buf env; save context. 0=continued setttab(t,from,to); char t[],*from,*to; make map from->to sleep(seconds); int seconds; flush stdout,stderr. sleep. sprintf(buf,fmt,args...)char*; char*buf,fmt; formatted print to string sprintf(buf,fmt,args...)int;char*buf,fmt; ... formatted print to string sscanf(str,fmt,pointer(s))int;char*str,*fmt; scan a line from a string strcat(out,in) char *; char * out, *in; catenate strings strchr(str,chr) char *; char *str, chr; NULL, or -> 1st chr in str strcmp(a,b) int; char *a, *b; -1:ab strcpy(out,in) char *; char *out, *in; copy string streq(a,b) int; char *a, *b; TRUE if a==b strlen(str) int; char * str; length of string strnca(out,in,n)char*;char*out,*in;int n; append in to out, up to n chars strncmp(a,b) int; char *a, *b; strcmp(), scan at most n chars strncpy(out,in,n) char*; char *a,*b; int n; copy string, up to n chars strneq(a,b) int; char *a, *b; streq(), scan up to n chars strrchr(str,chr) char*; char *str, chr; NULL, or last chr in str swabb(buf); char * buffer; swap buf[0], buf[1] swabi(val); int val; return byte-swapped val table(siz) TABLE*; int siz; hash table, create talloc(siz) char*; unsigned size; malloc(), but threaded char * tmark; last talloc() value tdelete(t,key); TABLE*t; char*key; hash table, delete 1 entry tfree(p); char *p; mfree, but delete thread of mems time(tloc) long; long *tloc (may be NULL); seconds since 1Jan1970 timeb struct{ long time; time of day unsigned millitm; milliseconds short timezone; current timezone short dstflag; daylight saving }; after UNIX tinsert(t,key,val); TABLE*t; char *key;int val; hash table, insert an entry tlookup(t,key); TABLE*t; char*key; hash table, find an entry tm struct{ int tm_sec, seconds tm_min, minutes tm_hour, hours tm_mday, day of month tm_mon, month 0==january tm_year, year - 1970 [WHY!!!] tm_wday, weekday 0==sunday tm_yday, day of year 0==1jan tm_isdst; 1 == daylight saving time }; tnext(t,n,kp,vp); TABLE*t; int n,*vp; char**kp; hash table, crawl along it toascii(c) int; char c; remove parity bit tod(tloc) long; long * tloc (may be NULL); seconds since midnight tolower(c) int; char c; if uppercase, lowercase it toupper(c) int; char c; if lowercase, uppercase it translate(t,s); char t[], *s; modify s, translating chars trim(s); char*s; remove trailing iswhite()'s tupdate(t,key,val); TABLE*t; char *key;int val; hash table, change an entry ungetc(c,f); char c; FILE * f; push c back up stream unlink(filename); char * filename; delete the file, 0=fail unwind(); return to last setexit(), 1 vsaddc(pv,c) VSTRING*; VSTRING*pv; char c; add char to vstring vsadds(pv,s) VSTRING*; VSTRING*pv; char *s; add string to vstring vsfree(pv); VSTRING*pv; free (destroy) vstring vstring(dim,ext) VSTRING*; unsigned dim,ext; new vstring dim long wdleng() int; word length in bits wrapup(); you supply it for rundown zero(addr,nchars); char* addr; unsigned nchars; zeroise some memory