1 /* 2 * debug.h -- 3 * 4 * Defines the interface to the debugging module. 5 * The debugging module provides a standard collection of 6 * procedures for setting, examining, and testing debugging flags. 7 * Also measurement code. 8 * 9 * ********************************************************************* 10 * * Copyright (C) 1985, 1990 Regents of the University of California. * 11 * * Permission to use, copy, modify, and distribute this * 12 * * software and its documentation for any purpose and without * 13 * * fee is hereby granted, provided that the above copyright * 14 * * notice appear in all copies. The University of California * 15 * * makes no representations about the suitability of this * 16 * * software for any purpose. It is provided "as is" without * 17 * * express or implied warranty. Export of this software outside * 18 * * of the United States of America may require an export license. * 19 * ********************************************************************* 20 * 21 * rcsid $Header: /usr/cvsroot/magic-8.0/debug/debug.h,v 1.1.1.1 2008/02/03 20:43:50 tim Exp $ 22 */ 23 24 #ifndef _DEBUG_H 25 #define _DEBUG_H 26 27 #include "utils/magic.h" 28 29 struct debugClient 30 { 31 char *dc_name; /* Name of client */ 32 int dc_maxflags; /* Maximum number of flags */ 33 int dc_nflags; /* Number flags now in array */ 34 struct debugFlag *dc_flags; /* Array of flags */ 35 }; 36 37 struct debugFlag 38 { 39 char *df_name; /* Name of debugging flag */ 40 bool df_value; /* Current value of the flag */ 41 }; 42 43 /* A histogram counts of the number of data items in each of 44 * a number of ranges. It is defined by a low value, a bin size, and 45 * the number of bins. Items falling in the range hi_lo..hi_lo+n*hi_step-1 46 * go into hi_data[n], for n=1 to the number of bins. Values outside the 47 * range are stored in locations 0 and n+1. 48 */ 49 typedef struct histogram 50 { 51 int hi_lo; /* Lowest bin value */ 52 int hi_step; /* Size of a bin */ 53 int hi_bins; /* Number of bins in histogram */ 54 int hi_max; /* Largest item in the histogram*/ 55 int hi_min; /* Smallest item in the histogram*/ 56 int hi_cum; /* Cumulative item total */ 57 char * hi_title; /* Histogram identifier */ 58 bool hi_ptrKeys; /* TRUE if title is a pointer */ 59 int * hi_data; /* Buckets for histogram counts */ 60 struct histogram * hi_next; /* Linked list to next histogram*/ 61 } Histogram; 62 63 /* constants */ 64 #define MAXDEBUGCLIENTS 50 /* Maximum # of clients of debug module */ 65 66 extern struct debugClient debugClients[]; 67 68 #define DebugIsSet(cid, f) debugClients[(spointertype) cid].dc_flags[f].df_value 69 70 /* procedures */ 71 extern void HistCreate(); 72 extern void HistAdd(); 73 extern void HistPrint(); 74 extern ClientData DebugAddClient(); 75 extern int DebugAddFlag(); 76 extern void DebugShow(), DebugSet(); 77 78 #endif /* _DEBUG_H */ 79