Jabber WindowGram Client (JWGC)

Introduction Screenshots Installation Downloads
Documentation Browse Source Resources Project Site

Stable Version
-none-

Latest Version
beta5



Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

libjwgc_debug.h File Reference

#include "libjwgc_types.h"

Go to the source code of this file.

Defines

#define _LIBJWGC_DEBUG_H_   1

Typedefs

typedef enum dZones dZone

Enumerations

enum  dZones {
  dJWG, dParser, dJAB, dOutput,
  dEval, dPoll, dExecution, dVars,
  dMatch, dXML, dGPG, dNumZones
}

Functions

void dclear ()
void dflagon (dZone zone)
void dflagoff (dZone zone)
void dprintf (dZone zone, const char *msgfmt,...)
void dprinttypes ()
void dparseflags (char *flags)
char * dzoneitos (dZone zone)
dZone dzonestoi (char *zone)

Variables

int errno


Define Documentation

#define _LIBJWGC_DEBUG_H_   1
 

Definition at line 4 of file libjwgc_debug.h.


Typedef Documentation

typedef enum dZones dZone
 

Referenced by dinit(), dparseflags(), dprinttypes(), and dzonestoi().


Enumeration Type Documentation

enum dZones
 

Enumeration values:
dJWG 
dParser 
dJAB 
dOutput 
dEval 
dPoll 
dExecution 
dVars 
dMatch 
dXML 
dGPG 
dNumZones 

Definition at line 15 of file libjwgc_debug.h.

00015                     {
00016         dJWG,
00017         dParser,
00018         dJAB,
00019         dOutput,
00020         dEval,
00021         dPoll,
00022         dExecution,
00023         dVars,
00024         dMatch,
00025         dXML,
00026         dGPG,
00027         dNumZones
00028 } dZone;


Function Documentation

void dclear  ) 
 

void dflagoff dZone  zone  ) 
 

Definition at line 42 of file JDebug.c.

References debug_enabled.

Referenced by dparseflags().

00043 {
00044 #ifndef NODEBUG
00045         debug_enabled[zone] = 0;
00046 #endif /* NODEBUG */
00047 }

void dflagon dZone  zone  ) 
 

Definition at line 34 of file JDebug.c.

References debug_enabled.

Referenced by dparseflags().

00035 {
00036 #ifndef NODEBUG
00037         debug_enabled[zone] = 1;
00038 #endif /* NODEBUG */
00039 }

void dparseflags char *  flags  ) 
 

Definition at line 113 of file JDebug.c.

References debug_enabled, dflagoff(), dflagon(), dZone, dzonestoi(), and NULL.

Referenced by jwg_on_event_handler(), and main().

00114 {
00115 #ifndef NODEBUG
00116         char *ptr;
00117         int retval;
00118         dZone i;
00119 
00120         if (!flags) { return; }
00121 
00122         ptr = strtok(flags, ",");
00123         while (ptr != NULL) {
00124                 if (!strcmp(ptr, "-all")) {
00125                         for (i = 0; i < dNumZones; i++) {
00126                                 debug_enabled[i] = 0;
00127                         }
00128                 }
00129                 else if (!strcmp(ptr, "all")) {
00130                         for (i = 0; i < dNumZones; i++) {
00131                                 debug_enabled[i] = 1;
00132                         }
00133                 }
00134                 else {
00135                         if (*ptr == '-') {
00136                                 retval = dzonestoi(++ptr);
00137                                 if (retval != -1) {
00138                                         dflagoff(retval);
00139                                 }
00140                         }
00141                         else {
00142                                 retval = dzonestoi(ptr);
00143                                 if (retval != -1) {
00144                                         dflagon(retval);
00145                                 }
00146                         }
00147                 }
00148                 
00149                 ptr = strtok(NULL, ",");
00150         }
00151 #endif /* NODEBUG */
00152 }

void dprintf dZone  zone,
const char *  msgfmt,
  ...
 

Definition at line 50 of file JDebug.c.

References debug_enabled, and dzoneitos().

Referenced by check_live_jwgc(), contact_status_change(), decode_notice(), eval_expr(), find_match(), insert_into_agent_list(), insert_into_contact_list(), jab_auth(), jab_on_packet_handler(), jab_on_state_handler(), jab_recv(), jab_send(), jab_send_raw(), jabber_init(), jabutil_presnew(), jctl_on_event_handler(), jVars_init(), jVars_read_conf(), jVars_read_defaults(), jwg_on_event_handler(), jwg_recv(), jwg_send(), jwg_send_raw(), jwg_servrecv(), jwg_servsend(), jwg_servsend_raw(), jwgc_change_presence_event_handler(), list_contacts(), list_contacts_bygroup(), main(), mux_add_input_source(), mux_loop(), process_iq_error(), process_iq_result(), process_iq_set(), process_presence(), remove_from_contact_list(), run_initprogs(), str_clear_unprintable(), str_to_unicode(), trim_message(), tty_filter(), unicode_to_str(), update_contact_status(), x_get_input(), xode_from_file(), and xode_from_str().

00051 {
00052 #ifndef NODEBUG
00053         va_list ap;
00054 
00055         if (!debug_enabled[zone]) {
00056                 return;
00057         }
00058 
00059         va_start(ap, msgfmt);
00060         printf("[%s] ", dzoneitos(zone));
00061         vprintf(msgfmt, ap);
00062         va_end(ap);
00063 #endif /* NODEBUG */
00064 }

void dprinttypes  ) 
 

Definition at line 67 of file JDebug.c.

References debug_zones, and dZone.

Referenced by main().

00068 {
00069 #ifndef NODEBUG
00070         dZone i;
00071 
00072         fprintf(stderr, "\
00073 Debugging usage:\n\
00074   <flags> can contain any number of the following flags, separated by commas.\n\
00075   If you wish to use 'all' to enable all flags, and then disable a couple,\n\
00076   you can prepend the flag with a - (Ex: all,-poll,-eval).  The available\n\
00077   flags are as follows:\n\
00078 \n\
00079 ");
00080         for (i = 0; i < dNumZones; i++) {
00081                 printf("     %s\n", debug_zones[i]);
00082         }
00083 
00084         exit(1);
00085 #endif /* NODEBUG */
00086 }

char* dzoneitos dZone  zone  ) 
 

Definition at line 89 of file JDebug.c.

References debug_zones.

Referenced by dprintf().

00090 {
00091 #ifndef NODEBUG
00092         return debug_zones[zone];
00093 #endif /* NODEBUG */
00094 }

dZone dzonestoi char *  zone  ) 
 

Definition at line 97 of file JDebug.c.

References debug_zones, and dZone.

Referenced by dparseflags().

00098 {
00099 #ifndef NODEBUG
00100         dZone i;
00101 
00102         for (i = 0; i < dNumZones; i++) {
00103                 if (!strcmp(zone, debug_zones[i])) {
00104                         return i;
00105                 }
00106         }
00107 
00108         return -1;
00109 #endif /* NODEBUG */
00110 }


Variable Documentation

int errno
 

Referenced by create_file_append_port(), create_file_input_port(), create_file_output_port(), create_subprocess_port(), jwg_recv(), jwg_send(), jwg_servrecv(), jwg_servsend(), jwg_sockrecv(), jwg_sockselect(), jwg_socksend(), locate_file(), mux_loop(), str_to_unicode(), unicode_to_str(), and xode_from_file().



Last updated at Tue Dec 18 21:07:42 PST 2007. This site and project hosted by...SourceForge.net Logo

Source Perspective by Fisheye