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)
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 {
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);
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);
}
}
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 {
fclose(f);
}
if (!rc) {
- fprintf(stderr,"rescanning for plugins\n");
+ agerr(AGERR,"rescanning for plugins\n");
config_rescan(gvc, config_path);
}
}
#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.
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);
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
}