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.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.06.02.18.07.03; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 99.06.04.19.19.10; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#include "sftest.h" int main() { Sfio_t *f; int fd; if(!(f = sfopen((Sfio_t*)0,Kpv[0],"w+"))) terror("Opening file\n"); fd = sffileno(f); if(sfsetfd(f,-1) != -1 || sffileno(f) != -1) terror("setfd1\n"); if(sfputc(f,'a') >= 0) terror("sfputc\n"); if(sfsetfd(f,fd) != fd) terror("setfd2\n"); if(sfwrite(f,"123456789\n",10) != 10) terror("sfwrite\n"); sfseek(f,(Sfoff_t)0,0); if(sfgetc(f) != '1') terror("sfgetc1\n"); if(sfsetfd(f,-1) != -1 || sffileno(f) != -1) terror("setfd2\n"); if(lseek(fd,0L,1) != 1L) terror("Bad seek address %d\n",lseek(fd,0L,1)); if(sfgetc(f) >= 0) terror("sfgetc2\n"); if(sfsetfd(f,fd) != fd) terror("setfd2\n"); if(sfgetc(f) != '2') terror("sfgetc3\n"); rmkpv(); return 0; } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d8 1 a8 1 if(!(f = sfopen((Sfio_t*)0,"xxx","w+"))) d39 1 a39 1 unlink("xxx"); @ 1.1 log @Initial revision @ text @d3 1 a3 1 main() d39 1 a39 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 @d39 1 a39 1 unlink("xxx"); @ 1.1.1.3 log @Import of Sfio1999 @ text @d8 1 a8 1 if(!(f = sfopen((Sfio_t*)0,Kpv[0],"w+"))) d39 1 a39 1 rmkpv(); @