diff options
Diffstat (limited to 'libthor')
-rw-r--r-- | libthor/thor.c | 12 | ||||
-rw-r--r-- | libthor/thor.h | 8 | ||||
-rw-r--r-- | libthor/thor_internal.h | 22 | ||||
-rw-r--r-- | libthor/thor_raw_file.c | 8 | ||||
-rw-r--r-- | libthor/thor_tar.c | 10 | ||||
-rw-r--r-- | libthor/thor_usb.c | 6 |
6 files changed, 33 insertions, 33 deletions
diff --git a/libthor/thor.c b/libthor/thor.c index 6a15155..a670f4d 100644 --- a/libthor/thor.c +++ b/libthor/thor.c @@ -157,7 +157,7 @@ static int t_thor_exec_cmd(thor_device_handle *th, request_type req_id, NULL, 0, NULL); } -int thor_start_session(thor_device_handle *th, size_t total) +int thor_start_session(thor_device_handle *th, off_t total) { int ret; @@ -200,7 +200,7 @@ out: static int t_thor_prep_next_chunk(struct t_thor_data_chunk *chunk, struct t_thor_data_transfer *transfer_data) { - size_t to_read; + off_t to_read; int ret; to_read = transfer_data->data_left - transfer_data->data_in_progress; @@ -319,7 +319,7 @@ complete_all: static int t_thor_init_chunk(struct t_thor_data_chunk *chunk, thor_device_handle *th, - size_t trans_unit_size, + off_t trans_unit_size, void *user_data) { int ret; @@ -376,7 +376,7 @@ static inline void t_thor_cancel_chunk(struct t_thor_data_chunk *chunk) static int t_thor_send_raw_data(thor_device_handle *th, struct thor_data_src *data, - size_t trans_unit_size, + off_t trans_unit_size, thor_progress_cb report_progress, void *user_data) { @@ -441,11 +441,11 @@ int thor_send_data(thor_device_handle *th, struct thor_data_src *data, void *user_data, thor_next_entry_cb report_next_entry, void *ne_cb_data) { - size_t filesize; + off_t filesize; const char *filename; struct res_pkt resp; int32_t int_data[2]; - size_t trans_unit_size; + off_t trans_unit_size; int ret; while (1) { diff --git a/libthor/thor.h b/libthor/thor.h index dceb273..9bc9930 100644 --- a/libthor/thor.h +++ b/libthor/thor.h @@ -37,9 +37,9 @@ enum thor_data_type { }; struct thor_data_src { - size_t (*get_file_length)(struct thor_data_src *src); - size_t (*get_size)(struct thor_data_src *src); - size_t (*get_block)(struct thor_data_src *src, void *data, size_t len); + off_t (*get_file_length)(struct thor_data_src *src); + off_t (*get_size)(struct thor_data_src *src); + off_t (*get_block)(struct thor_data_src *src, void *data, off_t len); const char* (*get_name)(struct thor_data_src *src); int (*next_file)(struct thor_data_src *src); void (*release)(struct thor_data_src *src); @@ -76,7 +76,7 @@ int thor_open(struct thor_device_id *dev_id, int wait, void thor_close(thor_device_handle *th); /* Start thor "session" */ -int thor_start_session(thor_device_handle *th, size_t total); +int thor_start_session(thor_device_handle *th, off_t total); /* Send a butch of data to the target */ int thor_send_data(thor_device_handle *th, struct thor_data_src *data, diff --git a/libthor/thor_internal.h b/libthor/thor_internal.h index 06f44d8..ec3d80f 100644 --- a/libthor/thor_internal.h +++ b/libthor/thor_internal.h @@ -51,7 +51,7 @@ typedef void (*t_usb_transfer_cb)(struct t_usb_transfer *); struct t_usb_transfer { struct libusb_transfer *ltransfer; t_usb_transfer_cb transfer_finished; - size_t size; + off_t size; int ret; int cancelled; }; @@ -60,10 +60,10 @@ struct t_thor_data_chunk { struct t_usb_transfer data_transfer; struct t_usb_transfer resp_transfer; void *user_data; - size_t useful_size; + off_t useful_size; struct data_res_pkt resp; unsigned char *buf; - size_t trans_unit_size; + off_t trans_unit_size; int chunk_number; int data_finished; int resp_finished; @@ -74,9 +74,9 @@ struct t_thor_data_transfer { struct thor_data_src *data; thor_progress_cb report_progress; void *user_data; - size_t data_left; - size_t data_sent; - size_t data_in_progress; + off_t data_left; + off_t data_sent; + off_t data_in_progress; int chunk_number; int completed; int ret; @@ -88,7 +88,7 @@ int t_usb_handle_events_completed(int *completed); int t_usb_init_transfer(struct t_usb_transfer *t, libusb_device_handle *devh, unsigned char ep, - unsigned char *buf, size_t size, + unsigned char *buf, off_t size, t_usb_transfer_cb transfer_finished, unsigned int timeout); @@ -99,7 +99,7 @@ static inline void t_usb_cleanup_transfer(struct t_usb_transfer *t) static inline int t_usb_init_in_transfer(struct t_usb_transfer *t, struct thor_device_handle *th, - unsigned char *buf, size_t size, + unsigned char *buf, off_t size, t_usb_transfer_cb transfer_finished, unsigned int timeout) { @@ -109,7 +109,7 @@ static inline int t_usb_init_in_transfer(struct t_usb_transfer *t, static inline int t_usb_init_out_transfer(struct t_usb_transfer *t, struct thor_device_handle *th, - unsigned char *buf, size_t size, + unsigned char *buf, off_t size, t_usb_transfer_cb transfer_finished, unsigned int timeout) { @@ -132,10 +132,10 @@ int t_file_get_data_src(const char *path, struct thor_data_src **data); int t_tar_get_data_src(const char *path, struct thor_data_src **data); int t_usb_send(struct thor_device_handle *th, unsigned char *buf, - size_t count, int timeout); + off_t count, int timeout); int t_usb_recv(struct thor_device_handle *th, unsigned char *buf, - size_t count, int timeout); + off_t count, int timeout); int t_usb_send_req(struct thor_device_handle *th, request_type req_id, int req_sub_id, int *idata, int icnt, char **sdata, diff --git a/libthor/thor_raw_file.c b/libthor/thor_raw_file.c index 1ec1385..d4177bb 100644 --- a/libthor/thor_raw_file.c +++ b/libthor/thor_raw_file.c @@ -31,11 +31,11 @@ struct file_data_src { struct thor_data_src src; int fd; const char* filename; - size_t filesize; + off_t filesize; int pos; }; -static size_t file_get_file_length(struct thor_data_src *src) +static off_t file_get_file_length(struct thor_data_src *src) { struct file_data_src *filedata = container_of(src, struct file_data_src, src); @@ -43,8 +43,8 @@ static size_t file_get_file_length(struct thor_data_src *src) return filedata->filesize; } -static size_t file_get_data_block(struct thor_data_src *src, - void *data, size_t len) +static off_t file_get_data_block(struct thor_data_src *src, + void *data, off_t len) { struct file_data_src *filedata = container_of(src, struct file_data_src, src); diff --git a/libthor/thor_tar.c b/libthor/thor_tar.c index b74e126..b91d102 100644 --- a/libthor/thor_tar.c +++ b/libthor/thor_tar.c @@ -28,10 +28,10 @@ struct tar_data_src { struct thor_data_src src; struct archive *ar; struct archive_entry *ae; - size_t total_size; + off_t total_size; }; -static size_t tar_get_file_length(struct thor_data_src *src) +static off_t tar_get_file_length(struct thor_data_src *src) { struct tar_data_src *tardata = container_of(src, struct tar_data_src, src); @@ -39,7 +39,7 @@ static size_t tar_get_file_length(struct thor_data_src *src) return archive_entry_size(tardata->ae); } -static size_t tar_get_size(struct thor_data_src *src) +static off_t tar_get_size(struct thor_data_src *src) { struct tar_data_src *tardata = container_of(src, struct tar_data_src, src); @@ -47,8 +47,8 @@ static size_t tar_get_size(struct thor_data_src *src) return tardata->total_size; } -static size_t tar_get_data_block(struct thor_data_src *src, - void *data, size_t len) +static off_t tar_get_data_block(struct thor_data_src *src, + void *data, off_t len) { struct tar_data_src *tardata = container_of(src, struct tar_data_src, src); diff --git a/libthor/thor_usb.c b/libthor/thor_usb.c index 79d4567..9c93af2 100644 --- a/libthor/thor_usb.c +++ b/libthor/thor_usb.c @@ -488,7 +488,7 @@ void t_usb_close_device(struct thor_device_handle *th) } int t_usb_send(struct thor_device_handle *th, unsigned char *buf, - size_t count, int timeout) + off_t count, int timeout) { int ret; int transferred = 0; @@ -509,7 +509,7 @@ int t_usb_send(struct thor_device_handle *th, unsigned char *buf, } int t_usb_recv(struct thor_device_handle *th, unsigned char *buf, - size_t count, int timeout) + off_t count, int timeout) { int ret; int transferred = 0; @@ -596,7 +596,7 @@ static void t_usb_transfer_finished(struct libusb_transfer *ltransfer) int t_usb_init_transfer(struct t_usb_transfer *t, libusb_device_handle *devh, unsigned char ep, - unsigned char *buf, size_t size, + unsigned char *buf, off_t size, t_usb_transfer_cb transfer_finished, unsigned int timeout) { |