X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/mLib/blobdiff_plain/0875b58fcccadd756e11487185c2ac1d3ed8ab4d..800d4c590fc75ba21ae7b742fe11472cdc71d4a1:/track.h diff --git a/track.h b/track.h index fa50269..1792f2b 100644 --- a/track.h +++ b/track.h @@ -1,41 +1,34 @@ /* -*-c-*- * - * $Id: track.h,v 1.1 1998/06/17 23:44:42 mdw Exp $ + * $Id: track.h,v 1.6 2004/04/08 01:36:13 mdw Exp $ * * Tracing functions for debugging * * (c) 1998 Straylight/Edgeware */ -/*----- Licensing notice --------------------------------------------------* +/*----- Licensing notice --------------------------------------------------* * * This file is part of the mLib utilities library. * * mLib is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * + * it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * * mLib is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with mLib; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * GNU Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with mLib; if not, write to the Free + * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: track.h,v $ - * Revision 1.1 1998/06/17 23:44:42 mdw - * Initial revision - * - */ - -#ifndef TRACK_H -#define TRACK_H +#ifndef MLIB_TRACK_H +#define MLIB_TRACK_H #ifdef __cplusplus extern "C" { @@ -73,7 +66,7 @@ typedef struct track_ctx { /*----- Functions provided ------------------------------------------------*/ -/* --- @track_setLevel@ --- * +/* --- @track_level@ --- * * * Arguments: @unsigned int l@ = tracing level for allocation messages * @@ -82,9 +75,9 @@ typedef struct track_ctx { * Use: Sets the trace level for allocation messages. */ -extern void track_setLevel(unsigned int /*l*/); +extern void track_level(unsigned int /*l*/); -/* --- @track_pushContext@ --- * +/* --- @track_push@ --- * * * Arguments: @track_ctx *ctx@ = context holder to push * @@ -93,9 +86,9 @@ extern void track_setLevel(unsigned int /*l*/); * Use: Pushes the given context block onto the stack. */ -extern void track_pushContext(track_ctx */*ctx*/); +extern void track_push(track_ctx */*ctx*/); -/* --- @track_popContext@ --- * +/* --- @track_pop@ --- * * * Arguments: @track_ctx *ctx@ = context holder to pop * @@ -104,7 +97,7 @@ extern void track_pushContext(track_ctx */*ctx*/); * Use: Removes the given context block from the stack. */ -extern void track_popContext(track_ctx */*ctx*/); +extern void track_pop(track_ctx */*ctx*/); /* --- @track_malloc@ --- * * @@ -170,7 +163,6 @@ extern void track_list(unsigned int l); /*----- Macro wrappers ----------------------------------------------------*/ - /* --- If tracking is to be done, set it up --- */ #ifdef TRACK_ENABLE @@ -193,12 +185,12 @@ extern void track_list(unsigned int l); /* --- Handle contexts --- */ #if defined(TRACK_ENABLE) && defined(TRACK_BLAME) -# define TRACK_NCTX(name, string) track__context name = { 0, string } -# define TRACK_NPUSH(name) track_pushContext(name) -# define TRACK_NPOP(name) track_popContext(name) -# define TRACK_CTX(string) TRACK_NCTX(track__localContext, string) -# define TRACK_PUSH TRACK_NPUSH(track__localContext) -# define TRACK_POP TRACK_NPOP(track__localContext) +# define TRACK_NCTX(name, string) track_ctx name = { 0, string } +# define TRACK_NPUSH(name) track_push(name) +# define TRACK_NPOP(name) track_pop(name) +# define TRACK_CTX(string) TRACK_NCTX(__track_ctx, string) +# define TRACK_PUSH TRACK_NPUSH(__track_ctx) +# define TRACK_POP TRACK_NPOP(__track_ctx) #else # define TRACK_NCTX(name, string) # define TRACK_NPUSH(name) ((void)0)