home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
355_01
/
slk1.exe
/
SHERLOCK
/
SL1.H
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-09
|
7KB
|
293 lines
/*
Header file for Sherlock version 1 of the Sherlock macros.
source: sl1.h
started: September 27, 1985
version:
1.1 February 16, 1989
1.5 August 3, 1989
1.6 April 17, 1990
1.7 June 15, 1991
PUBLIC DOMAIN SOFTWARE
Sherlock, including the SPP, SDEL and SDIF programs, was placed in
the public domain on June 15, 1991, by its author,
Edward K. Ream
166 North Prospect Ave.
Madison, WI 53705.
(608) 257-0802
Sherlock may be used for any commercial or non-commercial purpose.
DISCLAIMER OF WARRANTIES
Edward K. Ream (Ream) specifically disclaims all warranties,
expressed or implied, with respect to this computer software,
including but not limited to implied warranties of merchantability
and fitness for a particular purpose. In no event shall Ream be
liable for any loss of profit or any commercial damage, including
but not limited to special, incidental consequential or other damages.
*/
#define SL_VERSION_NAME "1.6"
/*
NOTE 1: You must include this file (or sl.h) in every file that
contains any Sherlock macro. Do NOT use this file unless your
compiler absolutely can not handle the definitions in sl.h.
(See sl.h for more details.)
NOTE 2: If you want the sherlock macros to be enabled, you must
define the SHERLOCK symbol BEFORE including this file.
NOTE 3: This file uses functions prototypes from the new ANSI standard.
When older compilers, undefine HAS_ANSI_PROTOTYPES.
*/
#define HAS_ANSI_PROTOTYPES 1
/* Synonyms. */
#define LEAVE TICKX
#define ENTER TICKB
#define ENTER_TRACE TRACEPB
/* Always define these. */
#define SL_DISABLE()
#define SL_ENABLE()
#ifdef SHERLOCK
/* Macros common to version 1 and version 2. */
#define SL_CLEAR() sl_clear()
#define SL_DUMP() sl_dump()
#define SL_INIT() sl_init(SL_VERSION_NAME)
#define SL_NAME(a,b) static char a [] = b
#define SL_OFF(s) sl_off(s)
#define SL_ON(s) sl_on(s)
#define SL_PARSE(argc,argv,on,off) sl_parse(&argc,argv,on,off)
/*
Note: Routines that exit from a nesting level do NOT need a handle
parameter because the call_stack provides it.
*/
/* Make SURE that the expression is evaluated exactly once. */
#define RETURN_BOOL(a,b) return sl_xb(a,b)
#define RETURN_CHAR(a,c) return sl_xc(a,c)
#define RETURN_DOUBLE(a,d) return sl_xd(a,d)
/* Floats are passed as doubles. */
#define RETURN_FLOAT(a,f) return sl_xd(a,f)
#define RETURN_INT(a,i) return sl_xi(a,(int)i)
#define RETURN_LONG(a,l) return sl_xl(a,l)
#define RETURN_PTR(a,p) return sl_xp(a,p)
#define RETURN_STRING(a,s) return sl_xs(a,s)
#define RETURN_UINT(a,ui) return sl_xui(a,ui)
#define RETURN_ULONG(a,ul) return sl_xul(a,ul)
#define RETURN_VOID(a) {sl_xv(a); return;}
#define STATX(a) sl_xtrace(a); /* Ignore the return code. */
#define TICKX(a) sl_x(a)
#define TICKX_BOOL(a,b) sl_xb(a,b)
#define TICKX_CHAR(a,c) sl_xc(a,c)
#define TICKX_DOUBLE(a,d) sl_xd(a,d)
#define TICKX_FLOAT(a,f) sl_xf(a,f)
#define TICKX_INT(a,i) sl_xi(a,i)
#define TICKX_LONG(a,l) sl_xl(a,l)
#define TICKX_PTR(a,p) sl_xp(a,p)
#define TICKX_STRING(a,s) sl_xs(a,s)
#define TICKX_UINT(a,u) sl_xui(a,u)
#define TICKX_ULONG(a,u) sl_xul(a,u)
#define TICKX_VOID(a) sl_xv(a)
#define TRACEX(a,b) if(sl_xtrace(a)) {b;}
#define TRACEPX(a,b) if(sl_pxtrace(a)) {b;}
/* Macros for routines which are unique to version 1. */
#define STAT(a) sl1stat(a)
#define STATB(a) sl1bstat(a)
#define TICK(a) sl1tick(a)
#define TICKB(a) sl1btick(a)
#define TICKN(a) sl1ntick(a)
#define TRACE(a,b) if(sl1trace(a)) {b;}
#define TRACEB(a,b) if(sl1btrace(a)) {b;}
#define TRACEN(a,b) if(sl1ntrace(a)) {b;}
#define TRACEP(a,b) if(sl1ptrace(a)) {b;}
#define TRACEPB(a,b) if(sl1pbtrace(a)) {b;}
#define TRACEPN(a,b) if(sl1pntrace(a)) {b;}
/*
Function prototypes.
*/
#ifdef HAS_ANSI_PROTOTYPES
/* Routines common to Version 1 and Version 2. */
void sl_dump (void);
void sl_init (char *);
void sl_off (char *);
void sl_on (char *);
void sl_parse (int *,char **,char *,char *);
int sl_pxtrace (char *); /* TRACEPX */
void sl_x (char *); /* TICKX */
char sl_xc (char *,char);
double sl_xd (char *,double);
float sl_xf (char *,float);
int sl_xi (char *,int);
long sl_xl (char *,long);
void * sl_xp (char *,void *);
char * sl_xs (char *,char *);
int sl_xtrace (char *); /* TRACEX */
unsigned int sl_xui (char *,unsigned int);
unsigned long sl_xul (char *,unsigned long);
void sl_xv (char *);
void sl_bout (int);
void sl_cout (char);
void sl_dout (double);
void sl_fout (double); /* Floats are passed as doubles. */
void sl_iout (int);
void sl_lout (long);
void sl_pout (void *);
char * sl_sbout(int);
void sl_sout (char *);
void sl_uiout(unsigned int);
void sl_ulout(unsigned long);
void sl_csout(void);
void sl_lpout(void);
void sl_rpout(void);
/* Version 1 routines. */
void sl1bstat (char *);
void sl1btick (char *);
int sl1btrace (char *);
void sl1ntick (char *);
int sl1ntrace (char *);
int sl1pbtrace (char *);
int sl1pntrace (char *);
int sl1ptrace (char *);
void sl1stat (char *);
void sl1tick (char *);
int sl1trace (char *);
#else
void sl_dump();
void sl_init();
void sl_off();
void sl_on();
void sl_parse();
int sl_pxtrace(); /* TRACEPX */
void sl_x(); /* TICKX */
char sl_xc();
double sl_xd();
float sl_xf();
int sl_xi();
long sl_xl();
void * sl_xp();
char * sl_xs();
int sl_xtrace(); /* TRACEX */
unsigned int sl_xui();
unsigned long sl_xul();
void sl_xv();
void sl_bout();
void sl_cout();
void sl_dout();
void sl_fout();
void sl_iout();
void sl_lout();
void sl_pout();
char * sl_sbout();
void sl_sout();
void sl_uiout();
void sl_ulout();
void sl_csout(void);
void sl_lpout(void);
void sl_rpout(void);
void sl1bstat();
void sl1btick();
int sl1btrace();
void sl1ntick();
int sl1ntrace();
int sl1pbtrace();
int sl1pntrace();
int sl1ptrace();
void sl1stat();
void sl1tick();
int sl1trace();
#endif /* HAS_ANSI_PROTOTYPES */
#else
/*
Null macro definitions for all Sherlock macros.
*/
#define RETURN_BOOL(a,b) return b
#define RETURN_CHAR(a,c) return c
#define RETURN_DOUBLE(a,d) return d
#define RETURN_FLOAT(a,f) return f
#define RETURN_INT(a,i) return i
#define RETURN_LONG(a,l) return l
#define RETURN_PTR(a,p) return p
#define RETURN_STRING(a,s) return s
#define RETURN_UINT(a,u) return u
#define RETURN_ULONG(a,u) return u
#define RETURN_VOID(a) return
#define SL_CLEAR()
#define SL_DUMP()
#define SL_INIT()
#define SL_NAME(a,b)
#define SL_OFF(s)
#define SL_ON(s)
#define SL_PARSE(argc,argv,on,off)
#define STAT(a)
#define STATB(a)
#define STATX(a)
#define TICK(a)
#define TICKB(a)
#define TICKN(a)
#define TICKX(a)
#define TICKX_BOOL(a,b)
#define TICKX_CHAR(a,c)
#define TICKX_DOUBLE(a,d)
#define TICKX_FLOAT(a,f)
#define TICKX_INT(a,i)
#define TICKX_LONG(a,l)
#define TICKX_PTR(a,p)
#define TICKX_STRING(a,s)
#define TICKX_UINT(a,u)
#define TICKX_ULONG(a,u)
#define TICKX_VOID(a)
#define TRACE(a,b)
#define TRACEB(a,b)
#define TRACEN(a,b)
#define TRACEX(a,b)
#define TRACEP(a,b)
#define TRACEPB(a,b)
#define TRACEPN(a,b)
#define TRACEPX(a,b)
#endif /* ifdef SHERLOCK */