diff options
Diffstat (limited to 'src/service.c')
| -rw-r--r-- | src/service.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/service.c b/src/service.c index 701c8b4..c4743dc 100644 --- a/src/service.c +++ b/src/service.c | |||
| @@ -52,7 +52,7 @@ static service_error_t idevice_to_service_error(idevice_error_t err) | |||
| 52 | return SERVICE_E_UNKNOWN_ERROR; | 52 | return SERVICE_E_UNKNOWN_ERROR; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) | 55 | LIBIMOBILEDEVICE_API service_error_t service_client_new(idevice_t device, lockdownd_service_descriptor_t service, service_client_t *client) |
| 56 | { | 56 | { |
| 57 | if (!device || !service || service->port == 0 || !client || *client) | 57 | if (!device || !service || service->port == 0 || !client || *client) |
| 58 | return SERVICE_E_INVALID_ARG; | 58 | return SERVICE_E_INVALID_ARG; |
| @@ -76,7 +76,7 @@ service_error_t service_client_new(idevice_t device, lockdownd_service_descripto | |||
| 76 | return SERVICE_E_SUCCESS; | 76 | return SERVICE_E_SUCCESS; |
| 77 | } | 77 | } |
| 78 | 78 | ||
| 79 | service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code) | 79 | LIBIMOBILEDEVICE_API service_error_t service_client_factory_start_service(idevice_t device, const char* service_name, void **client, const char* label, int16_t (*constructor_func)(idevice_t, lockdownd_service_descriptor_t, void**), int16_t *error_code) |
| 80 | { | 80 | { |
| 81 | *client = NULL; | 81 | *client = NULL; |
| 82 | 82 | ||
| @@ -115,7 +115,7 @@ service_error_t service_client_factory_start_service(idevice_t device, const cha | |||
| 115 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; | 115 | return (ec == SERVICE_E_SUCCESS) ? SERVICE_E_SUCCESS : SERVICE_E_START_SERVICE_ERROR; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | service_error_t service_client_free(service_client_t client) | 118 | LIBIMOBILEDEVICE_API service_error_t service_client_free(service_client_t client) |
| 119 | { | 119 | { |
| 120 | if (!client) | 120 | if (!client) |
| 121 | return SERVICE_E_INVALID_ARG; | 121 | return SERVICE_E_INVALID_ARG; |
| @@ -128,7 +128,7 @@ service_error_t service_client_free(service_client_t client) | |||
| 128 | return err; | 128 | return err; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) | 131 | LIBIMOBILEDEVICE_API service_error_t service_send(service_client_t client, const char* data, uint32_t size, uint32_t *sent) |
| 132 | { | 132 | { |
| 133 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 133 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
| 134 | int bytes = 0; | 134 | int bytes = 0; |
| @@ -149,7 +149,7 @@ service_error_t service_send(service_client_t client, const char* data, uint32_t | |||
| 149 | return res; | 149 | return res; |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) | 152 | LIBIMOBILEDEVICE_API service_error_t service_receive_with_timeout(service_client_t client, char* data, uint32_t size, uint32_t *received, unsigned int timeout) |
| 153 | { | 153 | { |
| 154 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; | 154 | service_error_t res = SERVICE_E_UNKNOWN_ERROR; |
| 155 | int bytes = 0; | 155 | int bytes = 0; |
| @@ -169,19 +169,19 @@ service_error_t service_receive_with_timeout(service_client_t client, char* data | |||
| 169 | return res; | 169 | return res; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) | 172 | LIBIMOBILEDEVICE_API service_error_t service_receive(service_client_t client, char* data, uint32_t size, uint32_t *received) |
| 173 | { | 173 | { |
| 174 | return service_receive_with_timeout(client, data, size, received, 10000); | 174 | return service_receive_with_timeout(client, data, size, received, 10000); |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | service_error_t service_enable_ssl(service_client_t client) | 177 | LIBIMOBILEDEVICE_API service_error_t service_enable_ssl(service_client_t client) |
| 178 | { | 178 | { |
| 179 | if (!client || !client->connection) | 179 | if (!client || !client->connection) |
| 180 | return SERVICE_E_INVALID_ARG; | 180 | return SERVICE_E_INVALID_ARG; |
| 181 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); | 181 | return idevice_to_service_error(idevice_connection_enable_ssl(client->connection)); |
| 182 | } | 182 | } |
| 183 | 183 | ||
| 184 | service_error_t service_disable_ssl(service_client_t client) | 184 | LIBIMOBILEDEVICE_API service_error_t service_disable_ssl(service_client_t client) |
| 185 | { | 185 | { |
| 186 | if (!client || !client->connection) | 186 | if (!client || !client->connection) |
| 187 | return SERVICE_E_INVALID_ARG; | 187 | return SERVICE_E_INVALID_ARG; |
