Skip to content

Commit

Permalink
moved all exported symbols into malloc.c
Browse files Browse the repository at this point in the history
  • Loading branch information
gray committed May 19, 2003
1 parent 0ab897c commit 19f8b4a
Show file tree
Hide file tree
Showing 4 changed files with 768 additions and 76 deletions.
38 changes: 3 additions & 35 deletions error.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The author may be contacted via http://dmalloc.com/
*
* $Id: error.c,v 1.103 2003/05/16 04:09:13 gray Exp $
* $Id: error.c,v 1.104 2003/05/19 18:14:15 gray Exp $
*/

/*
Expand Down Expand Up @@ -93,11 +93,7 @@ extern const char *dmalloc_strerror(const int errnum);
/*
* exported variables
*/
/* internal dmalloc error number for reference purposes only */
int dmalloc_errno = ERROR_NONE;

/* logfile for dumping dmalloc info, DMALLOC_LOGFILE env var overrides this */
char *dmalloc_logpath = NULL;
/* address to look for. when discovered call dmalloc_error() */
DMALLOC_PNT _dmalloc_address = NULL;
/* when to stop at an address */
Expand Down Expand Up @@ -349,7 +345,7 @@ char *_dmalloc_ptime(const TIME_TYPE *time_p, char *buf, const int buf_size,
#endif

/*
* void dmalloc_vmessage
* void _dmalloc_vmessage
*
* DESCRIPTION:
*
Expand All @@ -366,7 +362,7 @@ char *_dmalloc_ptime(const TIME_TYPE *time_p, char *buf, const int buf_size,
*
* args -> Already converted pointer to a stdarg list.
*/
void dmalloc_vmessage(const char *format, va_list args)
void _dmalloc_vmessage(const char *format, va_list args)
{
char str[1024], *str_p, *bounds_p;
int len;
Expand Down Expand Up @@ -439,34 +435,6 @@ void dmalloc_vmessage(const char *format, va_list args)
}
}

/*
* void dmalloc_message
*
* DESCRIPTION:
*
* Message writer with printf like arguments which adds a line to the
* dmalloc logfile.
*
* RETURNS:
*
* None.
*
* ARGUMENTS:
*
* format -> Printf-style format statement.
*
* ... -> Variable argument list.
*/
void dmalloc_message(const char *format, ...)
/* __attribute__ ((format (printf, 1, 2))) */
{
va_list args;

va_start(args, format);
dmalloc_vmessage(format, args);
va_end(args);
}

/*
* void _dmalloc_die
*
Expand Down
39 changes: 3 additions & 36 deletions error.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The author may be contacted via http://dmalloc.com/
*
* $Id: error.h,v 1.51 2003/05/16 04:09:13 gray Exp $
* $Id: error.h,v 1.52 2003/05/19 18:14:16 gray Exp $
*/

#ifndef __ERROR_H__
Expand All @@ -44,14 +44,6 @@

/*<<<<<<<<<< The below prototypes are auto-generated by fillproto */

/* internal dmalloc error number for reference purposes only */
extern
int dmalloc_errno;

/* logfile for dumping dmalloc info, DMALLOC_LOGFILE env var overrides this */
extern
char *dmalloc_logpath;

/* address to look for. when discovered call dmalloc_error() */
extern
DMALLOC_PNT _dmalloc_address;
Expand Down Expand Up @@ -188,7 +180,7 @@ char *_dmalloc_ptime(const TIME_TYPE *time_p, char *buf, const int buf_size,
#endif /* if STORE_TIMEVAL == 0 && HAVE_TIME */

/*
* void dmalloc_vmessage
* void _dmalloc_vmessage
*
* DESCRIPTION:
*
Expand All @@ -206,32 +198,7 @@ char *_dmalloc_ptime(const TIME_TYPE *time_p, char *buf, const int buf_size,
* args -> Already converted pointer to a stdarg list.
*/
extern
void dmalloc_vmessage(const char *format, va_list args);

/*
* void dmalloc_message
*
* DESCRIPTION:
*
* Message writer with printf like arguments which adds a line to the
* dmalloc logfile.
*
* RETURNS:
*
* None.
*
* ARGUMENTS:
*
* format -> Printf-style format statement.
*
* ... -> Variable argument list.
*/
extern
void dmalloc_message(const char *format, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
#endif
;
void _dmalloc_vmessage(const char *format, va_list args);

/*
* void _dmalloc_die
Expand Down
67 changes: 62 additions & 5 deletions malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*
* The author may be contacted via http://dmalloc.com/
*
* $Id: malloc.c,v 1.163 2003/05/16 04:09:12 gray Exp $
* $Id: malloc.c,v 1.164 2003/05/19 18:14:16 gray Exp $
*/

/*
Expand Down Expand Up @@ -88,6 +88,14 @@ static char *information = "@(#) $Information: lock-threads is enabled $"
#endif
#endif

/* exported variables */

/* internal dmalloc error number for reference purposes only */
int dmalloc_errno = ERROR_NONE;

/* logfile for dumping dmalloc info, DMALLOC_LOGFILE env var overrides this */
char *dmalloc_logpath = NULL;

/* local variables */
static int enabled_b = 0; /* have we started yet? */
static int in_alloc_b = 0; /* can't be here twice */
Expand Down Expand Up @@ -1314,10 +1322,8 @@ int malloc_verify(const DMALLOC_PNT pnt)
* Set the global debug functionality flags. You can also use
* dmalloc_debug_setup.
*
* Note: you cannot remove certain flags such as signal handlers since
* they are setup at initialization time only. Also you cannot add
* certain flags such as free-space checking since they must be on
* from the start.
* Note: you cannot add or remove certain flags such as signal
* handlers since they are setup at initialization time only.
*
* RETURNS:
*
Expand Down Expand Up @@ -1616,6 +1622,57 @@ void dmalloc_log_changed(const unsigned long mark, const int not_freed_b,
dmalloc_out();
}

/*
* void dmalloc_vmessage
*
* DESCRIPTION:
*
* Message writer with vprintf like arguments which adds a line to the
* dmalloc logfile.
*
* RETURNS:
*
* None.
*
* ARGUMENTS:
*
* format -> Printf-style format statement.
*
* args -> Already converted pointer to a stdarg list.
*/
void dmalloc_vmessage(const char *format, va_list args)
{
_dmalloc_vmessage(format, args);
}

/*
* void dmalloc_message
*
* DESCRIPTION:
*
* Message writer with printf like arguments which adds a line to the
* dmalloc logfile.
*
* RETURNS:
*
* None.
*
* ARGUMENTS:
*
* format -> Printf-style format statement.
*
* ... -> Variable argument list.
*/
void dmalloc_message(const char *format, ...)
/* __attribute__ ((format (printf, 1, 2))) */
{
va_list args;

va_start(args, format);
_dmalloc_vmessage(format, args);
va_end(args);
}

/*
* const char *dmalloc_strerror
*
Expand Down
Loading

0 comments on commit 19f8b4a

Please sign in to comment.