summaryrefslogtreecommitdiff
path: root/src/init/stdlib.h
blob: 3dc1c81b83a69dcb0cbc565b1e507b2a86643f1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#pragma once
#include <init/malloc.h>
#include <shared/mem.h>
#include <stdbool.h>
#include <stddef.h>

int printf(const char *fmt, ...);

typedef struct {
	int fd;
	int pos;
	bool eof;
} libc_file;
int file_open(libc_file*, const char *path, int flags); // TODO return a libc_file*
int file_read(libc_file*, char *buf, size_t len);
int file_write(libc_file*, const char *buf, size_t len);
void file_close(libc_file*);

extern libc_file __stdin, __stdout;