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