summaryrefslogtreecommitdiff
path: root/camlibs/digita/commands.c
diff options
context:
space:
mode:
authorJohannes Erdfelt <johannes@erdfelt.com>2002-05-10 23:51:32 +0000
committerJohannes Erdfelt <johannes@erdfelt.com>2002-05-10 23:51:32 +0000
commit2d1b80ed5947af750361a50b6343932efc37bf7a (patch)
treed8021f2473f332b399b0b46b8330a9f90431623a /camlibs/digita/commands.c
parent234f77d876ec496ee6daf251bf17055f643a2a74 (diff)
downloadlibgphoto2-2d1b80ed5947af750361a50b6343932efc37bf7a.tar.gz
Switch all fprintf(stderr, ...) calls to GP_DEBUG(...) calls
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@4504 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'camlibs/digita/commands.c')
-rw-r--r--camlibs/digita/commands.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/camlibs/digita/commands.c b/camlibs/digita/commands.c
index 0a6f34040..c45be5807 100644
--- a/camlibs/digita/commands.c
+++ b/camlibs/digita/commands.c
@@ -35,6 +35,8 @@
#include "digita.h"
+#define GP_MODULE "digita"
+
#include <gphoto2-port.h>
static void build_command(struct digita_command *cmd, int length, short command)
@@ -67,13 +69,13 @@ int digita_get_storage_status(CameraPrivateLibrary *dev, int *taken,
ret = dev->send(dev, &cmd, sizeof(cmd));
if (ret < 0) {
- fprintf(stderr, "digita_get_storage_status: error sending command (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_storage_status: error sending command (ret = %d)", ret);
return -1;
}
ret = dev->read(dev, (unsigned char *)&ss, sizeof(ss));
if (ret < 0) {
- fprintf(stderr, "digita_get_storage_status: error getting count (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_storage_status: error getting count (ret = %d)", ret);
return -1;
}
@@ -102,7 +104,7 @@ int digita_get_file_list(CameraPrivateLibrary *dev)
buflen = (taken * sizeof(struct file_item)) + sizeof(cmd) + 4;
buffer = malloc(buflen);
if (!buffer) {
- fprintf(stderr, "digita_get_file_list: error allocating %d bytes\n", buflen);
+ GP_DEBUG("digita_get_file_list: error allocating %d bytes", buflen);
return -1;
}
@@ -111,13 +113,13 @@ int digita_get_file_list(CameraPrivateLibrary *dev)
ret = dev->send(dev, (void *)&gfl, sizeof(gfl));
if (ret < 0) {
- fprintf(stderr, "digita_get_file_list: error sending command (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_file_list: error sending command (ret = %d)", ret);
return -1;
}
ret = dev->read(dev, (void *)buffer, buflen);
if (ret < 0) {
- fprintf(stderr, "digita_get_file_list: error receiving data (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_file_list: error receiving data (ret = %d)", ret);
return -1;
}
@@ -126,7 +128,7 @@ int digita_get_file_list(CameraPrivateLibrary *dev)
dev->file_list = malloc(taken * sizeof(struct file_item));
if (!dev->file_list) {
- fprintf(stderr, "digita_get_file_list: error allocating file_list memory (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_file_list: error allocating file_list memory (ret = %d)", ret);
return -1;
}
@@ -154,7 +156,7 @@ int digita_get_file_data(CameraPrivateLibrary *dev, int thumbnail,
tbuf = malloc(GFD_BUFSIZE + sizeof(*gfdr));
if (!tbuf) {
- fprintf(stderr, "digita_get_file_data: unable to allocate %d bytes\n",
+ GP_DEBUG("digita_get_file_data: unable to allocate %d bytes",
GFD_BUFSIZE + sizeof(*gfdr));
return -1;
@@ -163,18 +165,18 @@ int digita_get_file_data(CameraPrivateLibrary *dev, int thumbnail,
ret = dev->send(dev, &gfds, sizeof(gfds));
if (ret < 0) {
- fprintf(stderr, "digita_get_file_data: error sending command (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_file_data: error sending command (ret = %d)", ret);
return -1;
}
ret = dev->read(dev, gfdr, GFD_BUFSIZE + sizeof(*gfdr));
if (ret < 0) {
- fprintf(stderr, "digita_get_file_data: error reading data (ret = %d)\n", ret);
+ GP_DEBUG("digita_get_file_data: error reading data (ret = %d)", ret);
return -1;
}
if (gfdr->cmd.result) {
- fprintf(stderr, "digita_get_file_data: bad result (%d)\n", gfdr->cmd.result);
+ GP_DEBUG("digita_get_file_data: bad result (%d)", gfdr->cmd.result);
return gfdr->cmd.result;
}
@@ -199,13 +201,13 @@ int digita_delete_picture(CameraPrivateLibrary *dev, struct filename *filename)
ret = dev->send(dev, (unsigned char *)&ef, sizeof(ef));
if (ret < 0) {
- fprintf(stderr, "error sending command (ret = %d)\n", ret);
+ GP_DEBUG("error sending command (ret = %d)", ret);
return -1;
}
ret = dev->read(dev, (unsigned char *)&response, sizeof(response));
if (ret < 0) {
- fprintf(stderr, "error reading reply (ret = %d)\n", ret);
+ GP_DEBUG("error reading reply (ret = %d)", ret);
return -1;
}