>From 15c054b680e07a2774b2f7fab500ac7768ac8283 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
Date: Fri, 16 Jan 2015 13:36:12 +0100
Subject: [PATCH 4/5] IFP: simplify object path constant names

The number of interfaces will grow and in order to keep names of
object path constant consistent it means that also their names
will grow. The new naming schema is:

/org/freedesktop/sssd/infopipe -> IFP_PATH_
/ -> _
everything uppercase

Example:
/org/freedesktop/sssd/infopipe/Components/Responders
-> IFP_PATH_COMPONENTS_RESPONDERS

If the path contains a _TREE suffix, it represents the whole
subtree. For example:
IFP_PATH_DOMAINS_TREE is /org/freedesktop/sssd/infopipe/Domains/*
---
 src/responder/ifp/ifp_components.c | 6 +++---
 src/responder/ifp/ifp_components.h | 6 ++----
 src/responder/ifp/ifp_domains.c    | 8 ++++----
 src/responder/ifp/ifp_domains.h    | 4 ++--
 src/responder/ifp/ifp_iface.c      | 6 +++---
 src/responder/ifp/ifp_private.h    | 2 +-
 6 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/src/responder/ifp/ifp_components.c b/src/responder/ifp/ifp_components.c
index 3d700f92e118f0ae39c44165c4a65c1302e1f220..b143d1e4fd99b55fa5d68f063957e54792992e9c 100644
--- a/src/responder/ifp/ifp_components.c
+++ b/src/responder/ifp/ifp_components.c
@@ -34,9 +34,9 @@
 #include "util/sss_config.h"
 #endif
 
-#define PATH_MONITOR    INFOPIPE_COMPONENT_PATH_PFX "/monitor"
-#define PATH_RESPONDERS INFOPIPE_COMPONENT_PATH_PFX "/Responders"
-#define PATH_BACKENDS   INFOPIPE_COMPONENT_PATH_PFX "/Backends"
+#define PATH_MONITOR    IFP_PATH_COMPONENTS "/monitor"
+#define PATH_RESPONDERS IFP_PATH_COMPONENTS "/Responders"
+#define PATH_BACKENDS   IFP_PATH_COMPONENTS "/Backends"
 
 enum component_type {
     COMPONENT_MONITOR,
diff --git a/src/responder/ifp/ifp_components.h b/src/responder/ifp/ifp_components.h
index 6c6300442762c083e53b5be524d706d0dcf508d4..d62585c0adbb7c942485029cba448cd93fe3134a 100644
--- a/src/responder/ifp/ifp_components.h
+++ b/src/responder/ifp/ifp_components.h
@@ -24,10 +24,8 @@
 #include "responder/ifp/ifp_iface_generated.h"
 #include "responder/ifp/ifp_private.h"
 
-#define INFOPIPE_COMPONENT_PATH_PFX "/org/freedesktop/sssd/infopipe/Components"
-#define INFOPIPE_COMPONENT_PATH INFOPIPE_COMPONENT_PATH_PFX "/*"
-
-#define INFOPIPE_BACKEND_PATH INFOPIPE_COMPONENT_PATH_PFX "/Backends*"
+#define IFP_PATH_COMPONENTS IFP_PATH "/Components"
+#define IFP_PATH_COMPONENTS_TREE IFP_PATH_COMPONENTS "/*"
 
 /* org.freedesktop.sssd.infopipe */
 
