diff options
| author | 2013-08-18 05:16:06 +0200 | |
|---|---|---|
| committer | 2013-09-17 11:43:33 +0200 | |
| commit | df539bdbc7708fb05eea22eec62d6e2f609c10b5 (patch) | |
| tree | 6ce9e7e4a5960c051af67821f5e3a66fe2adc5bb /common/utils.h | |
| parent | c7c49ae95ca05750fa5609d39c28b148f93dbe15 (diff) | |
| download | libimobiledevice-df539bdbc7708fb05eea22eec62d6e2f609c10b5.tar.gz libimobiledevice-df539bdbc7708fb05eea22eec62d6e2f609c10b5.tar.bz2 | |
common: Add helpers to read and write plist files
Diffstat (limited to 'common/utils.h')
| -rw-r--r-- | common/utils.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/utils.h b/common/utils.h index 441d188..8394272 100644 --- a/common/utils.h +++ b/common/utils.h | |||
| @@ -22,9 +22,27 @@ | |||
| 22 | #ifndef __UTILS_H | 22 | #ifndef __UTILS_H |
| 23 | #define __UTILS_H | 23 | #define __UTILS_H |
| 24 | 24 | ||
| 25 | #ifdef WIN32 | ||
| 26 | #include <windows.h> | ||
| 27 | #endif | ||
| 28 | |||
| 29 | #include <stdio.h> | ||
| 30 | #include <plist/plist.h> | ||
| 31 | |||
| 25 | #ifndef HAVE_STPCPY | 32 | #ifndef HAVE_STPCPY |
| 26 | char *stpcpy(char * s1, const char * s2); | 33 | char *stpcpy(char * s1, const char * s2); |
| 27 | #endif | 34 | #endif |
| 28 | char *string_concat(const char *str, ...); | 35 | char *string_concat(const char *str, ...); |
| 29 | 36 | ||
| 37 | void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); | ||
| 38 | void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); | ||
| 39 | |||
| 40 | enum plist_format_t { | ||
| 41 | PLIST_FORMAT_XML, | ||
| 42 | PLIST_FORMAT_BINARY | ||
| 43 | }; | ||
| 44 | |||
| 45 | int plist_read_from_filename(plist_t *plist, const char *filename); | ||
| 46 | int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format); | ||
| 47 | |||
| 30 | #endif | 48 | #endif |
