summaryrefslogtreecommitdiff
path: root/libgphoto2/gphoto2-setting.c
diff options
context:
space:
mode:
authorLutz Mueller <lutz@users.sourceforge.net>2002-01-15 23:49:39 +0000
committerLutz Mueller <lutz@users.sourceforge.net>2002-01-15 23:49:39 +0000
commit19a0c3a76f7fd3c28fb38af4f3f2f63bbca9d684 (patch)
tree50829eeb66d9972d12dfd082f324bcee0d4626ed /libgphoto2/gphoto2-setting.c
parent3165bfcb5a5d58f3e0438a944c1752992ffa741d (diff)
downloadlibgphoto2-19a0c3a76f7fd3c28fb38af4f3f2f63bbca9d684.tar.gz
2002-01-16 Lutz M�ller <lutz@users.sourceforge.net>
Black magic by Marcus Meissner <marcus@jet.franken.de>: find . -type f | xargs grep -l gp_debug_printf | xargs perl -pi -e 's/gp_debug_printf\(\s*GP_DEBUG[^,]*,[^,]*,(.*)$/GP_DEBUG(\1/' git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@3902 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2/gphoto2-setting.c')
-rw-r--r--libgphoto2/gphoto2-setting.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/libgphoto2/gphoto2-setting.c b/libgphoto2/gphoto2-setting.c
index 3166aa428..d176b9374 100644
--- a/libgphoto2/gphoto2-setting.c
+++ b/libgphoto2/gphoto2-setting.c
@@ -18,19 +18,20 @@
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
+#include "gphoto2-setting.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "config.h"
-#include "gphoto2-setting.h"
-
#include "gphoto2-result.h"
-#include "gphoto2-debug.h"
#include "gphoto2-port-log.h"
#include "gphoto2-port-portability.h"
+#define GP_MODULE "setting"
+
typedef struct {
/* key = value settings */
char id[256];
@@ -106,7 +107,7 @@ verify_settings (char *settings_file)
int x, equals;
if ((f=fopen(settings_file, "r"))==NULL) {
- gp_debug_printf(GP_DEBUG_LOW, "core", "Can't open settings file for reading");
+ GP_DEBUG ("Can't open settings file for reading");
return(0);
}
@@ -123,7 +124,7 @@ verify_settings (char *settings_file)
if (equals < 2) {
fclose (f);
- gp_debug_printf(GP_DEBUG_LOW, "core", "Incorrect settings format. resetting\n");
+ GP_DEBUG ("Incorrect settings format. resetting\n");
unlink(settings_file);
return (GP_ERROR);
}
@@ -141,7 +142,7 @@ load_settings (void)
char buf[1024], *id, *key, *value;
/* Make sure the directories are created */
- gp_debug_printf (GP_DEBUG_LOW, "core", "Creating $HOME/.gphoto");
+ GP_DEBUG ("Creating $HOME/.gphoto");
#ifdef WIN32
GetWindowsDirectory (buf, 1024);
strcat (buf, "\\gphoto");
@@ -161,10 +162,10 @@ load_settings (void)
if (verify_settings(buf) != GP_OK)
/* verify_settings will unlink and recreate the settings file */
return (GP_OK);
- gp_debug_printf(GP_DEBUG_LOW, "core", "Loading settings from file \"%s\"", buf);
+ GP_DEBUG ("Loading settings from file \"%s\"", buf);
if ((f=fopen(buf, "r"))==NULL) {
- gp_debug_printf(GP_DEBUG_LOW, "core", "Can't open settings for reading");
+ GP_DEBUG ("Can't open settings for reading");
return(GP_ERROR);
}
@@ -204,7 +205,7 @@ save_settings (void)
glob_setting_count, buf);
if ((f=fopen(buf, "w+"))==NULL) {
- gp_debug_printf(GP_DEBUG_LOW, "core", "Can't open settings file for writing");
+ GP_DEBUG ("Can't open settings file for writing");
return(0);
}
rewind(f);