diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-09-13 06:19:31 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-09-13 06:19:31 +0000 |
commit | d4fb1fcd6cdaaa7f8ffefbb7c6d44045b5081197 (patch) | |
tree | 6d7da2a1110a2d9ee32fa473b4bc3b5e468b562c /src/common/util.h | |
parent | 82b3b6249c796a4b3339d8a20a76593ab3c0479a (diff) | |
download | tor-d4fb1fcd6cdaaa7f8ffefbb7c6d44045b5081197.tar.gz tor-d4fb1fcd6cdaaa7f8ffefbb7c6d44045b5081197.zip |
Two new functions like write_bytes_to_file: one takes a list of byte-and-len structs; one appends.
svn:r5024
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index d2a0051ceb..791b023e25 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -121,6 +121,16 @@ int check_private_dir(const char *dirname, cpd_check_t check); int write_str_to_file(const char *fname, const char *str, int bin); int write_bytes_to_file(const char *fname, const char *str, size_t len, int bin); +typedef struct sized_chunk_t { + const char *bytes; + size_t len; +} sized_chunk_t; +struct smartlist_t; +int write_chunks_to_file(const char *fname, const struct smartlist_t *chunks, + int bin); +int append_bytes_to_file(const char *fname, const char *str, size_t len, + int bin); + char *read_file_to_str(const char *filename, int bin); char *parse_line_from_str(char *line, char **key_out, char **value_out); char *expand_filename(const char *filename); |