[gnome-keyring] [daemon] convert component names to macros



commit c56c229f532d83034e20387a206a2a298e8e7604
Author: Saleem Abdulrasool <compnerd compnerd org>
Date:   Sat Feb 20 09:43:36 2010 -0800

    [daemon] convert component names to macros

 daemon/gkd-main.c |   22 ++++++++++++++--------
 1 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/daemon/gkd-main.c b/daemon/gkd-main.c
index 97e1b7e..7781212 100644
--- a/daemon/gkd-main.c
+++ b/daemon/gkd-main.c
@@ -72,6 +72,12 @@
 #define socklen_t int
 #endif
 
+#define GKD_COMP_KEYRING    "keyring"
+#define GKD_COMP_PKCS11     "pkcs11"
+#define GKD_COMP_SECRETS    "secrets"
+#define GKD_COMP_SSH        "ssh"
+#define GKD_COMP_GPG        "gpg"
+
 /* -----------------------------------------------------------------------------
  * COMMAND LINE
  */
@@ -79,15 +85,15 @@
 /* All the components to run on startup if not specified on command line */
 #ifdef WITH_SSH
 #	ifdef WITH_GPG
-#		define DEFAULT_COMPONENTS  "pkcs11,secrets,ssh,gpg"
+#		define DEFAULT_COMPONENTS  GKD_COMP_PKCS11 "," GKD_COMP_SECRETS "," GKD_COMP_SSH "," GKD_COMP_GPG
 #	else
-#		define DEFAULT_COMPONENTS  "pkcs11,secrets,ssh"
+#		define DEFAULT_COMPONENTS  GKD_COMP_PKCS11 "," GKD_COMP_SECRETS "," GKD_COMP_SSH
 #	endif
 #else
 #	ifdef WITH_GPG
-#		define DEFAULT_COMPONENTS  "pkcs11,secrets,gpg"
+#		define DEFAULT_COMPONENTS  GKD_COMP_PKCS11 "," GKD_COMP_SECRETS  "," GKD_COMP_GPG
 #	else
-#		define DEFAULT_COMPONENTS  "pkcs11,secrets"
+#		define DEFAULT_COMPONENTS  GKD_COMP_PKCS11 "," GKD_COMP_SECRETS
 #	endif
 #endif
 
@@ -639,7 +645,7 @@ gkr_daemon_startup_steps (const gchar *components)
 	 */
 
 #ifdef WITH_SSH
-	if (strstr (components, "ssh")) {
+	if (strstr (components, GKD_COMP_SSH)) {
 		if (ssh_started) {
 			g_message ("The SSH agent was already initialized");
 		} else {
@@ -653,7 +659,7 @@ gkr_daemon_startup_steps (const gchar *components)
 #endif
 
 #ifdef WITH_GPG
-	if (strstr (components, "gpg")) {
+	if (strstr (components, GKD_COMP_GPG)) {
 		if (gpg_started) {
 			g_message ("The GPG agent was already initialized");
 		} else {
@@ -703,7 +709,7 @@ gkr_daemon_initialize_steps (const gchar *components)
 	}
 
 	/* The Secret Service API */
-	if (strstr (components, "secret") || strstr (components, "keyring")) {
+	if (strstr (components, GKD_COMP_SECRETS) || strstr (components, GKD_COMP_KEYRING)) {
 		if (secrets_started) {
 			g_message ("The Secret Service was already initialized");
 		} else {
@@ -716,7 +722,7 @@ gkr_daemon_initialize_steps (const gchar *components)
 	}
 
 	/* The PKCS#11 remoting */
-	if (strstr (components, "pkcs11")) {
+	if (strstr (components, GKD_COMP_PKCS11)) {
 		if (pkcs11_started) {
 			g_message ("The PKCS#11 component was already initialized");
 		} else {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]