summaryrefslogtreecommitdiffstats
path: root/src/iphone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iphone.c')
-rw-r--r--src/iphone.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/iphone.c b/src/iphone.c
index aa9687c..657ffc6 100644
--- a/src/iphone.c
+++ b/src/iphone.c
@@ -26,13 +26,13 @@
26#include <stdlib.h> 26#include <stdlib.h>
27#include <string.h> 27#include <string.h>
28 28
29/* get_iPhone()
30 *
31 * Returns a structure with data on the first iPhone it finds.
32 * (Or NULL, on error)
33 */
34extern int debug; 29extern int debug;
35 30
31/**
32 *
33 * @return A structure with data on the first iPhone it finds. (Or NULL, on
34 * error)
35 */
36iPhone *get_iPhone() { 36iPhone *get_iPhone() {
37 iPhone *phone = (iPhone*)malloc(sizeof(iPhone)); 37 iPhone *phone = (iPhone*)malloc(sizeof(iPhone));
38 usbmux_version_header *version = version_header(); 38 usbmux_version_header *version = version_header();
@@ -113,14 +113,12 @@ iPhone *get_iPhone() {
113 return NULL; // if it got to this point it's gotta be bad 113 return NULL; // if it got to this point it's gotta be bad
114} 114}
115 115
116/* free_iPhone(victim) 116/** Cleans up an iPhone structure, then frees the structure itself.
117 * This is a library-level function; deals directly with the iPhone to tear down relations, 117 * This is a library-level function; deals directly with the iPhone to tear
118 * but otherwise is mostly internal. 118 * down relations, but otherwise is mostly internal.
119 * 119 *
120 * victim: a pointer to an iPhone structure 120 * @param victim A pointer to an iPhone structure.
121 * Cleans up an iPhone structure, then frees the structure itself.
122 */ 121 */
123
124void free_iPhone(iPhone *victim) { 122void free_iPhone(iPhone *victim) {
125 if (victim->buffer) free(victim->buffer); 123 if (victim->buffer) free(victim->buffer);
126 if (victim->device) { 124 if (victim->device) {
@@ -131,14 +129,13 @@ void free_iPhone(iPhone *victim) {
131 free(victim); 129 free(victim);
132} 130}
133 131
134/* send_to_phone(phone, data, datalen) 132/** Sends data to the phone
135 * This is a low-level (i.e. directly to phone) function. 133 * This is a low-level (i.e. directly to phone) function.
136 * 134 *
137 * phone: the iPhone to send data to 135 * @param phone The iPhone to send data to
138 * data: the data to send to the iPhone 136 * @param data The data to send to the iPhone
139 * datalen: the length of the data 137 * @param datalen The length of the data
140 * 138 * @return The number of bytes sent, or -1 on error or something.
141 * Returns the number of bytes sent, or -1 on error or something.
142 */ 139 */
143int send_to_phone(iPhone *phone, char *data, int datalen) { 140int send_to_phone(iPhone *phone, char *data, int datalen) {
144 if (!phone) return -1; 141 if (!phone) return -1;
@@ -159,14 +156,14 @@ int send_to_phone(iPhone *phone, char *data, int datalen) {
159 return -1; 156 return -1;
160} 157}
161 158
162/* recv_from_phone(phone, data, datalen): 159/**
163 * This function is a low-level (i.e. direct to iPhone) function. 160 * This function is a low-level (i.e. direct to iPhone) function.
164 * 161 *
165 * phone: the iPhone to receive data from 162 * @param phone The iPhone to receive data from
166 * data: where to put data read 163 * @param data Where to put data read
167 * datalen: how much data to read in 164 * @param datalen How much data to read in
168 * 165 *
169 * Returns: how many bytes were read in, or -1 on error. 166 * @returns How many bytes were read in, or -1 on error.
170 */ 167 */
171int recv_from_phone(iPhone *phone, char *data, int datalen) { 168int recv_from_phone(iPhone *phone, char *data, int datalen) {
172 if (!phone) return -1; 169 if (!phone) return -1;