mirror of
https://github.com/siemens-mobile-hacks/dc166-patch.git
synced 2026-11-25 19:37:24 +00:00
17 lines
393 B
C
17 lines
393 B
C
#include "dc166_stdio.h"
|
|
|
|
void setbuf(FILE *stream, char *buffer)
|
|
{
|
|
if ((stream->_flag & _IOMYBUF) != 0U)
|
|
free(stream->_base);
|
|
stream->_flag &= (unsigned short)~(_IOMYBUF | _IONBF | _IOLBF);
|
|
stream->_base = buffer;
|
|
stream->_ptr = buffer;
|
|
if (buffer == 0) {
|
|
stream->_flag |= _IONBF;
|
|
stream->_bufsiz = -1;
|
|
} else {
|
|
stream->_bufsiz = BUFSIZ;
|
|
}
|
|
stream->_cnt = 0;
|
|
}
|