head 1.1; branch 1.1.1; access; symbols SFIO_1999:1.1.1.2 SFIO_1998:1.1.1.2 SFIO_1997:1.1.1.1 ATT:1.1.1; locks; strict; comment @ * @; 1.1 date 96.11.20.01.33.59; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 96.11.20.01.33.59; author rse; state Exp; branches; next 1.1.1.2; 1.1.1.2 date 97.07.16.12.58.50; author rse; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @#include "sfstdio.h" /* Change buffer and set/unset line buffering. ** Written by Kiem-Phong Vo */ #if __STD_C int setvbuf(reg FILE* fp, char* buf, int flags, size_t size) #else int setvbuf(fp, buf, flags, size) reg FILE* fp; char* buf; int flags; size_t size; #endif { reg Sfio_t* sp; if(!(sp = _sfstream(fp))) return -1; _stdclrerr(fp,sp); if(flags == _IOLBF) sfset(sp,SF_LINE,1); else if(flags == _IONBF) { sfsync(sp); sfsetbuf(sp,NIL(Void_t*),0); } else if(flags == _IOFBF) { if(size == 0) size = BUFSIZ; sfsync(sp); sfsetbuf(sp,buf,size); } return(0); } @ 1.1.1.1 log @Import of Sfio1997 @ text @@ 1.1.1.2 log @Import of Sfio1998 @ text @a28 1 sfset(sp,SF_LINE,0); a34 1 sfset(sp,SF_LINE,0); d36 1 a36 1 return 0; @