diff --git a/src/responder/ifp/ifp_domains.c b/src/responder/ifp/ifp_domains.c
index b9c2c77975f491ef6f7d9da07d35d180687eb5ab..36057668752181f02f497a2471d6aa02aada8214 100644
--- a/src/responder/ifp/ifp_domains.c
+++ b/src/responder/ifp/ifp_domains.c
@@ -125,7 +125,7 @@ static void ifp_list_domains_process(struct tevent_req *req)
     for (dom = ireq->ifp_ctx->rctx->domains;
             dom != NULL;
             dom = get_next_domain(dom, true)) {
-        p = sbus_opath_compose(ireq, INFOPIPE_DOMAIN_PATH_PFX, dom->name);
+        p = sbus_opath_compose(ireq, IFP_PATH_DOMAINS, dom->name);
         if (p == NULL) {
             DEBUG(SSSDBG_MINOR_FAILURE,
                   "Could not create path for dom %s, skipping\n", dom->name);
@@ -234,7 +234,7 @@ static void ifp_find_domain_by_name_process(struct tevent_req *req)
         return;
     }
 
-    path = sbus_opath_compose(ireq, INFOPIPE_DOMAIN_PATH_PFX, iter->name);
+    path = sbus_opath_compose(ireq, IFP_PATH_DOMAINS, iter->name);
     if (path == NULL) {
         DEBUG(SSSDBG_MINOR_FAILURE,
                 "Could not create path for domain %s, skipping\n", iter->name);
@@ -263,7 +263,7 @@ get_domain_info_from_req(struct sbus_request *dbus_req, void *data)
     }
 
     name = sbus_opath_get_object_name(dbus_req, dbus_req->path,
-                                      INFOPIPE_DOMAIN_PATH_PFX);
+                                      IFP_PATH_DOMAINS);
     if (name == NULL) {
         return NULL;
     }
@@ -530,6 +530,6 @@ void ifp_dom_get_parent_domain(struct sbus_request *dbus_req,
         return;
     }
 
-    *_out = sbus_opath_compose(dbus_req, INFOPIPE_DOMAIN_PATH_PFX,
+    *_out = sbus_opath_compose(dbus_req, IFP_PATH_DOMAINS,
                                dom->parent->name);
 }
diff --git a/src/responder/ifp/ifp_domains.h b/src/responder/ifp/ifp_domains.h
index d6ed6c73deb47a78775424afa28915b38d358777..7ec571dcf59b48e494eb998451ad02ba2a9580ff 100644
--- a/src/responder/ifp/ifp_domains.h
+++ b/src/responder/ifp/ifp_domains.h
@@ -25,8 +25,8 @@
 #include "responder/ifp/ifp_iface_generated.h"
 #include "responder/ifp/ifp_private.h"
 
-#define INFOPIPE_DOMAIN_PATH_PFX "/org/freedesktop/sssd/infopipe/Domains"
-#define INFOPIPE_DOMAIN_PATH     INFOPIPE_DOMAIN_PATH_PFX"/*"
+#define IFP_PATH_DOMAINS IFP_PATH "/Domains"
+#define IFP_PATH_DOMAINS_TREE IFP_PATH_DOMAINS "/*"
 
 /* org.freedesktop.sssd.infopipe */
 
diff --git a/src/responder/ifp/ifp_iface.c b/src/responder/ifp/ifp_iface.c
index ffa3c46b7eeea12b7d56f928d85412f096fa6273..c82a2e65df54997ca7d003ccc9a3a0a0037edd90 100644
--- a/src/responder/ifp/ifp_iface.c
+++ b/src/responder/ifp/ifp_iface.c
@@ -82,9 +82,9 @@ struct iface_map {
 };
 
 static struct iface_map iface_map[] = {
-    { INFOPIPE_PATH, &iface_ifp.vtable },
-    { INFOPIPE_DOMAIN_PATH, &iface_ifp_domains.vtable },
-    { INFOPIPE_COMPONENT_PATH, &iface_ifp_components.vtable },
+    { IFP_PATH, &iface_ifp.vtable },
+    { IFP_PATH_DOMAINS_TREE, &iface_ifp_domains.vtable },
+    { IFP_PATH_COMPONENTS_TREE, &iface_ifp_components.vtable },
     { NULL, NULL },
 };
 
diff --git a/src/responder/ifp/ifp_private.h b/src/responder/ifp/ifp_private.h
index 96ccb41e4c0ea081951035d11c93712db86fb5a1..f76655fa163346a97bac05577ae333309d4daf22 100644
--- a/src/responder/ifp/ifp_private.h
+++ b/src/responder/ifp/ifp_private.h
@@ -29,7 +29,7 @@
 #include "providers/data_provider.h"
 #include "responder/ifp/ifp_iface_generated.h"
 
-#define INFOPIPE_PATH "/org/freedesktop/sssd/infopipe"
+#define IFP_PATH "/org/freedesktop/sssd/infopipe"
 
 struct sysbus_ctx {
     struct sbus_connection *conn;
-- 
1.9.3

