@@ -285,20 +285,20 @@ PUB int ptp_check_prop(struct PtpRuntime *r, int code);
285
285
PUB int ptp_buffer_resize (struct PtpRuntime * r , size_t size );
286
286
287
287
// Data structure functions
288
- PUB int ptp_write_unicode_string (char * dat , char * string );
288
+ PUB int ptp_write_unicode_string (char * dat , const char * string );
289
289
PUB int ptp_read_unicode_string (char * buffer , char * dat , int max );
290
290
PUB int ptp_read_utf8_string (void * dat , char * string , int max );
291
291
PUB int ptp_read_string (uint8_t * dat , char * string , int max );
292
- PUB int ptp_write_string (uint8_t * dat , char * string );
293
- PUB int ptp_write_utf8_string (void * dat , char * string );
294
- PUB int ptp_read_uint16_array (uint8_t * dat , uint16_t * buf , int max , int * length );
292
+ PUB int ptp_write_string (uint8_t * dat , const char * string );
293
+ PUB int ptp_write_utf8_string (void * dat , const char * string );
294
+ PUB int ptp_read_uint16_array (const uint8_t * dat , uint16_t * buf , int max , int * length );
295
295
PUB int ptp_read_uint16_array_s (uint8_t * bs , uint8_t * be , uint16_t * buf , int max , int * length );
296
296
inline static int ptp_write_u8 (void * buf , uint8_t out ) { ((uint8_t * )buf )[0 ] = out ; return 1 ; }
297
297
inline static int ptp_write_u16 (void * buf , uint16_t out ) { ((uint16_t * )buf )[0 ] = out ; return 2 ; }
298
298
inline static int ptp_write_u32 (void * buf , uint32_t out ) { ((uint32_t * )buf )[0 ] = out ; return 4 ; }
299
- inline static int ptp_read_u32 (void * buf , uint32_t * out ) { * out = ((uint32_t * )buf )[0 ]; return 4 ; }
300
- inline static int ptp_read_u16 (void * buf , uint16_t * out ) { * out = ((uint16_t * )buf )[0 ]; return 2 ; }
301
- inline static int ptp_read_u8 (void * buf , uint8_t * out ) { * out = ((uint8_t * )buf )[0 ]; return 1 ; }
299
+ inline static int ptp_read_u32 (const void * buf , uint32_t * out ) { * out = ((const uint32_t * )buf )[0 ]; return 4 ; }
300
+ inline static int ptp_read_u16 (const void * buf , uint16_t * out ) { * out = ((const uint16_t * )buf )[0 ]; return 2 ; }
301
+ inline static int ptp_read_u8 (const void * buf , uint8_t * out ) { * out = ((const uint8_t * )buf )[0 ]; return 1 ; }
302
302
303
303
// Build a new PTP/IP or PTP/USB command packet in r->data
304
304
int ptp_new_cmd_packet (struct PtpRuntime * r , struct PtpCommand * cmd );
0 commit comments