head 1.3; access; symbols SFIO_1999:1.1.1.3 SFIO_1998:1.1.1.2 SFIO_1997:1.1.1.1 ATT:1.1.1; locks; strict; comment @ * @; 1.3 date 99.09.11.13.20.43; author rse; state Exp; branches; next 1.2; 1.2 date 99.09.11.12.42.12; author rse; state Exp; branches; next 1.1; 1.1 date 96.12.13.20.55.32; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 96.12.13.20.55.32; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 97.06.02.18.07.20; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 99.06.04.19.22.38; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#include "sftest.h" int main() { Sfio_t* f1; Sfio_t* f2; char* s; if(!(f1 = sfopen(NIL(Sfio_t*), Kpv[0],"w+")) ) terror("Can't open file\n"); if(sfwrite(f1,"0123456789\n",11) != 11) terror("Can't write to file\n"); sfclose(sfstdin); if(sfswap(f1,sfstdin) != sfstdin) terror("Can't swap with sfstdin\n"); sfseek(sfstdin,(Sfoff_t)0,0); if(!(s = sfgetr(sfstdin,'\n',1)) ) terror("sfgetr failed\n"); if(strcmp(s,"0123456789") != 0) terror("Get wrong data\n"); if(!(f1 = sfswap(sfstdin,NIL(Sfio_t*))) ) terror("Failed swapping to NULL\n"); if(!sfstack(sfstdout,f1) ) terror("Failed stacking f1\n"); if(!(f2 = sfopen(NIL(Sfio_t*), Kpv[0], "r")) ) terror("Can't open for read\n"); if(sfswap(f1,f2) != NIL(Sfio_t*) ) terror("sfswap should have failed\n"); rmkpv(); return 0; } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d9 2 a10 2 if(!(f1 = sfopen(NIL(Sfio_t*),"xxx","w+")) ) terror("Can't open xxx\n"); d12 1 a12 1 terror("Can't write to xxx\n"); d28 2 a29 2 if(!(f2 = sfopen(NIL(Sfio_t*),"xxx", "r")) ) terror("Can't open xxx for read\n"); d34 1 a34 1 unlink("xxx"); @ 1.1 log @Initial revision @ text @d3 1 a3 1 main() d34 1 a34 1 system("rm xxx >/dev/null 2>&1"); @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1998 @ text @d34 1 a34 1 unlink("xxx"); @ 1.1.1.3 log @Import of Sfio1999 @ text @d9 2 a10 2 if(!(f1 = sfopen(NIL(Sfio_t*), Kpv[0],"w+")) ) terror("Can't open file\n"); d12 1 a12 1 terror("Can't write to file\n"); d28 2 a29 2 if(!(f2 = sfopen(NIL(Sfio_t*), Kpv[0], "r")) ) terror("Can't open for read\n"); d34 1 a34 1 rmkpv(); @