From ae21f4d8f9773faebfe4f6e0bb3029201ca8e4e4 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Fri, 31 Mar 2006 20:10:06 +0000 Subject: [PATCH] converted to fsfuncs. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8696 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/ricoh/g3.c | 21 ++++++++++++--------- camlibs/ricoh/library.c | 19 +++++++++---------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/camlibs/ricoh/g3.c b/camlibs/ricoh/g3.c index ef28d3765..135baabdc 100644 --- a/camlibs/ricoh/g3.c +++ b/camlibs/ricoh/g3.c @@ -866,6 +866,17 @@ out: return (GP_OK); } +static CameraFilesystemFuncs fsfuncs = { + .file_list_func = file_list_func, + .get_file_func = get_file_func, + .del_file_func = delete_file_func, + .get_info_func = get_info_func, + .set_info_func = set_info_func, + .folder_list_func = folder_list_func, + .make_dir_func = mkdir_func, + .remove_dir_func = rmdir_func, +}; + int camera_init (Camera *camera, GPContext *context) { @@ -877,15 +888,7 @@ camera_init (Camera *camera, GPContext *context) camera->functions->about = camera_about; /* Now, tell the filesystem where to get lists, files and info */ - gp_filesystem_set_list_funcs (camera->fs, file_list_func, - folder_list_func, camera); - gp_filesystem_set_info_funcs (camera->fs, get_info_func, set_info_func, - camera); - gp_filesystem_set_file_funcs (camera->fs, get_file_func, - delete_file_func, camera); - gp_filesystem_set_folder_funcs (camera->fs, NULL, NULL, - mkdir_func, rmdir_func, camera); - + gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera); gp_port_get_settings(camera->port, &settings); settings.usb.inep = 0x81; diff --git a/camlibs/ricoh/library.c b/camlibs/ricoh/library.c index 6e3feae4e..920575e20 100644 --- a/camlibs/ricoh/library.c +++ b/camlibs/ricoh/library.c @@ -517,6 +517,14 @@ static struct { { 0, 0} }; +static CameraFilesystemFuncs fsfuncs = { + .file_list_func = file_list_func, + .get_file_func = get_file_func, + .del_file_func = del_file_func, + .put_file_func = put_file_func, + .get_info_func = get_info_func +}; + int camera_init (Camera *camera, GPContext *context) { @@ -577,16 +585,7 @@ camera_init (Camera *camera, GPContext *context) camera->functions->about = camera_about; camera->functions->get_config = camera_get_config; camera->functions->set_config = camera_set_config; - - CR (gp_filesystem_set_list_funcs (camera->fs, file_list_func, NULL, - camera)); - CR (gp_filesystem_set_file_funcs (camera->fs, get_file_func, - del_file_func, camera)); - CR (gp_filesystem_set_info_funcs (camera->fs, get_info_func, - NULL, camera)); - CR (gp_filesystem_set_folder_funcs (camera->fs, put_file_func, - NULL, NULL, NULL, camera)); - + CR (gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera)); /* * Remember the model. It could be that there hasn't been the * need to call ricoh_connect. Then we don't have a model. Should