summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2001-12-03 01:42:29 +0000
committerDan Fandrich <dan@coneharvesters.com>2001-12-03 01:42:29 +0000
commitc00c27f9dbb8dd0aa8e81b401947e0f9e81c6cc6 (patch)
tree1c394bd13a251f77c03dcfb8c38f0e9e2614368a /frontends
parent7a855825639d4f047bb1f42304eee1c2c499d8cd (diff)
downloadlibgphoto2-c00c27f9dbb8dd0aa8e81b401947e0f9e81c6cc6.tar.gz
* libgphoto2_port/acconfig.h
* libgphoto2_port/configure.in * libgphoto2_port/libgphoto2_port/gphoto2-port-log.c * libgphoto2_port/libgphoto2_port/gphoto2-port-log.h * frontends/command-line/main.c * frontends/command-line/main.h * acconfig.h * configure.in: Added --disable-debugging option to configure git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3364 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'frontends')
-rw-r--r--frontends/command-line/main.c10
-rw-r--r--frontends/command-line/main.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/frontends/command-line/main.c b/frontends/command-line/main.c
index fd215b852..bd8a60305 100644
--- a/frontends/command-line/main.c
+++ b/frontends/command-line/main.c
@@ -101,7 +101,9 @@ OPTION_CALLBACK(port);
OPTION_CALLBACK(speed);
OPTION_CALLBACK(model);
OPTION_CALLBACK(quiet);
+#ifdef ENABLE_DEBUGGING
OPTION_CALLBACK(debug);
+#endif
OPTION_CALLBACK(use_folder);
OPTION_CALLBACK(recurse);
OPTION_CALLBACK(use_stdout);
@@ -140,7 +142,9 @@ OPTION_CALLBACK(remove_dir);
Option option[] = {
/* Settings needed for formatting output */
+#ifdef ENABLE_DEBUGGING
{"", "debug", "", N_("Turn on debugging"), debug, 0},
+#endif
{"q", "quiet", "", N_("Quiet output (default=verbose)"), quiet, 0},
/* Display and die actions */
@@ -528,6 +532,7 @@ OPTION_CALLBACK(model)
return (GP_OK);
}
+#ifdef ENABLE_DEBUGGING
static void
debug_func (GPLogLevel level, const char *domain, const char *format,
va_list args, void *data)
@@ -549,6 +554,7 @@ OPTION_CALLBACK (debug)
return (GP_OK);
}
+#endif
OPTION_CALLBACK(quiet)
{
@@ -1182,6 +1188,7 @@ init_globals (void)
/* Misc functions */
/* ------------------------------------------------------------------ */
+#ifdef ENABLE_DEBUGGING
void
cli_debug_print (char *format, ...)
{
@@ -1195,6 +1202,7 @@ cli_debug_print (char *format, ...)
fprintf(stderr, "\n");
}
}
+#endif
void
cli_error_print (char *format, ...)
@@ -1295,6 +1303,7 @@ e.g. SET IOLIBS=C:\\GPHOTO2\\IOLIB\n"));
"This message may currently still be unrelated to "
"the real error:\n\n"
"%s\n\n"), _(gp_camera_get_error (glob_camera)));
+#ifdef ENABLE_DEBUGGING
if (!glob_debug) {
int n;
printf (_("For debugging messages, please use the --debug option.\n"
@@ -1308,6 +1317,7 @@ e.g. SET IOLIBS=C:\\GPHOTO2\\IOLIB\n"));
}
printf ("\n\n");
}
+#endif
exit (EXIT_FAILURE);
}
diff --git a/frontends/command-line/main.h b/frontends/command-line/main.h
index 4284e9afe..93c4793cd 100644
--- a/frontends/command-line/main.h
+++ b/frontends/command-line/main.h
@@ -23,7 +23,11 @@ typedef struct {
int required;
} Option;
+#ifdef ENABLE_DEBUGGING
void cli_debug_print(char *format, ...);
+#else
+#define cli_debug_print(format, args...) /**/
+#endif
void cli_error_print(char *format, ...);
int save_picture_to_file (const char *folder, const char *filename,