Index: libroar/config.c
===================================================================
--- libroar/config.c	(revision 5831)
+++ libroar/config.c	(revision 5832)
@@ -436,5 +436,5 @@
 }
 
-static const struct {
+static const struct pathinfo {
  const char * name;
  const char * path;
@@ -487,13 +487,14 @@
  {"bin-pinentry",       ROAR_HAVE_BIN_PINENTRY, 0, 0},
  {"bin-ssh_askpass",    ROAR_HAVE_BIN_SSH_ASKPASS, 0, 0},
- {"bin-gtk_led_askpass", ROAR_HAVE_BIN_GTK_LED_ASKPASS, 0, 0},
- {"bin-x11_ssh_askpass", ROAR_HAVE_BIN_X11_SSH_ASKPASS, 0, 0},
- {"bin-gnome_ssh_askpass", ROAR_HAVE_BIN_GNOME_SSH_ASKPASS, 0, 0},
+ {"bin-gtk-led-askpass", ROAR_HAVE_BIN_GTK_LED_ASKPASS, 0, 0},
+ {"bin-x11-ssh-askpass", ROAR_HAVE_BIN_X11_SSH_ASKPASS, 0, 0},
+ {"bin-gnome-ssh-askpass", ROAR_HAVE_BIN_GNOME_SSH_ASKPASS, 0, 0},
  {"bin-gpg",            ROAR_HAVE_BIN_GPG, 0, 0},
  {"bin-eject",          ROAR_HAVE_BIN_EJECT, 0, 0},
 
  // devices:
- {"dev-stdin",          ROAR_PREFIX_DEV "/stdin", 0, 0},
+ {"dev-stdin",                  ROAR_PREFIX_DEV "/stdin", 0, 0},
  {"dev-default-pwmled",         ROAR_PREFIX_DEV "/ttyS0", 0, 0},
+ {"dev-default-dmx4linux",      ROAR_PREFIX_DEV "/dmx", 0, 0},
 
 #ifdef ROAR_DEFAULT_CDROM
@@ -512,19 +513,19 @@
  // proc:
 #ifdef ROAR_PROC_NET_DECNET
- {"proc-net-decnet",     ROAR_PROC_NET_DECNET, 0, 0},
+ {"proc-net-decnet",            ROAR_PROC_NET_DECNET, 0, 0},
 #endif
 #ifdef ROAR_PROC_NET_DECNET_NEIGH
- {"proc-net-decnet-neigh", ROAR_PROC_NET_DECNET_NEIGH, 0, 0},
+ {"proc-net-decnet-neigh",      ROAR_PROC_NET_DECNET_NEIGH, 0, 0},
 #endif
 #ifdef ROAR_PROC_NET_ARP
- {"proc-net-arp",        ROAR_PROC_NET_ARP, 0, 0},
+ {"proc-net-arp",               ROAR_PROC_NET_ARP, 0, 0},
 #endif
 
  // sysconf:
- {"sysconf-hosts",       ROAR_PREFIX_SYSCONF "/hosts", 0, 0},
- {"sysconf-roarserver",  ROAR_PREFIX_SYSCONF "/roarserver", 0, 0},
+ {"sysconf-hosts",              ROAR_PREFIX_SYSCONF "/hosts", 0, 0},
+ {"sysconf-roarserver",         ROAR_PREFIX_SYSCONF "/roarserver", 0, 0},
 
  // special dirs:
- {"dir-nx-home",         "/NX-HOME-DIR", 0, 0}
+ {"dir-nx-home",                "/NX-HOME-DIR", 0, 0}
 };
 
@@ -606,58 +607,75 @@
 }
 
+static const struct pathinfo * __lookup_path(const char * name) {
+ size_t i;
+
+ if ( name == NULL ) {
+  roar_err_set(ROAR_ERROR_FAULT);
+  return NULL;
+ }
+
+ for (i = 0; i < (sizeof(__paths)/sizeof(*__paths)); i++)
+  if ( !strcmp(__paths[i].name, name) )
+   return &(__paths[i]);
+
+ roar_err_set(ROAR_ERROR_NOENT);
+ return NULL;
+}
+
 char * roar_libroar_get_path(const char * name, int null_as_universal, const char * product, const char * provider) {
+ const struct pathinfo * path;
  char buf_product[384];
  char buf_provider[384];
  ssize_t len_prefix, len_product, len_provider;
- size_t i;
  char * ret, * p;
 
  ROAR_DBG("roar_libroar_get_path(name='%s', null_as_universal=%i, product='%s', provider='%s') = ?", name, null_as_universal, product, provider);
 
- if ( name == NULL ) {
-  roar_err_set(ROAR_ERROR_FAULT);
-  return NULL;
- }
-
- for (i = 0; i < (sizeof(__paths)/sizeof(*__paths)); i++) {
-  if ( !!strcmp(__paths[i].name, name) )
-   continue;
-
-  if ( ((null_as_universal || product != NULL) && !__paths[i].with_product) ||
-       (provider != NULL && !__paths[i].with_provider) ) {
-   roar_err_set(ROAR_ERROR_INVAL);
-   return NULL;
-  }
-
-  if ( __product2path(buf_product, sizeof(buf_product), null_as_universal, product, __paths[i].with_product) == -1 )
-   return NULL;
-
-  if ( __provider2path(buf_provider, sizeof(buf_provider), provider) == -1 )
-   return NULL;
-
-  len_prefix = roar_mm_strlen(__paths[i].path);
-  len_product = roar_mm_strlen(buf_product);
-  len_provider = roar_mm_strlen(buf_provider);
-
-  p = ret = roar_mm_malloc(len_prefix+len_product+len_provider+1);
-  if ( ret == NULL )
-   return NULL;
-
-  memcpy(p, __paths[i].path, len_prefix);
-  p += len_prefix;
-  if ( p[-1] == '/' )
-   p--;
-  memcpy(p, buf_product, len_product);
-  p += len_product;
-  memcpy(p, buf_provider, len_provider);
-  p += len_provider;
-
-  *p = 0;
-
-  return ret;
- }
-
- roar_err_set(ROAR_ERROR_NOENT);
- return NULL;
+ path = __lookup_path(name);
+ if ( path == NULL )
+  return NULL;
+
+ if ( ((null_as_universal || product != NULL) && !path->with_product) ||
+      (provider != NULL && !path->with_provider) ) {
+  roar_err_set(ROAR_ERROR_INVAL);
+  return NULL;
+ }
+
+ if ( __product2path(buf_product, sizeof(buf_product), null_as_universal, product, path->with_product) == -1 )
+  return NULL;
+
+ if ( __provider2path(buf_provider, sizeof(buf_provider), provider) == -1 )
+  return NULL;
+
+ len_prefix = roar_mm_strlen(path->path);
+ len_product = roar_mm_strlen(buf_product);
+ len_provider = roar_mm_strlen(buf_provider);
+
+ p = ret = roar_mm_malloc(len_prefix+len_product+len_provider+1);
+ if ( ret == NULL )
+  return NULL;
+
+ memcpy(p, path->path, len_prefix);
+ p += len_prefix;
+ if ( p[-1] == '/' )
+  p--;
+ memcpy(p, buf_product, len_product);
+ p += len_product;
+ memcpy(p, buf_provider, len_provider);
+ p += len_provider;
+
+ *p = 0;
+
+ return ret;
+}
+
+const char * roar_libroar_get_path_static(const char * name) {
+ const struct pathinfo * path;
+
+ path = __lookup_path(name);
+ if ( path == NULL )
+  return NULL;
+
+ return path->path;
 }
 
