FrostWing
A lightweight raw-control operating system.
Loading...
Searching...
No Matches
stream.h
Go to the documentation of this file.
1
11
#ifndef STREAM_H
12
#define STREAM_H
13
14
#include <stddef.h>
15
#include <stdbool.h>
16
#include <stdint.h>
17
18
typedef
struct
vfs_file vfs_file_t;
19
20
typedef
enum
{
21
STDIN = 0,
22
STDOUT = 1,
23
STDERR = 2
24
} stream_t;
25
26
#define STREAM_MAX_FDS 256
27
28
void
stream_init(
void
);
29
38
// int stream_set_file(stream_t s, vfs_file_t* file);
39
// vfs_file_t* stream_get_file(stream_t s);
40
41
42
void
stream_write
(stream_t s,
const
char
* buf,
size_t
len);
43
44
45
void
stream_putc(stream_t s,
char
c);
46
47
void
fd_table_init(
void
);
48
bool
fd_valid(
int
fd);
49
vfs_file_t* fd_get_file(
int
fd);
50
int
fd_open(
const
char
* path,
int
flags);
51
int
fd_close(
int
fd);
52
int
fd_dup(
int
oldfd);
53
int
fd_dup2(
int
oldfd,
int
newfd);
54
int
fd_flags(
int
fd);
55
const
char
* fd_get_path(
int
fd);
56
uint32_t fd_file_size(
int
fd);
57
uint32_t* fd_pos_ptr(
int
fd);
58
59
#endif
stream_write
void stream_write(stream_t s, const char *buf, size_t len)
Redirect output to a file.
source
includes
stream.h
Generated by
1.16.1