From 1d9a4b73a37c6e942f909c2d42ca13b5c47e8362 Mon Sep 17 00:00:00 2001 From: Mystery Man Date: Tue, 5 Apr 2005 19:41:54 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'V10_2_20mdk'. --- mdk-stage1/dietlibc/libstdio/setvbuf.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 mdk-stage1/dietlibc/libstdio/setvbuf.c (limited to 'mdk-stage1/dietlibc/libstdio/setvbuf.c') diff --git a/mdk-stage1/dietlibc/libstdio/setvbuf.c b/mdk-stage1/dietlibc/libstdio/setvbuf.c deleted file mode 100644 index b8b50addf..000000000 --- a/mdk-stage1/dietlibc/libstdio/setvbuf.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include "dietstdio.h" -#include -#include -#include "dietwarning.h" - -static int set_flags (FILE *stream, int flags) { - switch (flags) { - case _IONBF: stream->flags = (stream->flags & ~(BUFLINEWISE)) | NOBUF; break; - case _IOLBF: stream->flags = (stream->flags & ~(NOBUF)) | BUFLINEWISE; break; - case _IOFBF: stream->flags = stream->flags & ~(NOBUF | BUFLINEWISE); break; - default: return -1; - } - return 0; -} - -int setvbuf(FILE *stream, char *buf, int flags, size_t size) { - if (buf) { - if (!(stream->flags&STATICBUF)) free(stream->buf); - stream->buf=buf; - } - else { - char *tmp; - if (!size) { - return set_flags(stream,flags); - } - if (!(tmp=malloc(size))) return -1; - if (!(stream->flags&STATICBUF)) free(stream->buf); - stream->buf=tmp; - } - stream->buflen=size; - stream->bm=stream->bs=0; - return set_flags(stream,flags); -} -- cgit v1.2.1