Skip to content
Snippets Groups Projects
Commit bf8204c8 authored by edgrif's avatar edgrif
Browse files

add code to support turning on/off debug messages.

parent 82369f8c
No related branches found
No related tags found
No related merge requests found
......@@ -29,9 +29,9 @@
*
* Exported functions: See ZMap/zmapXRemote.h (this file)
* HISTORY:
* Last edited: Jan 17 09:10 2010 (edgrif)
* Last edited: Mar 2 10:44 2010 (edgrif)
* Created: Wed Apr 13 19:02:52 2005 (rds)
* CVS info: $Id: zmapXRemote.h,v 1.23 2010-01-18 09:02:50 edgrif Exp $
* CVS info: $Id: zmapXRemote.h,v 1.24 2010-03-03 11:01:21 edgrif Exp $
*-------------------------------------------------------------------
*/
......@@ -52,10 +52,10 @@
/* These are here just to allow checking */
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
#define ZMAP_XREMOTE_CURRENT_VERSION "$Revision: 1.23 $"
#define ZMAP_XREMOTE_CURRENT_VERSION "$Revision: 1.24 $"
#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */
#define ZMAP_XREMOTE_CURRENT_VERSION "$Revision: 1.23 $"
#define ZMAP_XREMOTE_CURRENT_VERSION "$Revision: 1.24 $"
#define ZMAP_XREMOTE_CURRENT_VERSION_ATOM "_ZMAP_XREMOTE_VERSION"
#define ZMAP_XREMOTE_APPLICATION_ATOM "_ZMAP_XREMOTE_APP"
......@@ -155,6 +155,9 @@ extern gboolean externalPerl;
/* ================================================ */
/* COMMON MODE METHODS */
/* ================================================ */
void zMapXRemoteSetDebug(gboolean debug_on) ;
ZMapXRemoteObj zMapXRemoteNew(void); /* This just returns the object and checks XOpenDisplay(getenv(DISPLAY)) */
void zMapXRemoteSetRequestAtomName(ZMapXRemoteObj object, char *name); /* Better set in zMapXRemoteInitServer if Server though */
......
......@@ -26,15 +26,15 @@
*
* Exported functions: See ZMap/zmapXRemote.h
* HISTORY:
* Last edited: Feb 10 16:47 2010 (edgrif)
* Last edited: Mar 2 10:51 2010 (edgrif)
* Created: Wed Apr 13 19:04:48 2005 (rds)
* CVS info: $Id: zmapXRemote.c,v 1.44 2010-02-10 16:52:09 edgrif Exp $
* CVS info: $Id: zmapXRemote.c,v 1.45 2010-03-03 11:01:21 edgrif Exp $
*-------------------------------------------------------------------
*/
#include "zmapXRemote_P.h"
gboolean externalPerl = TRUE;
enum
{
......@@ -96,6 +96,33 @@ static void zmapXRemoteUnLock();
static gboolean zmapXRemoteIsLocked();
/* An external global which controls the two modes of the code
*
* - compiled into ZMap
*
* - compiled into a Perl module for otterlace to use.
*
*/
gboolean externalPerl = TRUE ;
/* Controls debugging output. */
static gboolean debug_G = FALSE ;
/* Can be called at any time and controls debugging for all instances of ZMapXRemoteObj,
* TRUE turns debugging on and FALSE turns it off again. */
void zMapXRemoteSetDebug(gboolean debug_on)
{
debug_G = debug_on ;
return ;
}
/*!
* \brief Create a ZMapXRemoteObj handle for later use
*
......
......@@ -26,9 +26,9 @@
*
* Exported functions: None
* HISTORY:
* Last edited: Feb 19 10:22 2010 (edgrif)
* Last edited: Mar 2 10:56 2010 (edgrif)
* Created: Thu Apr 14 13:07:51 2005 (rds)
* CVS info: $Id: zmapXRemote_P.h,v 1.20 2010-02-19 10:23:00 edgrif Exp $
* CVS info: $Id: zmapXRemote_P.h,v 1.21 2010-03-03 11:01:21 edgrif Exp $
*-------------------------------------------------------------------
*/
......@@ -73,31 +73,18 @@ typedef struct
/*====================== DEBUGGING =========================*/
#ifdef ED_G_NEVER_INCLUDE_THIS_CODE
#define DO_DEBUGGING
#endif /* ED_G_NEVER_INCLUDE_THIS_CODE */
#ifdef DO_DEBUGGING
extern char *ZMAP_X_PROGRAM_G ;
#define zmapXDebug(FORMAT, ...) \
G_STMT_START { \
g_printerr("[%s] [" ZMAP_MSG_FORMAT_STRING "] " FORMAT, \
ZMAP_X_PROGRAM_G, \
ZMAP_MSG_FUNCTION_MACRO, \
__VA_ARGS__) ; \
if (debug_G) \
g_printerr("[%s] [" ZMAP_MSG_FORMAT_STRING "] " FORMAT, \
ZMAP_X_PROGRAM_G, \
ZMAP_MSG_FUNCTION_MACRO, \
__VA_ARGS__) ; \
} G_STMT_END
#else
#define zmapXDebug(FORMAT, ...) do {} while(0)
#endif
/*==========================================================*/
......
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