MCPcopy Create free account
hub / github.com/GJDuck/e9patch / stdio_stream_buf_init

Function stdio_stream_buf_init

examples/stdlib.c:3054–3070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3052}
3053
3054static int stdio_stream_buf_init(FILE *stream)
3055{
3056 if (stream->flags & STDIO_FLAG_NO_BUF)
3057 {
3058 stream->buf = NULL;
3059 stream->bufsiz = 0;
3060 }
3061 else if (stream->buf == NULL)
3062 {
3063 stream->buf = (char *)malloc(stream->bufsiz);
3064 if (stream->buf == NULL)
3065 return EOF;
3066 stream->flags |= STDIO_FLAG_OWN_BUF;
3067 }
3068 stream->flags |= STDIO_FLAG_INITED;
3069 return 0;
3070}
3071
3072static ssize_t stdio_stream_read_buf(FILE *stream, char *start, char *end)
3073{

Callers 2

stdio_stream_read_initFunction · 0.85
stdio_stream_write_initFunction · 0.85

Calls 1

mallocFunction · 0.85

Tested by

no test coverage detected