-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrfopen.h
More file actions
47 lines (32 loc) · 865 Bytes
/
strfopen.h
File metadata and controls
47 lines (32 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
struct STRFILE_tag
{
char* data;
size_t size;
size_t written;
FILE* handle;
bool is_memstream;
};
typedef struct STRFILE_tag STRFILE;
STRFILE* strfopen();
STRFILE* strfopen_mem(void* buf, size_t sz, const char* mode);
void strfinish(STRFILE* buf);
void strfree(STRFILE* buf);
size_t strfprintf(STRFILE* dest, const char* fmt, ...);
size_t strfwritel(STRFILE* dest, const void* data, size_t membsize, size_t size);
size_t strfwrite(STRFILE* dest, const char* data, size_t sz);
size_t strfputs(STRFILE* dest, const char* str);
size_t strfputc(STRFILE* dest, char c);
char strfgetc(STRFILE* dest);
#ifdef __cplusplus
} /* extern "C" */
#endif /* __cplusplus */