summaryrefslogtreecommitdiff
path: root/libgphoto2
diff options
context:
space:
mode:
authorHans Ulrich Niedermann <gp@n-dimensional.de>2005-04-24 09:21:21 +0000
committerHans Ulrich Niedermann <gp@n-dimensional.de>2005-04-24 09:21:21 +0000
commit0b10077369c7ef05bbeecd982caaccd0649850a7 (patch)
tree70285fb432c4ad358e8d0ddf3d4acfe162f6be89 /libgphoto2
parent0f2d5b9e39e9c1ddbe07d4079f9d42291d4965ac (diff)
downloadlibgphoto2-0b10077369c7ef05bbeecd982caaccd0649850a7.tar.gz
set camlib/iolib dir at runtime with environment variable CAMLIBS/IOLIBS
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7893 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2')
-rw-r--r--libgphoto2/gphoto2-abilities-list.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libgphoto2/gphoto2-abilities-list.c b/libgphoto2/gphoto2-abilities-list.c
index 126d6e679..e4fd967ef 100644
--- a/libgphoto2/gphoto2-abilities-list.c
+++ b/libgphoto2/gphoto2-abilities-list.c
@@ -60,6 +60,14 @@
#define CHECK_RESULT(result) {int r = (result); if (r < 0) return (r);}
#define CHECK_MEM(m) {if (!(m)) return (GP_ERROR_NO_MEMORY);}
+/** CAMLIBDIR_ENV:
+ *
+ * Name of the environment variable which may contain the path where
+ * to look for the camlibs. If this environment variable is not defined,
+ * use the compiled-in default constant.
+ **/
+#define CAMLIBDIR_ENV "CAMLIBS"
+
/**
* CameraAbilitiesList:
*
@@ -261,9 +269,11 @@ gp_abilities_list_load_dir (CameraAbilitiesList *list, const char *dir,
int
gp_abilities_list_load (CameraAbilitiesList *list, GPContext *context)
{
+ const char *camlib_env = getenv(CAMLIBDIR_ENV);
+ const char *camlibs = (camlib_env != NULL)?camlib_env:CAMLIBS;
CHECK_NULL (list);
- CHECK_RESULT (gp_abilities_list_load_dir (list, CAMLIBS, context));
+ CHECK_RESULT (gp_abilities_list_load_dir (list, camlibs, context));
CHECK_RESULT (gp_abilities_list_sort (list));
return (GP_OK);