summaryrefslogtreecommitdiff
path: root/camlibs/sx330z
diff options
context:
space:
mode:
authorSiim Meerits <sh0@yutani.ee>2020-07-27 17:37:00 +0300
committerSiim Meerits <sh0@yutani.ee>2020-07-27 17:37:00 +0300
commit456a1d598bccc260b233d2e91c469be452e0fbef (patch)
treec1288655494c94292f6e2eb26d722958899c7107 /camlibs/sx330z
parentaf2c0e0558e78cae06371abef36f43ca74a9c5c0 (diff)
downloadlibgphoto2-456a1d598bccc260b233d2e91c469be452e0fbef.tar.gz
Remove trailing whitespace from all *.h and *.c files.
Diffstat (limited to 'camlibs/sx330z')
-rw-r--r--camlibs/sx330z/library.c56
-rw-r--r--camlibs/sx330z/sx330z.c64
-rw-r--r--camlibs/sx330z/sx330z.h18
3 files changed, 69 insertions, 69 deletions
diff --git a/camlibs/sx330z/library.c b/camlibs/sx330z/library.c
index bea83e2bd..7dbb98846 100644
--- a/camlibs/sx330z/library.c
+++ b/camlibs/sx330z/library.c
@@ -6,10 +6,10 @@
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
@@ -61,12 +61,12 @@
#define CR(res) { int r=(res);if (r<0) return (r);}
/*
- * supported cameras :
+ * supported cameras :
* - Traveler SX330z (Aldi cam)
* - Other SX330z / SX3300z Models ?
* please report if you have others that are working
*/
-
+
static const struct
{
char *model;
@@ -90,9 +90,9 @@ static const struct
/*
- * camera abilities
+ * camera abilities
*/
-int
+int
camera_abilities (CameraAbilitiesList *list)
{
int i;
@@ -110,7 +110,7 @@ camera_abilities (CameraAbilitiesList *list)
a.file_operations = GP_FILE_OPERATION_PREVIEW|
GP_FILE_OPERATION_DELETE|
GP_FILE_OPERATION_EXIF;
- a.folder_operations = GP_FOLDER_OPERATION_NONE;
+ a.folder_operations = GP_FOLDER_OPERATION_NONE;
CR(gp_abilities_list_append(list,a));
} /* all models... */
return(GP_OK);
@@ -120,9 +120,9 @@ camera_abilities (CameraAbilitiesList *list)
/*
- * file list function
+ * file list function
*/
-static int
+static int
file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
void *data, GPContext *context)
{
@@ -132,7 +132,7 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
int pcnt,ecnt; /* pagecounter, entrycounter*/
struct traveler_toc_page toc;
int id;
-
+
/* get number of TOC pages */
CR (sx330z_get_toc_num_pages (camera, context, &tpages));
/* Read the TOC pages */
@@ -152,7 +152,7 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
info.file.size = toc.entries[ecnt].size;
info.file.permissions = GP_FILE_PERM_READ |
GP_FILE_PERM_DELETE;
- strcpy (info.file.type,GP_MIME_JPEG);
+ strcpy (info.file.type,GP_MIME_JPEG);
sprintf (fn, "%.12s", toc.entries[ecnt].name);
/*
@@ -167,14 +167,14 @@ file_list_func (CameraFilesystem *fs, const char *folder, CameraList *list,
if (gp_context_cancel (context) == GP_CONTEXT_FEEDBACK_CANCEL)
return (GP_ERROR_CANCEL);
}
-
+
gp_context_progress_stop (context, id);
return (GP_OK);
}
-static int
+static int
get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
CameraFileType type, CameraFile *file, void *user_data,
GPContext *context)
@@ -182,7 +182,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
Camera *camera = user_data;
char *data = NULL;
unsigned long int size = 0;
-
+
switch (type) {
case GP_FILE_TYPE_EXIF:
gp_file_set_mime_type (file, GP_MIME_RAW);
@@ -200,7 +200,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
return (GP_ERROR_NOT_SUPPORTED);
}
gp_file_set_data_and_size (file, data, size);
-
+
return (GP_OK);
}
@@ -208,7 +208,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename,
/*
* Delete file function (working ..)
*/
-static int
+static int
del_file_func(CameraFilesystem *fs,const char *folder,const char *filename,
void *user_data,GPContext *context)
{
@@ -221,9 +221,9 @@ del_file_func(CameraFilesystem *fs,const char *folder,const char *filename,
/*
- * Camera ID
+ * Camera ID
*/
-int
+int
camera_id(CameraText *id)
{
strcpy(id->text,"Traveler SX330z");
@@ -234,9 +234,9 @@ camera_id(CameraText *id)
/*
- * Camera about
+ * Camera about
*/
-static int
+static int
camera_about(Camera *camera,CameraText *about,GPContext *context)
{
strcpy(about->text,_("(Traveler) SX330z Library (And other Aldi-cams).\n"
@@ -251,7 +251,7 @@ camera_about(Camera *camera,CameraText *about,GPContext *context)
* camera_exit
* release allocated memory
*/
-int
+int
camera_exit(Camera *camera, GPContext *context)
{
if (camera->pl)
@@ -269,15 +269,15 @@ static CameraFilesystemFuncs fsfuncs = {
/*
* OK, lets get serious !
*/
-int
+int
camera_init(Camera *camera,GPContext *context)
{
GPPortSettings settings;
CameraAbilities abilities;
/* try to contact the camera ...*/
/*CR(gp_port_get_settings(camera->port,&settings));*/
-
- camera->functions->about=camera_about;
+
+ camera->functions->about=camera_about;
camera->functions->exit=camera_exit;
gp_port_get_settings(camera->port,&settings);
if (camera->port->type!=GP_PORT_USB)
@@ -287,12 +287,12 @@ camera_init(Camera *camera,GPContext *context)
}
/* GP_DEBUG("camera_init : in = %x",camera->port->settings.usb.inep);*/
CR(gp_port_set_settings(camera->port,settings));
- CR(gp_port_set_timeout(camera->port,TIMEOUT));
+ CR(gp_port_set_timeout(camera->port,TIMEOUT));
CR(gp_filesystem_set_funcs(camera->fs, &fsfuncs, camera));
-
+
camera->pl=malloc(sizeof(CameraPrivateLibrary));
- if (!camera->pl)
+ if (!camera->pl)
return(GP_ERROR_NO_MEMORY);
CR(gp_camera_get_abilities(camera, &abilities));
diff --git a/camlibs/sx330z/sx330z.c b/camlibs/sx330z/sx330z.c
index 1ecb237c9..a4b4bdbc9 100644
--- a/camlibs/sx330z/sx330z.c
+++ b/camlibs/sx330z/sx330z.c
@@ -7,10 +7,10 @@
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
@@ -78,22 +78,22 @@ sx330z_fill_toc_page(uint8_t *buf, struct traveler_toc_page *toc)
* SX330z initialization
* (not really an initialization, but lets check if we have contact )
*/
-int
+int
sx330z_init(Camera *camera, GPContext *context)
{
/* struct traveler_ack ack;*/
uint8_t trxbuf[0x10];
int ret;
ret = gp_port_usb_msg_read(camera->port, USB_REQ_RESERVED, SX330Z_REQUEST_INIT, 0, (char *)trxbuf, 0x10);
- if (ret != 0x10) return(GP_ERROR); /* more specific about error ? */
- return(GP_OK);
+ if (ret != 0x10) return(GP_ERROR); /* more specific about error ? */
+ return(GP_OK);
} /* sx330z_init */
/*
- * Read block described by req
+ * Read block described by req
*/
-static int
+static int
sx330z_read_block(Camera *camera, GPContext *context, struct traveler_req *req, uint8_t *buf)
{
int ret;
@@ -108,7 +108,7 @@ sx330z_read_block(Camera *camera, GPContext *context, struct traveler_req *req,
if (ret != req->size)return(GP_ERROR_IO_READ);
/* 3. read Ack */
ret = gp_port_read(camera->port, (char *)trxbuf, 0x10);
- if (ret != 0x10) return(GP_ERROR);
+ if (ret != 0x10) return(GP_ERROR);
/* FIXME : Security check ???*/
return(GP_OK);
} /* read block */
@@ -117,7 +117,7 @@ sx330z_read_block(Camera *camera, GPContext *context, struct traveler_req *req,
/*
* Get TOC size
*/
-int
+int
sx330z_get_toc_num_pages(Camera *camera, GPContext *context, int32_t *pages)
{
struct traveler_ack ack;
@@ -136,35 +136,35 @@ sx330z_get_toc_num_pages(Camera *camera, GPContext *context, int32_t *pages)
if (ack.size == 0x200) (*pages)--;
if ((ack.size > 0x200)&&
(((ack.size - 0xc) % 0x200) == 0)) (*pages)--;
-
+
return(GP_OK);
} /* get toc size */
/*
- * Get TOC
- * Read a single TOC page
+ * Get TOC
+ * Read a single TOC page
* specified by "page"
*/
-int
+int
sx330z_get_toc_page(Camera *camera, GPContext *context, struct traveler_toc_page *TOC, int page)
{
int ret;
struct traveler_req req;
uint8_t tocbuf[0x200];
-
+
req.always1 = 1;
- req.requesttype = SX330Z_REQUEST_TOC; /* 0x03 */
+ req.requesttype = SX330Z_REQUEST_TOC; /* 0x03 */
req.offset = 0x200 * page; /* offset */
req.timestamp = 0x123; /* ? */
req.size = 0x200; /* 512 Bytes / tocpage*/
req.data = 0; /* ? */
memset(req.filename, 0, 12); /* ? */
-
+
ret=sx330z_read_block(camera,context,&req,tocbuf);
if (ret<0) return(ret);
-
+
sx330z_fill_toc_page(tocbuf,TOC); /* convert */
-
+
/* TOC sanity check */
if ((TOC->numEntries < 0) || (TOC->numEntries > 25)) return(GP_ERROR_CORRUPTED_DATA);
return(GP_OK);
@@ -172,10 +172,10 @@ sx330z_get_toc_page(Camera *camera, GPContext *context, struct traveler_toc_page
/*
- * get data
- * could be Image / Thumbnail
+ * get data
+ * could be Image / Thumbnail
*/
-int
+int
sx330z_get_data(Camera *camera, GPContext *context, const char *filename,
char **data, unsigned long int *size, int thumbnail)
{
@@ -185,16 +185,16 @@ sx330z_get_data(Camera *camera, GPContext *context, const char *filename,
int found;
int tocpages, tcnt, ecnt;
struct traveler_toc_page toc;
- int id;/* progress ? */
+ int id;/* progress ? */
pages = 0;
found = 0;
memcpy(req.filename, filename, 12);
-
- if (thumbnail == SX_THUMBNAIL)
+
+ if (thumbnail == SX_THUMBNAIL)
{
if (camera->pl->usb_product == USB_PRODUCT_MD9700)
pages = 7; /* first 28k only*/
- else
+ else
pages = 5; /* first 20k only */
req.filename[0] = 'T'; /* 'T'humbnail indicator ?*/
id = gp_context_progress_start(context, 0x1000 * pages, "Thumbnail %.4s _", &filename[4]);
@@ -222,8 +222,8 @@ sx330z_get_data(Camera *camera, GPContext *context, const char *filename,
pages = *size / 0x1000;
id = gp_context_progress_start(context, *size, "Picture %.4s _", &filename[4]);
} /* real image */
-
- *size = 4096 * pages;
+
+ *size = 4096 * pages;
*data = malloc(*size);
dptr = (uint8_t *)*data;
/* load all parts */
@@ -238,7 +238,7 @@ sx330z_get_data(Camera *camera, GPContext *context, const char *filename,
gp_context_progress_update(context, id, (cnt + 1) * 0x1000);
sx330z_read_block(camera,context,&req,dptr); /* read data */
dptr += 4096;
- }/* download imageparts */
+ }/* download imageparts */
gp_context_progress_stop(context,id);
return(GP_OK);
} /* sx330z_get_data */
@@ -246,9 +246,9 @@ sx330z_get_data(Camera *camera, GPContext *context, const char *filename,
/*
- * delete file
+ * delete file
*/
-int
+int
sx330z_delete_file(Camera *camera, GPContext *context, const char *filename)
{
struct traveler_req req;
@@ -274,7 +274,7 @@ sx330z_delete_file(Camera *camera, GPContext *context, const char *filename)
ret = gp_port_usb_msg_read(camera->port,
USB_REQ_RESERVED, SX330Z_REQUEST_DELETE, 0, (char *)trxbuf, 0x10);
if (ret != 0x10) return(GP_ERROR);
-
+
gp_context_progress_stop(context, id); /* stop context */
return(GP_OK);
} /* sx330z delete file */
diff --git a/camlibs/sx330z/sx330z.h b/camlibs/sx330z/sx330z.h
index 5f16a18b4..93365b609 100644
--- a/camlibs/sx330z/sx330z.h
+++ b/camlibs/sx330z/sx330z.h
@@ -7,10 +7,10 @@
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
+ * Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
@@ -36,7 +36,7 @@
/* this one should work */
#define USB_PRODUCT_SX330Z 0x3300
-/* very experimental !!!
+/* very experimental !!!
* Please report if this works
*/
#define USB_PRODUCT_SX410Z 0x4100
@@ -72,7 +72,7 @@ struct traveler_toc_page
struct traveler_toc_entry entries[25]; /* entries */
};
-struct _CameraPrivateLibrary
+struct _CameraPrivateLibrary
{
int usb_product; /* different Thumbnail size */
};
@@ -94,7 +94,7 @@ struct traveler_req
struct traveler_ack
{
int32_t always3; /* 3 */
- int32_t timestamp; /* not sure */
+ int32_t timestamp; /* not sure */
int32_t size; /* for TOC and other transfers */
int32_t dontknow; /* always 0 */
};
@@ -108,13 +108,13 @@ int sx330z_init(Camera *camera,GPContext *context);
/*
- * Get number of TOC pages
+ * Get number of TOC pages
*/
int sx330z_get_toc_num_pages(Camera *camera,GPContext *context, int32_t *pages);
/*
- * Get TOC
+ * Get TOC
*/
int sx330z_get_toc_page(Camera *camera,GPContext *context,struct traveler_toc_page *toc,int page);
@@ -127,7 +127,7 @@ int sx330z_get_data(Camera *camera,GPContext *context, const char* filename,
/*
- * Delete image
+ * Delete image
*/
int sx330z_delete_file(Camera *camera,GPContext *context,const char *filename);