head 1.3; access; symbols SFIO_1999:1.1.1.2 SFIO_1998:1.1.1.1 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 99.06.04.18.57.38; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#include "sftest.h" static int Type; #if __STD_C static void notify(Sfio_t* f, int type, int fd) #else static void notify(f, type, fd) Sfio_t* f; int type; int fd; #endif { switch(Type = type) { case SF_NEW: case SF_CLOSE: case SF_SETFD: case SF_READ: case SF_WRITE: return; default: terror("Unexpected nofity-type: %d\n",type); } } int main() { Sfio_t* f; int fd; sfnotify(notify); if(!(f = sfopen(NIL(Sfio_t*), Kpv[0], "w")) && Type != SF_NEW) terror("Notify did not announce SF_NEW event\n"); fd = sffileno(f); close(fd+5); if(sfsetfd(f,fd+5) != fd+5 || Type != SF_SETFD) terror("Notify did not announce SF_SETFD event\n"); if(sfclose(f) < 0 || Type != SF_CLOSE) terror("Notify did not announce SF_CLOSE event\n"); if(sfputc(sfstdin,'a') >= 0 || Type != SF_WRITE) terror("Notify did not announce SF_WRITE event\n"); if(sfgetc(sfstdout) >= 0 || Type != SF_READ) terror("Notify did not announce SF_READ event\n"); rmkpv(); return 0; } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d34 1 a34 1 if(!(f = sfopen(NIL(Sfio_t*),"xxx","w")) && Type != SF_NEW) d49 1 @ 1.1 log @Initial revision @ text @d27 1 a27 1 main() @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1999 @ text @d34 1 a34 1 if(!(f = sfopen(NIL(Sfio_t*), Kpv[0], "w")) && Type != SF_NEW) a48 1 rmkpv(); @