[Pkg-privacy-commits] [libotr] 104/225: Inform the user at startup if debugging is available

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:45:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository libotr.

commit 176afffe7e25e739f64de04fcd2b1d01f723a9fd
Author: Ian Goldberg <iang at cs.uwaterloo.ca>
Date:   Fri Aug 24 15:05:40 2012 -0400

    Inform the user at startup if debugging is available
---
 src/message.c |  2 +-
 src/proto.c   | 10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/message.c b/src/message.c
index 4cdc7c6..b9a743d 100644
--- a/src/message.c
+++ b/src/message.c
@@ -40,7 +40,7 @@
 
 /* If OTRL_DEBUGGING is on, and the user types this string, the current
  * context and its siblings will be dumped to stderr. */
-#define OTRL_DEBUGGING_DEBUGSTR "?OTR!"
+const char *OTRL_DEBUGGING_DEBUGSTR = "?OTR!";
 
 void otrl_context_siblings_dump(FILE *f, const ConnContext *context);
 #endif
diff --git a/src/proto.c b/src/proto.c
index fc33081..3522249 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -38,6 +38,10 @@
 #include "tlv.h"
 #include "serial.h"
 
+#if OTRL_DEBUGGING
+extern const char *OTRL_DEBUGGING_DEBUGSTR;
+#endif
+
 /* For now, we need to know the API version the client is using so that
  * we don't use any UI callbacks it hasn't set. */
 unsigned int otrl_api_version = 0;
@@ -74,6 +78,12 @@ void otrl_init(unsigned int ver_major, unsigned int ver_minor,
 
     /* Initialize the SM module */
     otrl_sm_init();
+
+#if OTRL_DEBUGGING
+    /* Inform the user that debugging is available */
+    fprintf(stderr, "\nlibotr debugging is available.  Type %s in a message\n"
+	    "  to see debug info.\n\n", OTRL_DEBUGGING_DEBUGSTR);
+#endif
 }
 
 /* Return a pointer to a static string containing the version number of

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libotr.git



More information about the Pkg-privacy-commits mailing list