8
* allocate and zero memory.
10
* Returns: The newly allocated memory
11
* or NULL if the system is unable to.
13
__attribute__((malloc))
14
ptr_t malloc0 (size_t sz);
17
* Removes trailing whitespaces in string s.
19
* Note: this may invalitate the original string s, and on error be NULL.
21
str_t string_vacuum (str_t s);
24
* concatonates the null terminated list into a string with new lines
27
str_t string_concat_list_nl (str_t* list);
32
* fprintf (stderr, pmt ....)
36
void err_print (str_t fmt, ...);
39
* ***************************************************************************
42
typedef struct ByteStream ByteStream;
45
byte_stream_new (size_t length);
48
byte_stream_new_from_file (FILE * f);
51
byte_stream_seek (ByteStream * bstream, long int offset, SEEK_OFFSET origin);
54
byte_stream_read (ByteStream * bstream, OUT ptr_t ptr, size_t size, size_t count);
57
byte_stream_write (ByteStream * bstream, IN ptr_t ptr, size_t size, size_t count);
60
byte_stream_length (ByteStream * ByteStream);