File: leakbug_8h-source.html

package info (click to toggle)
leakbug 0.1.4-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 948 kB
  • ctags: 71
  • sloc: sh: 6,642; ansic: 307; makefile: 135
file content (84 lines) | stat: -rw-r--r-- 7,296 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>leakbug.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.9.1 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>leakbug.h</h1><a href="leakbug_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 
00023 <font class="preprocessor">#ifndef _LEAKBUG_H_</font>
00024 <font class="preprocessor"></font><font class="preprocessor">#define _LEAKBUG_H_</font>
00025 <font class="preprocessor"></font>
00026 <font class="comment">/*</font>
00027 <font class="comment"> * We should include these now, so that we can #undef the functions in</font>
00028 <font class="comment"> * this file.</font>
00029 <font class="comment"> */</font>
00030 <font class="preprocessor">#include &lt;string.h&gt;</font>
00031 <font class="preprocessor">#include &lt;stdlib.h&gt;</font>
00032 
00033 <font class="preprocessor">#ifdef __cplusplus</font>
00034 <font class="preprocessor"></font><font class="keyword">extern</font> <font class="stringliteral">"C"</font> {
00035 <font class="preprocessor">#endif</font>
00036 <font class="preprocessor"></font>
00049 <font class="keywordtype">void</font> *<a class="code" href="leakbug_8h.html#a3">lbMalloc</a>(size_t size, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, <font class="keywordtype">int</font> line, <font class="keywordtype">int</font> debug_level);
00050 
00064 <font class="keywordtype">void</font> *<a class="code" href="leakbug_8h.html#a4">lbCalloc</a>(size_t nmemb, size_t size, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, <font class="keywordtype">int</font> line,
00065                <font class="keywordtype">int</font> debug_level);
00066 
00080 <font class="keywordtype">void</font> *<a class="code" href="leakbug_8h.html#a5">lbRealloc</a>(<font class="keywordtype">void</font> *data, size_t size, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, <font class="keywordtype">int</font> line,
00081                 <font class="keywordtype">int</font> debug_level);
00082 
00093 <font class="keywordtype">void</font> <a class="code" href="leakbug_8h.html#a6">lbFree</a>(<font class="keywordtype">void</font> *ptr, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename, <font class="keywordtype">int</font> line, <font class="keywordtype">int</font> debug_level);
00094 
00126 <font class="keywordtype">void</font> *<a class="code" href="leakbug_8h.html#a7">lbRegister</a>(<font class="keywordtype">void</font> *ptr, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> dataSize, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename,
00127                  <font class="keywordtype">int</font> line, <font class="keywordtype">int</font> debug_level);
00128 
00162 <font class="keywordtype">void</font> **<a class="code" href="leakbug_8h.html#a8">lbRegisterArray</a>(<font class="keywordtype">void</font> **ptr, <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> dataSize,
00163                        <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> numElements, <font class="keyword">const</font> <font class="keywordtype">char</font> *filename,
00164                        <font class="keywordtype">int</font> line, <font class="keywordtype">int</font> debug_level);
00165 
00172 <font class="keywordtype">void</font> <a class="code" href="leakbug_8h.html#a9">lbFreeLeaks</a>(<font class="keywordtype">void</font>);
00173 
00177 <font class="keywordtype">void</font> <a class="code" href="leakbug_8h.html#a10">lbDumpLeaks</a>(<font class="keywordtype">void</font>);
00178 
00183 <font class="preprocessor">#define LEAKBUG_SILENT   0  </font>
<a name="l00184"></a><a class="code" href="leakbug_8h.html#a0">00184</a> <font class="preprocessor">#define LEAKBUG_WARNINGS 1  </font>
<a name="l00185"></a><a class="code" href="leakbug_8h.html#a1">00185</a> <font class="preprocessor">#define LEAKBUG_ERRORS   2  </font>
00187 <font class="preprocessor"></font>
00188 <font class="preprocessor"></font><font class="preprocessor">#ifndef _DOXYGEN_</font>
00189 <font class="preprocessor"></font><font class="preprocessor"># ifndef LEAKBUG_NO_DEBUG</font>
00190 <font class="preprocessor"></font><font class="preprocessor">#  ifndef LEAKBUG_DEBUG_LEVEL</font>
00191 <font class="preprocessor"></font><font class="preprocessor">#   define LEAKBUG_DEBUG_LEVEL (LEAKBUG_WARNINGS | LEAKBUG_ERRORS)</font>
00192 <font class="preprocessor"></font><font class="preprocessor">#  endif</font>
00193 <font class="preprocessor"></font>
00194 <font class="preprocessor">#  undef malloc</font>
00195 <font class="preprocessor"></font><font class="preprocessor">#  undef calloc</font>
00196 <font class="preprocessor"></font><font class="preprocessor">#  undef realloc</font>
00197 <font class="preprocessor"></font><font class="preprocessor">#  undef free</font>
00198 <font class="preprocessor"></font><font class="preprocessor">#  undef strdup</font>
00199 <font class="preprocessor"></font>
00200 <font class="preprocessor">#  define malloc(x) lbMalloc((x),  __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</font>
00201 <font class="preprocessor"></font><font class="preprocessor">#  define calloc(n, x) \</font>
00202 <font class="preprocessor">    lbCalloc((n), (x), __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</font>
00203 <font class="preprocessor"></font><font class="preprocessor">#  define realloc(d, x) \</font>
00204 <font class="preprocessor">    lbRealloc((d), (x), __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</font>
00205 <font class="preprocessor"></font><font class="preprocessor">#  define free(x)   lbFree((x),    __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</font>
00206 <font class="preprocessor"></font>
00207 <font class="preprocessor">#  define strdup(x) lbRegister(strdup(x), (strlen(x) + 1) * sizeof(char), \</font>
00208 <font class="preprocessor">                               __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</font>
00209 <font class="preprocessor"></font><font class="preprocessor"># endif </font><font class="comment">/* !LEAKBUG_NO_DEBUG */</font>
00210 <font class="preprocessor">#endif</font>
00211 <font class="preprocessor"></font>
00212 <font class="preprocessor">#ifdef __cplusplus</font>
00213 <font class="preprocessor"></font>}
00214 <font class="preprocessor">#endif</font>
00215 <font class="preprocessor"></font>
00216 <font class="preprocessor">#endif </font><font class="comment">/* _LEAKBUG_H_ */</font>
</pre></div><hr><address><small>Generated at Mon Aug 13 10:45:11 2001 for leakbug by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.9.1 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2001</small></address>
</body>
</html>