diff options
author | 2021-09-01 15:54:53 +0200 | |
---|---|---|
committer | 2021-09-01 15:54:53 +0200 | |
commit | 32a8ebedc695dfae21497977bf2f77a3d5b50f91 (patch) | |
tree | 0cfd7f83c4d49ee4a20ecdc249167f6dc084396d /src/utils.h | |
parent | c3a16f3e4968f38aa8813ad0c0731bdb5aa745fb (diff) | |
download | usbmuxd-32a8ebedc695dfae21497977bf2f77a3d5b50f91.tar.gz usbmuxd-32a8ebedc695dfae21497977bf2f77a3d5b50f91.tar.bz2 |
Remove common code in favor of new libimobiledevice-glue
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/utils.h b/src/utils.h index b5cab3f..ce3b2e0 100644 --- a/src/utils.h +++ b/src/utils.h | |||
@@ -43,49 +43,6 @@ void fdlist_add(struct fdlist *list, enum fdowner owner, int fd, short events); | |||
43 | void fdlist_free(struct fdlist *list); | 43 | void fdlist_free(struct fdlist *list); |
44 | void fdlist_reset(struct fdlist *list); | 44 | void fdlist_reset(struct fdlist *list); |
45 | 45 | ||
46 | struct collection { | ||
47 | void **list; | ||
48 | int capacity; | ||
49 | }; | ||
50 | |||
51 | void collection_init(struct collection *col); | ||
52 | void collection_add(struct collection *col, void *element); | ||
53 | void collection_remove(struct collection *col, void *element); | ||
54 | int collection_count(struct collection *col); | ||
55 | void collection_free(struct collection *col); | ||
56 | void collection_copy(struct collection *dest, struct collection *src); | ||
57 | |||
58 | #define MERGE_(a,b) a ## _ ## b | ||
59 | #define LABEL_(a,b) MERGE_(a, b) | ||
60 | #define UNIQUE_VAR(a) LABEL_(a, __LINE__) | ||
61 | |||
62 | #define FOREACH(var, col) \ | ||
63 | do { \ | ||
64 | int UNIQUE_VAR(_iter); \ | ||
65 | for(UNIQUE_VAR(_iter)=0; UNIQUE_VAR(_iter)<(col)->capacity; UNIQUE_VAR(_iter)++) { \ | ||
66 | if(!(col)->list[UNIQUE_VAR(_iter)]) continue; \ | ||
67 | var = (col)->list[UNIQUE_VAR(_iter)]; | ||
68 | |||
69 | #define ENDFOREACH \ | ||
70 | } \ | ||
71 | } while(0); | ||
72 | |||
73 | #ifndef HAVE_STPCPY | ||
74 | char *stpcpy(char * s1, const char * s2); | ||
75 | #endif | ||
76 | char *string_concat(const char *str, ...); | ||
77 | |||
78 | int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); | ||
79 | int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length); | ||
80 | |||
81 | enum plist_format_t { | ||
82 | PLIST_FORMAT_XML, | ||
83 | PLIST_FORMAT_BINARY | ||
84 | }; | ||
85 | |||
86 | int plist_read_from_filename(plist_t *plist, const char *filename); | ||
87 | int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format); | ||
88 | |||
89 | uint64_t mstime64(void); | 46 | uint64_t mstime64(void); |
90 | void get_tick_count(struct timeval * tv); | 47 | void get_tick_count(struct timeval * tv); |
91 | 48 | ||