/* --------------------------------------------------------------------- */ /* BEGIN COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ /* ** Copyright (c) 2008 by Richard Harter. ** ** Permission is hereby granted, free of charge, to any person ** obtaining a copy of this software and associated documentation ** files (the "Software"), to deal in the Software without ** restriction, including without limitation the rights to use, ** copy, modify, merge, publish, distribute, sublicense, and/or ** sell copies of the Software, and to permit persons to whom the ** Software is furnished to do so, subject to the following ** conditions: ** ** The above copyright notices and this permission notice shall be ** included in all copies or substantial portions of the ** Software. ** ** Derivative works shall include a notice that the software is a ** modified version of the copyrighted software. ** ** There is no guarantee that this software is useful for anything ** or that it is any way correct or of value. The author disclaims ** any responsibility for the consequences of using this software. ** */ /* --------------------------------------------------------------------- */ /* END COPYRIGHT AND LICENSE NOTICE */ /* --------------------------------------------------------------------- */ #include #include #include #include "trace.h" #define NTRACE 256 struct pc { char * ptr; int count; }; static struct pc ptrcount[NTRACE]; static int pos = NTRACE-1; static char * pgname; /* ** trace_init initializes the ptrcount array. It is not ** needed in implementations that set file statics to 0. */ void trace_init(char * progname) { int i; for (i=0;i= NTRACE) ? 0 : pos; } }