[PATCH] config: rename LIBHAL_... defines for better namespacing.

Peter Hutterer peter.hutterer at who-t.net
Wed Mar 25 21:23:09 PDT 2009


---
 config/hal.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/config/hal.c b/config/hal.c
index 36fa839..782fbb5 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -40,8 +40,8 @@
 #include "os.h"
 
 
-#define LIBHAL_PROP_KEY "input.x11_options."
-#define LIBHAL_XKB_PROP_KEY "input.xkb."
+#define LIBHAL_OPTIONS_KEY "input.x11_options."
+#define LIBHAL_XKB_OPTIONS_KEY "input.xkb."
 
 
 struct config_hal_info {
@@ -273,7 +273,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
         if (psi_key){
 
             /* normal options first (input.x11_options.<propname>) */
-            if (!strncasecmp(psi_key, LIBHAL_PROP_KEY, sizeof(LIBHAL_PROP_KEY)-1)){
+            if (!strncasecmp(psi_key, LIBHAL_OPTIONS_KEY, sizeof(LIBHAL_OPTIONS_KEY)-1)){
                 char* tmp;
 
                 /* only support strings for all values */
@@ -319,7 +319,7 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                     } else
                     {
                         /* all others */
-                        add_option(&options, psi_key + sizeof(LIBHAL_PROP_KEY)-1, tmp_val);
+                        add_option(&options, psi_key + sizeof(LIBHAL_OPTIONS_KEY)-1, tmp_val);
                         xfree(tmp_val);
                     }
                 } else
@@ -335,15 +335,15 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                         xkb_opts.options = strdup(tmp_val);
                     }
                 }
-            } else if (!strncasecmp(psi_key, LIBHAL_XKB_PROP_KEY, sizeof(LIBHAL_XKB_PROP_KEY)-1)){
+            } else if (!strncasecmp(psi_key, LIBHAL_XKB_OPTIONS_KEY, sizeof(LIBHAL_XKB_OPTIONS_KEY)-1)){
                 char* tmp;
 
                 /* only support strings for all values */
                 tmp_val = get_prop_string(hal_ctx, udi, psi_key);
 
-                if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY)) {
+                if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_OPTIONS_KEY)) {
 
-                    tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1];
+                    tmp = &psi_key[sizeof(LIBHAL_XKB_OPTIONS_KEY) - 1];
 
                     if (!strcasecmp(tmp, "layout"))
                     {
@@ -371,9 +371,9 @@ device_added(LibHalContext *hal_ctx, const char *udi)
                 {
                     /* server 1.4 had xkb options as strlist */
                     tmp_val = get_prop_string_array(hal_ctx, udi, psi_key);
-                    if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_PROP_KEY))
+                    if (tmp_val && strlen(psi_key) >= sizeof(LIBHAL_XKB_OPTIONS_KEY))
                     {
-                        tmp = &psi_key[sizeof(LIBHAL_XKB_PROP_KEY) - 1];
+                        tmp = &psi_key[sizeof(LIBHAL_XKB_OPTIONS_KEY) - 1];
                         if (!strcasecmp(tmp, ".options") && (!xkb_opts.options))
                             xkb_opts.options = strdup(tmp_val);
                     }
-- 
1.6.0.6




More information about the xorg mailing list