From b3c08670f56d7c5ee85dffa1a2faa5e03d2df5a1 Mon Sep 17 00:00:00 2001 From: Adam Spragg Date: Tue, 17 May 2022 12:47:32 +0100 Subject: Add ability to write Format 1 metadata files --- src/utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/utils.h') 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); -- cgit v1.2.1