diff options
Diffstat (limited to 'common/utils.h')
-rw-r--r-- | common/utils.h | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/common/utils.h b/common/utils.h deleted file mode 100644 index 2c3acec..0000000 --- a/common/utils.h +++ /dev/null | |||
@@ -1,64 +0,0 @@ | |||
1 | /* | ||
2 | * utils.h | ||
3 | * Miscellaneous utilities for string manipulation, | ||
4 | * file I/O and plist helper. | ||
5 | * | ||
6 | * Copyright (c) 2014-2019 Nikias Bassen, All Rights Reserved. | ||
7 | * Copyright (c) 2013-2014 Martin Szulecki, All Rights Reserved. | ||
8 | * Copyright (c) 2013 Federico Mena Quintero | ||
9 | * | ||
10 | * This library is free software; you can redistribute it and/or | ||
11 | * modify it under the terms of the GNU Lesser General Public | ||
12 | * License as published by the Free Software Foundation; either | ||
13 | * version 2.1 of the License, or (at your option) any later version. | ||
14 | * | ||
15 | * This library is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
18 | * Lesser General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU Lesser General Public | ||
21 | * License along with this library; if not, write to the Free Software | ||
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
23 | */ | ||
24 | |||
25 | #ifndef __UTILS_H | ||
26 | #define __UTILS_H | ||
27 | |||
28 | #ifdef HAVE_CONFIG_H | ||
29 | #include <config.h> | ||
30 | #endif | ||
31 | |||
32 | #ifdef WIN32 | ||
33 | #include <windows.h> | ||
34 | #endif | ||
35 | |||
36 | #include <stdio.h> | ||
37 | #include <plist/plist.h> | ||
38 | |||
39 | #define MAC_EPOCH 978307200 | ||
40 | |||
41 | #ifndef HAVE_STPCPY | ||
42 | char *stpcpy(char *s1, const char *s2); | ||
43 | #endif | ||
44 | char *string_concat(const char *str, ...); | ||
45 | char *string_append(char *str, ...); | ||
46 | char *string_build_path(const char *elem, ...); | ||
47 | char *string_format_size(uint64_t size); | ||
48 | char *string_toupper(char *str); | ||
49 | char *generate_uuid(void); | ||
50 | |||
51 | void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); | ||
52 | void buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); | ||
53 | |||
54 | enum plist_format_t { | ||
55 | PLIST_FORMAT_XML, | ||
56 | PLIST_FORMAT_BINARY | ||
57 | }; | ||
58 | |||
59 | int plist_read_from_filename(plist_t *plist, const char *filename); | ||
60 | int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format); | ||
61 | |||
62 | void plist_print_to_stream(plist_t plist, FILE* stream); | ||
63 | |||
64 | #endif | ||