diff options
author | Lutz Mueller <lutz@users.sourceforge.net> | 2002-01-10 23:06:56 +0000 |
---|---|---|
committer | Lutz Mueller <lutz@users.sourceforge.net> | 2002-01-10 23:06:56 +0000 |
commit | 0dedb0e1639c480e93fb1b1bc88a681a92492740 (patch) | |
tree | 284d72379a31ce09610ed2f76a34259e41d830f7 /camlibs/sonydscf1 | |
parent | 232f43bcb5acde993c540be4f3035532199ffd59 (diff) | |
download | libgphoto2-0dedb0e1639c480e93fb1b1bc88a681a92492740.tar.gz |
2002-01-10 Lutz M�ller <urc8@rz.uni-karlsruhe.de>
* libgphoto2/gphoto2-filesys.[c,h]: Add a GPContext to all functions
that potentially access the camera. This makes cancelling of
all operations possible and improves error reporting.
* tests/test-filesys.c:
* libgphoto2/gphoto2-camera.c:
* camlibs: Adjust to reflect above changes
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3798 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/sonydscf1')
-rw-r--r-- | camlibs/sonydscf1/sonydscf1.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/camlibs/sonydscf1/sonydscf1.c b/camlibs/sonydscf1/sonydscf1.c index 52d92d7f1..707630d26 100644 --- a/camlibs/sonydscf1/sonydscf1.c +++ b/camlibs/sonydscf1/sonydscf1.c @@ -67,7 +67,7 @@ static int camera_exit (Camera *camera) { static int get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, CameraFileType type, - CameraFile *file, void *user_data) + CameraFile *file, void *user_data, GPContext *context) { Camera *camera = user_data; int num; @@ -81,7 +81,7 @@ static int get_file_func (CameraFilesystem *fs, const char *folder, gp_file_set_mime_type (file, "image/jpeg"); /* Retrieve the number of the photo on the camera */ - num = gp_filesystem_number(camera->fs, "/", filename); + num = gp_filesystem_number(camera->fs, "/", filename, context); switch (type) { case GP_FILE_TYPE_NORMAL: @@ -103,13 +103,14 @@ static int get_file_func (CameraFilesystem *fs, const char *folder, } static int delete_file_func (CameraFilesystem *fs, const char *folder, - const char *filename, void *data) + const char *filename, void *data, + GPContext *context) { Camera *camera = data; int max, num; - num = gp_filesystem_number(camera->fs, "/", filename); - max = gp_filesystem_count(camera->fs,folder) ; + num = gp_filesystem_number(camera->fs, "/", filename, context); + max = gp_filesystem_count(camera->fs,folder, context); printf("sony dscf1: file delete: %d\n",num); if(!F1ok()) return (GP_ERROR); @@ -145,7 +146,7 @@ _("Sony DSC-F1 Digital Camera Support\nM. Adam Kendall <joker@penguinpub.com>\nB } static int file_list_func (CameraFilesystem *fs, const char *folder, - CameraList *list, void *data) + CameraList *list, void *data, GPContext *context) { /* Camera *camera = data; */ int count; @@ -172,12 +173,12 @@ int camera_init (Camera *camera) { dev = camera->port; /* Configure the port */ - gp_port_timeout_set (camera->port, 5000); - gp_port_settings_get (camera->port, &settings); + gp_port_set_timeout (camera->port, 5000); + gp_port_get_settings (camera->port, &settings); settings.serial.bits = 8; settings.serial.parity = 0; settings.serial.stopbits= 1; - gp_port_settings_set (camera->port, settings); + gp_port_set_settings (camera->port, settings); /* Set up the filesystem */ gp_filesystem_set_list_funcs (camera->fs, file_list_func, NULL, camera); |