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.12.13.20.53.54; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 96.12.13.20.53.54; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 97.06.02.18.05.06; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 99.06.04.18.58.23; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#include "sftest.h" int main() { Sfio_t* f; Sfio_t sf; if(sfopen(sfstdout,"abc","s") != sfstdout) terror("Bad reopening of sfstdout\n"); if(sfopen(sfstdin,"123","s") != sfstdin) terror("Bad reopening of sfstdin\n"); sfclose(sfstdin); if(!(f = sfopen(NIL(Sfio_t*),"123","s")) ) terror("Opening a stream\n"); sfclose(f); if(sfopen(f,"123","s") != NIL(Sfio_t*)) terror("can't reopen a closed stream!\n"); if(sfnew(&sf,NIL(char*),SF_UNBOUND,0,SF_EOF|SF_READ) != &sf) terror("Did not open sf\n"); sfset(&sf,SF_STATIC,1); if(sfclose(&sf) < 0 || !(sf.flags&SF_STATIC)) terror("Did not close sf\n"); /* test for exclusive opens */ unlink(Kpv[0]); if(!(f = sfopen(NIL(Sfio_t*),Kpv[0],"wx") ) ) terror("sfopen failed\n"); if((f = sfopen(f,Kpv[0],"wx") ) ) terror("sfopen should not succeed here\n"); rmkpv(); return 0; } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d27 2 a28 2 unlink("xxx"); if(!(f = sfopen(NIL(Sfio_t*),"xxx","wx") ) ) d30 1 a30 1 if((f = sfopen(f,"xxx","wx") ) ) a31 1 unlink("xxx"); d33 1 @ 1.1 log @Initial revision @ text @d3 1 a3 1 main() d27 1 a27 1 system("rm xxx"); d32 1 a32 1 system("rm xxx"); @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1998 @ text @d27 1 a27 1 unlink("xxx"); d32 1 a32 1 unlink("xxx"); @ 1.1.1.3 log @Import of Sfio1999 @ text @d27 2 a28 2 unlink(Kpv[0]); if(!(f = sfopen(NIL(Sfio_t*),Kpv[0],"wx") ) ) d30 1 a30 1 if((f = sfopen(f,Kpv[0],"wx") ) ) d32 1 a33 1 rmkpv(); @