Commit 176afffe authored by Ian Goldberg's avatar Ian Goldberg
Browse files

Inform the user at startup if debugging is available

parent edf738fa
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
/* If OTRL_DEBUGGING is on, and the user types this string, the current /* If OTRL_DEBUGGING is on, and the user types this string, the current
* context and its siblings will be dumped to stderr. */ * 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); void otrl_context_siblings_dump(FILE *f, const ConnContext *context);
#endif #endif
......
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
#include "tlv.h" #include "tlv.h"
#include "serial.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 /* 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. */ * we don't use any UI callbacks it hasn't set. */
unsigned int otrl_api_version = 0; unsigned int otrl_api_version = 0;
...@@ -74,6 +78,12 @@ void otrl_init(unsigned int ver_major, unsigned int ver_minor, ...@@ -74,6 +78,12 @@ void otrl_init(unsigned int ver_major, unsigned int ver_minor,
/* Initialize the SM module */ /* Initialize the SM module */
otrl_sm_init(); 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 /* Return a pointer to a static string containing the version number of
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment