diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2006-03-31 19:56:38 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2006-03-31 19:56:38 +0000 |
commit | ed692ea58f072b70e14cd1d0e3695509b6cc4969 (patch) | |
tree | 4051bd035690eebd36cf8ba39286dd6877afba21 /camlibs/polaroid | |
parent | c80bcadc6ec24d2b376559f35bf147dc1ee80cd4 (diff) | |
download | libgphoto2-ed692ea58f072b70e14cd1d0e3695509b6cc4969.tar.gz |
converted to fsfuncs.
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8694 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/polaroid')
-rw-r--r-- | camlibs/polaroid/pdc320.c | 12 | ||||
-rw-r--r-- | camlibs/polaroid/pdc640.c | 18 |
2 files changed, 16 insertions, 14 deletions
diff --git a/camlibs/polaroid/pdc320.c b/camlibs/polaroid/pdc320.c index 247e750d1..7c5571578 100644 --- a/camlibs/polaroid/pdc320.c +++ b/camlibs/polaroid/pdc320.c @@ -501,6 +501,12 @@ camera_exit (Camera *camera, GPContext *context) return (GP_OK); } +static CameraFilesystemFuncs fsfuncs = { + .file_list_func = file_list_func, + .get_file_func = get_file_func, + .delete_all_func = delete_all_func +}; + int camera_init (Camera *camera, GPContext *context) { @@ -514,11 +520,7 @@ camera_init (Camera *camera, GPContext *context) camera->functions->summary = camera_summary; /* Now, tell the filesystem where to get lists and info */ - gp_filesystem_set_list_funcs (camera->fs, file_list_func, NULL, camera); - gp_filesystem_set_file_funcs (camera->fs, get_file_func, NULL, - camera); - gp_filesystem_set_folder_funcs (camera->fs, NULL, delete_all_func, - NULL, NULL, camera); + gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera); camera->pl = malloc (sizeof (CameraPrivateLibrary)); if (!camera->pl) diff --git a/camlibs/polaroid/pdc640.c b/camlibs/polaroid/pdc640.c index 7708f91e6..6c83ba99f 100644 --- a/camlibs/polaroid/pdc640.c +++ b/camlibs/polaroid/pdc640.c @@ -1007,6 +1007,14 @@ camera_exit (Camera *camera, GPContext *context) return (GP_OK); } +static CameraFilesystemFuncs fsfuncs = { + .file_list_func = file_list_func, + .get_info_func = get_info_func, + .get_file_func = get_file_func, + .del_file_func = delete_file_func, + .delete_all_func = delete_all_func, +}; + int camera_init (Camera *camera, GPContext *context) { @@ -1041,16 +1049,8 @@ camera_init (Camera *camera, GPContext *context) if( ! camera->pl ){ return (GP_ERROR_NOT_SUPPORTED); } - /* Tell the filesystem where to get lists and info */ - CHECK_RESULT (gp_filesystem_set_list_funcs (camera->fs, file_list_func, - NULL, camera)); - CHECK_RESULT (gp_filesystem_set_info_funcs (camera->fs, get_info_func, - NULL, camera)); - CHECK_RESULT (gp_filesystem_set_folder_funcs (camera->fs, NULL, - delete_all_func, NULL, NULL, camera)); - CHECK_RESULT (gp_filesystem_set_file_funcs (camera->fs, get_file_func, - delete_file_func, camera)); + CHECK_RESULT (gp_filesystem_set_funcs (camera->fs, &fsfuncs, camera)); if (camera->port->type == GP_PORT_SERIAL) { /* Open the port */ |