converted to fsfuncs.

git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@8696 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
Marcus Meissner
2006-03-31 20:10:06 +00:00
parent adb3a33184
commit ae21f4d8f9
2 changed files with 21 additions and 19 deletions

View File

@@ -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;

View File

@@ -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