summaryrefslogtreecommitdiff
path: root/src/utils.h
diff options
context:
space:
mode:
authorAdam Spragg <adam@spra.gg>2022-05-17 12:47:32 +0100
committerAdam Spragg <adam@spra.gg>2022-05-18 17:19:47 +0100
commitb3c08670f56d7c5ee85dffa1a2faa5e03d2df5a1 (patch)
tree135f7cef180c195c060b5a3d9061d81292d57828 /src/utils.h
parent588b3e780fef14631f7ec5c369bff07efdc5e013 (diff)
Add ability to write Format 1 metadata files
Diffstat (limited to 'src/utils.h')
-rw-r--r--src/utils.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.h b/src/utils.h
index 35209d1..ef21b22 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -68,6 +68,15 @@ void write_binary_string(const char *string, size_t len, FILE *to);
/* Writes a normal C string to a file */
void write_string(const char *string, FILE *to);
+/* Writes a single character to a file, URL-encoding if necessary */
+void write_char_url(int c, FILE *to);
+
+/* Writes binary data to a file, URL-encoding any bytes if necessary */
+void write_binary_url(const char *string, size_t len, FILE *to);
+
+/* Writes a normal C string to a file, URL-encoding any chars if necessary */
+void write_string_url(const char *string, FILE *to);
+
/* Reads an int from a file, using len bytes, in little-endian order */
uint64_t read_int(const char **from, size_t len, const char *max);