scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <errno.h>
 2#include <stdio.h>
 3#include <stdlib.h>
 4
 5#include "../libc.h"
 6
 7int
 8_allocbuf(FILE *fp)
 9{
10	unsigned char *bp;
11
12	if ((bp = malloc(BUFSIZ)) == NULL) {
13		fp->flags |= _IOERR;
14		errno = ENOMEM;
15		return EOF;
16	}
17	fp->len = BUFSIZ;
18	fp->rp = fp->wp = fp->buf = bp;
19	fp->lp = bp + BUFSIZ;
20
21	return 0;
22}