Debian Codegraph @

debian/patches/0003-Port-to-libplist-2.3.0.patch

raw symbols SCIP
1 Fromscip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#From.: Boyuan Yang <[email protected]scip-debian . . . identity/`[email protected]`.>
2 Datescip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#Date.: Thu, 3 Aug 2023 16:07:40 -0400
3 Subjectscip-debian debian usbmuxd 1.1.1-7 usbmuxd/patches/`0003-Port-to-libplist-2.3.0.patch`#Subject.: Port to libplist 2.3.0
4
5 ---
6 configure.ac | 2 +-
7 src/conf.c | 9 +++++----
8 src/utils.c | 45 ---------------------------------------------
9 src/utils.h | 8 --------
10 4 files changed, 6 insertions(+), 58 deletions(-)
11
12 diff --git a/configure.acscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`configure.ac`: b/configure.acscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`configure.ac`:
13 index af0d2cd..3f8493c 100644
14 --- a/configure.ac
15 +++ b/configure.ac
16 @@ -17,7 +17,7 @@ AC_PROG_LIBTOOL
17
18 # Checks for libraries.
19 PKG_CHECK_MODULES(libusb, libusb-1.0 >= 1.0.9)
20 -PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.2.0)
21 +PKG_CHECK_MODULES(libplist, libplist-2.0 >= 2.3.0)
22 PKG_CHECK_MODULES(libimobiledevice, libimobiledevice-1.0 >= 1.3.0, have_limd=yes, have_limd=no)
23 AC_CHECK_LIB(pthread, [pthread_create, pthread_mutex_lock], [AC_SUBST(libpthread_LIBS,[-lpthread])], [AC_MSG_ERROR([libpthread is required to build usbmuxd])])
24
25 diff --git a/src/conf.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/conf.c`: b/src/conf.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/conf.c`:
26 index 609d246..5e682b4 100644
27 --- a/src/conf.c
28 +++ b/src/conf.c
29 @@ -39,6 +39,7 @@
30 #include <shlobj.h>
31 #endif
32
33 +#include <plist/plist.h>
34 #include "conf.h"
35 #include "utils.h"
36 #include "log.h"
37 @@ -230,7 +231,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t
38 /* read file into plist */
39 plist_t config = NULL;
40
41 - plist_read_from_filename(&config, config_file);
42 + plist_read_from_file(config_file, &config, NULL);
43 if (!config) {
44 config = plist_new_dict();
45 plist_dict_set_item(config, key, value);
46 @@ -254,7 +255,7 @@ static int internal_set_value(const char *config_file, const char *key, plist_t
47 usbmuxd_log(LL_DEBUG, "Setting key %s in config file %s", key, config_file);
48 }
49
50 - int res = plist_write_to_filename(config, config_file, PLIST_FORMAT_XML);
51 + int res = plist_write_to_file(config, config_file, PLIST_FORMAT_XML, 0);
52
53 plist_free(config);
54
55 @@ -288,7 +289,7 @@ static int internal_get_value(const char* config_file, const char *key, plist_t
56
57 /* now parse file to get the SystemBUID */
58 plist_t config = NULL;
59 - if (plist_read_from_filename(&config, config_file)) {
60 + if (plist_read_from_file(config_file, &config, NULL)) {
61 usbmuxd_log(LL_DEBUG, "Reading key %s from config file %s", key, config_file);
62 plist_t n = plist_dict_get_item(config, key);
63 if (n) {
64 @@ -428,7 +429,7 @@ int config_set_device_record(const char *udid, char* record_data, uint64_t recor
65 remove(device_record_file);
66
67 /* store file */
68 - if (!plist_write_to_filename(plist, device_record_file, PLIST_FORMAT_XML)) {
69 + if (!plist_write_to_file(plist, device_record_file, PLIST_FORMAT_XML, 0)) {
70 usbmuxd_log(LL_DEBUG, "Could not open '%s' for writing: %s", device_record_file, strerror(errno));
71 res = -ENOENT;
72 }
73 diff --git a/src/utils.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.c`: b/src/utils.cscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.c`:
74 index 206c684..35d3f73 100644
75 --- a/src/utils.c
76 +++ b/src/utils.c
77 @@ -279,51 +279,6 @@ int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t
78 }
79 }
80
81 -int plist_read_from_filename(plist_t *plist, const char *filename)
82 -{
83 - char *buffer = NULL;
84 - uint64_t length;
85 -
86 - if (!filename)
87 - return 0;
88 -
89 - if (!buffer_read_from_filename(filename, &buffer, &length)) {
90 - return 0;
91 - }
92 -
93 - if ((length > 8) && (memcmp(buffer, "bplist00", 8) == 0)) {
94 - plist_from_bin(buffer, length, plist);
95 - } else {
96 - plist_from_xml(buffer, length, plist);
97 - }
98 -
99 - free(buffer);
100 -
101 - return 1;
102 -}
103 -
104 -int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format)
105 -{
106 - char *buffer = NULL;
107 - uint32_t length;
108 -
109 - if (!plist || !filename)
110 - return 0;
111 -
112 - if (format == PLIST_FORMAT_XML)
113 - plist_to_xml(plist, &buffer, &length);
114 - else if (format == PLIST_FORMAT_BINARY)
115 - plist_to_bin(plist, &buffer, &length);
116 - else
117 - return 0;
118 -
119 - int res = buffer_write_to_filename(filename, buffer, length);
120 -
121 - free(buffer);
122 -
123 - return res;
124 -}
125 -
126 #ifndef HAVE_CLOCK_GETTIME
127 typedef int clockid_t;
128 #define CLOCK_MONOTONIC 1
129 diff --git a/src/utils.hscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.h`: b/src/utils.hscip-debian debian usbmuxd 1.1.1-7 usbmuxd/upstream/`src/utils.h`:
130 index b5cab3f..4fbd3af 100644
131 --- a/src/utils.h
132 +++ b/src/utils.h
133 @@ -78,14 +78,6 @@ char *string_concat(const char *str, ...);
134 int buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length);
135 int buffer_write_to_filename(const char *filename, const char *buffer, uint64_t length);
136
137 -enum plist_format_t {
138 - PLIST_FORMAT_XML,
139 - PLIST_FORMAT_BINARY
140 -};
141 -
142 -int plist_read_from_filename(plist_t *plist, const char *filename);
143 -int plist_write_to_filename(plist_t plist, const char *filename, enum plist_format_t format);
144 -
145 uint64_t mstime64(void);
146 void get_tick_count(struct timeval * tv);
147