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.11; author rse; state Exp; branches; next 1.1; 1.1 date 96.10.04.20.21.28; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 96.10.04.20.21.28; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 97.05.13.19.01.00; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 99.06.04.18.52.12; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#include "sftest.h" int main() { Sfio_t *f; if(!(f = sfopen((Sfio_t*)0,Kpv[0],"w"))) terror("Opening to write\n"); if(sfputc(f,'a') != 'a') terror("sfputc\n"); if(sfgetc(f) >= 0) terror("sfgetc\n"); if(!(f = sfopen(f,Kpv[0],"r"))) terror("Opening to read\n"); if(sfgetc(f) != 'a') terror("sfgetc2\n"); if(sfputc(f,'b') >= 0) terror("sfputc2\n"); if(!(f = sfopen(f,Kpv[0],"r+"))) terror("Opening to read/write\n"); if(sfgetc(f) != 'a') terror("sfgetc3\n"); if(sfputc(f,'b') != 'b') terror("sfputc3\n"); if(sfclose(f) < 0) terror("sfclose\n"); if(!(f = sfpopen(NIL(Sfio_t*),sfprints("cat %s",Kpv[0]),"r"))) terror("sfpopen\n"); if(sfgetc(f) != 'a') terror("sfgetc4\n"); if(sfgetc(f) != 'b') terror("sfgetc5\n"); if(sfgetc(f) >= 0) terror("sfgetc6\n"); if(!(f = sfopen(f,Kpv[0],"w")) ) terror("sfopen\n"); if(sfputc(f,'a') != 'a') terror("sfputc1\n"); sfsetfd(f,-1); if(sfputc(f,'b') >= 0) terror("sfputc2\n"); if(sfclose(f) < 0) terror("sfclose\n"); if(!(f = sfopen(NIL(Sfio_t*),Kpv[0],"a+")) ) terror("sfopen2\n"); sfset(f,SF_READ,0); if(!sfreserve(f,0,-1) ) terror("Failed on buffer getting\n"); if(sfvalue(f) <= 0) terror("There is no buffer?\n"); rmkpv(); return 0; } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d7 2 a8 2 if(!(f = sfopen((Sfio_t*)0,"xxx","w"))) terror("Opening xxx to write\n"); d14 2 a15 2 if(!(f = sfopen(f,"xxx","r"))) terror("Opening xxx to read\n"); d21 2 a22 2 if(!(f = sfopen(f,"xxx","r+"))) terror("Opening xxx to read/write\n"); d31 1 a31 1 if(!(f = sfpopen(NIL(Sfio_t*),"cat xxx","r"))) d40 1 a40 1 if(!(f = sfopen(f,"xxx","w")) ) d50 1 a50 1 if(!(f = sfopen(NIL(Sfio_t*),"xxx","a+")) ) d58 1 a58 2 remove("xxx"); @ 1.1 log @Initial revision @ text @d3 1 a3 1 main() d49 10 @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1998 @ text @a49 10 if(!(f = sfopen(NIL(Sfio_t*),"xxx","a+")) ) terror("sfopen2\n"); sfset(f,SF_READ,0); if(!sfreserve(f,0,-1) ) terror("Failed on buffer getting\n"); if(sfvalue(f) <= 0) terror("There is no buffer?\n"); remove("xxx"); @ 1.1.1.3 log @Import of Sfio1999 @ text @d7 2 a8 2 if(!(f = sfopen((Sfio_t*)0,Kpv[0],"w"))) terror("Opening to write\n"); d14 2 a15 2 if(!(f = sfopen(f,Kpv[0],"r"))) terror("Opening to read\n"); d21 2 a22 2 if(!(f = sfopen(f,Kpv[0],"r+"))) terror("Opening to read/write\n"); d31 1 a31 1 if(!(f = sfpopen(NIL(Sfio_t*),sfprints("cat %s",Kpv[0]),"r"))) d40 1 a40 1 if(!(f = sfopen(f,Kpv[0],"w")) ) d50 1 a50 1 if(!(f = sfopen(NIL(Sfio_t*),Kpv[0],"a+")) ) d58 2 a59 1 rmkpv(); @