-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpsftag.h
57 lines (46 loc) · 1.71 KB
/
psftag.h
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
48
49
50
51
52
53
54
55
56
57
/////////////////////////////////////////////////////////////////////////////
//
// tag handling
//
/////////////////////////////////////////////////////////////////////////////
#ifndef __PSF_PSFTAG_H__
#define __PSF_PSFTAG_H__
#ifdef __cplusplus
extern "C" {
#endif
void *psftag_create(void);
void psftag_delete(void *psftag);
int psftag_readfromfile(void *psftag, const char *path);
int psftag_writetofile(void *psftag, const char *path);
const char *psftag_getlasterror(void *psftag);
//
// Retrieve a tag variable.
// Guarantees null termination of output.
// Returns 0 if the variable was found
// Otherwise, returns -1 and sets the output to an empty terminated string
//
int psftag_getvar(void *psftag, const char *variable, char *value_out, int value_out_size);
//
// Set a tag variable.
//
void psftag_setvar(void *psftag, const char *variable, const char *value);
void psftag_getraw(void *psftag, char *raw_out, int raw_out_size);
void psftag_setraw(void *psftag, const char *raw_in);
//
// Retrieve a tag variable. The input tag data must be null-terminated.
// Guarantees null termination of output.
// Returns 0 if the variable was found
// Otherwise, returns -1 and sets the output to an empty terminated string
//
int psftag_raw_getvar(const char *tag, const char *variable, char *value_out, int value_out_size);
//
// Set a tag variable.
// Provide the maximum growable tag size _including_ space for the null terminator.
// Note that this function assumes it can overwrite *tag up to the length of the
// existing string, regardless of tag_max_size.
//
void psftag_raw_setvar(char *tag, int tag_max_size, const char *variable, const char *value);
#ifdef __cplusplus
}
#endif
#endif