libpulsar
A modular compiler for the pulsar programming language
Loading...
Searching...
No Matches
src
util
io.h
Go to the documentation of this file.
1
8
#pragma once
9
10
#include "
def.h
"
11
15
struct
ps_file_ctx
{
16
STR
filename
;
17
char
*
buffer
;
18
usize
length
;
19
};
20
25
void
ps_file_ctx_init
(
struct
ps_file_ctx
* file_ctx,
STR
filename,
char
*
buffer
,
26
usize
length
);
27
35
char
*
ps_read_file_safe
(
STR
filename,
isize
* length_ext);
def.h
Base definitions.
STR
#define STR
Definition
def.h:40
isize
#define isize
Definition
def.h:49
usize
#define usize
Definition
def.h:50
ps_file_ctx_init
void ps_file_ctx_init(struct ps_file_ctx *file_ctx, STR filename, char *buffer, usize length)
Initializes file_ctx to describe the given file (filename, buffer, length).
Definition
io.c:7
ps_read_file_safe
char * ps_read_file_safe(STR filename, isize *length_ext)
Reads the contents the file at filename.
buffer
char buffer[ITOA_BUFFER_SIZE]
Definition
itoa.c:11
length
static void usize length
Definition
lexer.h:71
ps_file_ctx
Information captured in a file necessary for effective info/error reporting.
Definition
io.h:15
ps_file_ctx::length
usize length
Definition
io.h:18
ps_file_ctx::buffer
char * buffer
Definition
io.h:17
ps_file_ctx::filename
STR filename
Definition
io.h:16
Generated by
1.9.8