summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2010-03-05 16:25:57 +0100
committerGravatar Matt Colyer2010-03-08 21:08:06 -0800
commitcb45bbfdcb67ad3d83a29574ae1f0706cd79a9e3 (patch)
tree8bf19b0e4dbc9598c27db72dacac05cc35af468d /src
parent418b4f78ce91f0eeb0fe3d769ae4fc60ea503145 (diff)
downloadlibimobiledevice-cb45bbfdcb67ad3d83a29574ae1f0706cd79a9e3.tar.gz
libimobiledevice-cb45bbfdcb67ad3d83a29574ae1f0706cd79a9e3.tar.bz2
mobile_image_mounter: docs updated
Diffstat (limited to 'src')
-rw-r--r--src/mobile_image_mounter.c33
-rw-r--r--src/mobile_image_mounter.h2
2 files changed, 20 insertions, 15 deletions
diff --git a/src/mobile_image_mounter.c b/src/mobile_image_mounter.c
index 7fe0a6d..88b6c47 100644
--- a/src/mobile_image_mounter.c
+++ b/src/mobile_image_mounter.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * mobile_image_mounter.c 2 * mobile_image_mounter.c
3 * MobileImageMounter implementation. 3 * com.apple.mobile.mobile_image_mounter service implementation.
4 * 4 *
5 * Copyright (c) 2010 Nikias Bassen, All Rights Reserved. 5 * Copyright (c) 2010 Nikias Bassen, All Rights Reserved.
6 * 6 *
@@ -30,18 +30,20 @@
30#include "property_list_service.h" 30#include "property_list_service.h"
31#include "debug.h" 31#include "debug.h"
32 32
33/** Locks an MobileImageMounter client, done for thread safety stuff. 33/**
34 * Locks a mobile_image_mounter client, used for thread safety.
34 * 35 *
35 * @param client The MIM to lock 36 * @param client mobile_image_mounter client to lock
36 */ 37 */
37static void mobile_image_mounter_lock(mobile_image_mounter_client_t client) 38static void mobile_image_mounter_lock(mobile_image_mounter_client_t client)
38{ 39{
39 g_mutex_lock(client->mutex); 40 g_mutex_lock(client->mutex);
40} 41}
41 42
42/** Unlocks an MIM client, done for thread safety stuff. 43/**
44 * Unlocks a mobile_image_mounter client, used for thread safety.
43 * 45 *
44 * @param client The MIM to unlock 46 * @param client mobile_image_mounter client to unlock
45 */ 47 */
46static void mobile_image_mounter_unlock(mobile_image_mounter_client_t client) 48static void mobile_image_mounter_unlock(mobile_image_mounter_client_t client)
47{ 49{
@@ -76,7 +78,7 @@ static mobile_image_mounter_error_t mobile_image_mounter_error(property_list_ser
76} 78}
77 79
78/** 80/**
79 * Makes a connection to the MobileImageMounter service on the phone. 81 * Connects to the mobile_image_mounter service on the specified device.
80 * 82 *
81 * @param device The device to connect to. 83 * @param device The device to connect to.
82 * @param port Destination port (usually given by lockdownd_start_service). 84 * @param port Destination port (usually given by lockdownd_start_service).
@@ -84,8 +86,8 @@ static mobile_image_mounter_error_t mobile_image_mounter_error(property_list_ser
84 * mobile_image_mounter_client_t upon successful return. 86 * mobile_image_mounter_client_t upon successful return.
85 * 87 *
86 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, 88 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
87 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG when device is NULL, 89 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if device is NULL,
88 * or MOBILE_IMAGE_MOUNTER_E_CONN_FAILED when the connection to the 90 * or MOBILE_IMAGE_MOUNTER_E_CONN_FAILED if the connection to the
89 * device could not be established. 91 * device could not be established.
90 */ 92 */
91mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, uint16_t port, mobile_image_mounter_client_t *client) 93mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, uint16_t port, mobile_image_mounter_client_t *client)
@@ -112,12 +114,13 @@ mobile_image_mounter_error_t mobile_image_mounter_new(idevice_t device, uint16_t
112} 114}
113 115
114/** 116/**
115 * Disconnects an MobileImageMounter client from the device. 117 * Disconnects a mobile_image_mounter client from the device and frees up the
118 * mobile_image_mounter client data.
116 * 119 *
117 * @param client The client to disconnect. 120 * @param client The mobile_image_mounter client to disconnect and free.
118 * 121 *
119 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, 122 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
120 * or MOBILE_IMAGE_MOUNTER_E_INVALID_ARG when client is NULL. 123 * or MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if client is NULL.
121 */ 124 */
122mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client) 125mobile_image_mounter_error_t mobile_image_mounter_free(mobile_image_mounter_client_t client)
123{ 126{
@@ -179,7 +182,7 @@ leave_unlock:
179/** 182/**
180 * Mounts an image on the device. 183 * Mounts an image on the device.
181 * 184 *
182 * @param client The connected MobileImageMounter client. 185 * @param client The connected mobile_image_mounter client.
183 * @param image_path The absolute path of the image to mount. The image must 186 * @param image_path The absolute path of the image to mount. The image must
184 * be present before calling this function. 187 * be present before calling this function.
185 * @param image_signature Pointer to a buffer holding the images' signature 188 * @param image_signature Pointer to a buffer holding the images' signature
@@ -190,9 +193,11 @@ leave_unlock:
190 * 193 *
191 * @note This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the 194 * @note This function may return MOBILE_IMAGE_MOUNTER_E_SUCCESS even if the
192 * operation has failed. Check the resulting plist for further information. 195 * operation has failed. Check the resulting plist for further information.
196 * Note that there is no unmounting function. The mount persists until the
197 * device is rebooted.
193 * 198 *
194 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success, 199 * @return MOBILE_IMAGE_MOUNTER_E_SUCCESS on success,
195 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG when on ore more parameters are 200 * MOBILE_IMAGE_MOUNTER_E_INVALID_ARG if on ore more parameters are
196 * invalid, or another error code otherwise. 201 * invalid, or another error code otherwise.
197 */ 202 */
198mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *image_signature, uint16_t signature_length, const char *image_type, plist_t *result) 203mobile_image_mounter_error_t mobile_image_mounter_mount_image(mobile_image_mounter_client_t client, const char *image_path, const char *image_signature, uint16_t signature_length, const char *image_type, plist_t *result)
@@ -227,7 +232,7 @@ leave_unlock:
227} 232}
228 233
229/** 234/**
230 * Hangs up the connection to the MobileImageMounter service. 235 * Hangs up the connection to the mobile_image_mounter service.
231 * This functions has to be called before freeing up a mobile_image_mounter 236 * This functions has to be called before freeing up a mobile_image_mounter
232 * instance. If not, errors appear in the device's syslog. 237 * instance. If not, errors appear in the device's syslog.
233 * 238 *
diff --git a/src/mobile_image_mounter.h b/src/mobile_image_mounter.h
index 85dd8bc..da8bf3e 100644
--- a/src/mobile_image_mounter.h
+++ b/src/mobile_image_mounter.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * mobile_image_mounter.h 2 * mobile_image_mounter.h
3 * Mobile Image Mounter header file. 3 * com.apple.mobile.mobile_image_mounter service header file.
4 * 4 *
5 * Copyright (c) 2010 Nikias Bassen, All Rights Reserved. 5 * Copyright (c) 2010 Nikias Bassen, All Rights Reserved.
6 * 6 *