From 84a8c92d2043b7bf72471f1ad73dd8853805d1fb Mon Sep 17 00:00:00 2001 From: erg Date: Thu, 5 May 2005 21:13:31 +0000 Subject: [PATCH] Use agerr for warning and error messages. --- lib/gvc/gvconfig.c | 16 ++++++++-------- lib/gvc/gvplugin.c | 11 ++++++----- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lib/gvc/gvconfig.c b/lib/gvc/gvconfig.c index 436b2b5ac..8856d6a1c 100644 --- a/lib/gvc/gvconfig.c +++ b/lib/gvc/gvconfig.c @@ -147,7 +147,7 @@ static int gvconfig_plugin_install_from_config(GVC_t * gvc, char *s) path = token(&nest, &s); rc = strncmp(path, libdir, strlen(libdir)); if(rc) { - fprintf(stderr, "config contains invalid path\n"); + agerr (AGERR, "config contains invalid path\n"); return 0; } if (nest == 0) @@ -158,7 +158,7 @@ static int gvconfig_plugin_install_from_config(GVC_t * gvc, char *s) api = token(&nest, &s); gv_api = gvplugin_api(api); if (gv_api == -1) { - fprintf(stderr, "invalid api in config: %s %s\n", path, api); + agerr(AGERR, "invalid api in config: %s %s\n", path, api); return 0; } do { @@ -171,7 +171,7 @@ static int gvconfig_plugin_install_from_config(GVC_t * gvc, char *s) rc = gvplugin_install (gvc, gv_api, type, quality, packagename, path, NULL); if (!rc) { - fprintf(stderr, "config error: %s %s %s\n", path, api, type); + agerr(AGERR, "config error: %s %s %s\n", path, api, type); return 0; } } while (nest == 2); @@ -229,7 +229,7 @@ static void config_rescan(GVC_t *gvc, char *config_path) if (config_path) { f = fopen(config_path,"w"); if (!f) { - fprintf(stderr,"failed to open %s for write.\n", config_path); + agerr(AGERR,"failed to open %s for write.\n", config_path); } } @@ -336,18 +336,18 @@ void gvconfig(GVC_t * gvc) rc = 0; if (config_st.st_size > MAX_SZ_CONFIG) { - fprintf(stderr,"%s is bigger than I can handle.\n", config_path); + agerr(AGERR,"%s is bigger than I can handle.\n", config_path); } else { f = fopen(config_path,"r"); if (!f) { - fprintf(stderr,"failed to open %s for read.\n", config_path); + agerr (AGERR,"failed to open %s for read.\n", config_path); } else { config_text = malloc(config_st.st_size + 1); sz = fread(config_text, 1, config_st.st_size, f); if (sz == 0) { - fprintf(stderr,"%s is zero sized, or other read error.\n", config_path); + agerr(AGERR,"%s is zero sized, or other read error.\n", config_path); free(config_text); } else { @@ -360,7 +360,7 @@ void gvconfig(GVC_t * gvc) fclose(f); } if (!rc) { - fprintf(stderr,"rescanning for plugins\n"); + agerr(AGERR,"rescanning for plugins\n"); config_rescan(gvc, config_path); } } diff --git a/lib/gvc/gvplugin.c b/lib/gvc/gvplugin.c index 1f95d6f77..9b5bbb85c 100644 --- a/lib/gvc/gvplugin.c +++ b/lib/gvc/gvplugin.c @@ -29,6 +29,7 @@ #include "types.h" #include "macros.h" #include "gvc.h" +#include "graph.h" /* * Define an apis array of name strings using an enumerated api_t as index. @@ -106,19 +107,19 @@ gvplugin_library_t *gvplugin_library_load(char *path) char *suffix = "_LTX_library"; if (lt_dlinit()) { - fprintf(stderr,"failed to init libltdl\n"); + agerr(AGERR, "failed to init libltdl\n"); return NULL; } hndl = lt_dlopen (path); if (!hndl) { - fprintf(stderr,"failed to dlopen %s\n", path); + agerr(AGERR, "failed to dlopen %s\n", path); return NULL; } s = strrchr(path, '/'); len = strlen(s); if (len < strlen("libgvplugin_x")) { - fprintf(stderr,"invalid plugin path \"%s\"\n", path); + agerr (AGERR,"invalid plugin path \"%s\"\n", path); return NULL; } sym = malloc(len + strlen(suffix) + 1); @@ -128,14 +129,14 @@ gvplugin_library_t *gvplugin_library_load(char *path) ptr = lt_dlsym (hndl, sym); if (!ptr) { - fprintf(stderr,"failed to resolve %s in %s\n", sym, path); + agerr (AGERR,"failed to resolve %s in %s\n", sym, path); free(sym); return NULL; } free(sym); return (gvplugin_library_t *)(ptr); #else - fprintf(stderr,"dynamic loading not available\n"); + agerr (AGERR,"dynamic loading not available\n"); return NULL; #endif } -- 2.40.0