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.42; author rse; state Exp; branches; next 1.2; 1.2 date 99.09.11.12.42.10; author rse; state Exp; branches; next 1.1; 1.1 date 96.12.14.04.15.55; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 96.12.14.04.15.55; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 98.03.05.16.25.46; author rse; state Exp; branches; next 1.1.1.3; 1.1.1.3 date 99.08.04.19.10.20; author rse; state Exp; branches; next ; desc @@ 1.3 log @Merge in Sfio 1999 changes @ text @#if _SFIO_H_ONLY #include _BEGIN_EXTERNS_ extern int unlink _ARG_((const char*)); extern int write _ARG_((int, const void*, int)); extern int exit _ARG_((int)); extern size_t strlen _ARG_((const char*)); extern Void_t* malloc _ARG_((size_t)); _END_EXTERNS_ #else #include "sfhdr.h" #endif #ifndef NIL #define NIL(t) ((t)0) #endif _BEGIN_EXTERNS_ extern int strncmp _ARG_((const char*, const char*, size_t)); extern int strcmp _ARG_((const char*, const char*)); extern int system _ARG_((const char*)); #if 0 extern int alarm _ARG_((int)); #endif _END_EXTERNS_ /* temp files that may be used */ static char* Kpv[4] = { "/tmp/kpvaaa", "/tmp/kpvbbb", "/tmp/kpvccc", NIL(char*) }; static void rmkpv() { int i; for(i = 0; Kpv[i]; ++i) unlink(Kpv[i]); } #ifdef __LINE__ static int Line; #define terror Line=__LINE__,t_error #else #define terror t_error #endif #if __STD_C static void t_error(char* form, ...) #else static void t_error(va_alist) va_dcl #endif { Sfio_t* f; char* s; va_list args; #if __STD_C va_start(args,form); #else char* form; va_start(args); form = va_arg(args,char*); #endif f = sfopen(NIL(Sfio_t*),NIL(char*),"sw"); #ifdef __LINE__ sfprintf(f,"Line=%d: ",Line); #endif sfvprintf(f,form,args); sfputc(f,'\n'); sfputc(f,'\0'); sfseek(f,(Sfoff_t)0,0); s = sfreserve(f,SF_UNBOUND,1); va_end(args); write(2,s,strlen(s)); rmkpv(); exit(-1); } @ 1.2 log @Incorporate stuff from RSE's Sfio98 variant @ text @d3 9 a11 1 #define NIL(t) ((t)0) d16 4 a20 2 #if !__STDC__ && !_hdr_stdlib extern void exit _ARG_((int)); d23 4 a27 1 extern int system _ARG_((const char*)); d30 8 d68 1 d76 2 @ 1.1 log @Initial revision @ text @d1 4 d6 1 d9 1 d13 1 d17 7 d25 1 a25 1 void terror(char* form, ...) d27 1 a27 1 void terror(va_alist) d43 3 @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1998 @ text @a0 4 #if _SFIO_H_ONLY #include #define NIL(t) ((t)0) #else a1 1 #endif a3 1 #if !__STDC__ && !_hdr_stdlib a6 1 #endif a9 7 #ifdef __LINE__ static int Line; #define terror Line=__LINE__,t_error #else #define terror t_error #endif d11 1 a11 1 void t_error(char* form, ...) d13 1 a13 1 void t_error(va_alist) a28 3 #ifdef __LINE__ sfprintf(f,"Line=%d: ",Line); #endif @ 1.1.1.3 log @Import of Sfio1999 @ text @d3 1 a3 9 _BEGIN_EXTERNS_ extern int unlink _ARG_((const char*)); extern int write _ARG_((int, const void*, int)); extern int exit _ARG_((int)); extern size_t strlen _ARG_((const char*)); extern Void_t* malloc _ARG_((size_t)); _END_EXTERNS_ a7 4 #ifndef NIL #define NIL(t) ((t)0) #endif d9 2 d13 1 a13 1 a14 1 extern int alarm _ARG_((int)); a16 8 /* temp files that may be used */ static char* Kpv[4] = { "/tmp/kpvaaa", "/tmp/kpvbbb", "/tmp/kpvccc", NIL(char*) }; static void rmkpv() { int i; for(i = 0; Kpv[i]; ++i) unlink(Kpv[i]); } a46 1 sfputc(f,'\n'); a53 2 rmkpv(); @