|
|
1.1 ! root 1: /* @(#)stest.c 1.2 */ ! 2: #include "fio.h" ! 3: #define out(a,b) {n=b;if(n==0) fprintf(stderr,"%s:%d\n",a,errno);else \ ! 4: fprintf(stderr,"%s:%d %d\n",a,errno,n);} ! 5: extern errno; ! 6: olist xopen; ! 7: cllist xclose; ! 8: alist xaux; ! 9: cilist xio; ! 10: long one = 1; ! 11: char xx[] = "1234"; ! 12: char yy[] = "terrible junk"; ! 13: main() ! 14: { ! 15: int n; ! 16: setolist(&xopen,9,"junk","o","u",0,NULL,0); ! 17: out("open",f_open(&xopen)); ! 18: setalist(&xaux,9,0); ! 19: out("rew",f_rew(&xaux)); ! 20: setcilist(&xio,9,NULL,0,0,0); ! 21: out("start",s_wsue(&xio)); ! 22: out("io",do_uio(&one,xx,(long)sizeof(xx)-1)); ! 23: out("endw",e_wsue()); ! 24: out("enf",f_end(&xaux)); ! 25: out("bck",f_back(&xaux)); ! 26: out("bck",f_back(&xaux)); ! 27: out("startr",s_rsue(&xio)); ! 28: out("rio",do_uio(&one,yy,(long)sizeof(xx)-1)); ! 29: out("endr",e_rsue()); ! 30: fprintf(stdout,"yy: %s\n",yy); ! 31: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.