File: leakbug_8h-source.html

package info (click to toggle)
leakbug 0.1.5-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 1,120 kB
  • ctags: 80
  • sloc: sh: 6,935; ansic: 380; makefile: 137
file content (83 lines) | stat: -rw-r--r-- 7,224 bytes parent folder | download | duplicates (2)
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
<!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>
<!-- Generated by Doxygen 1.2.15-20020430 -->
<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 <span class="preprocessor">#ifndef _LEAKBUG_H_</span>
00024 <span class="preprocessor"></span><span class="preprocessor">#define _LEAKBUG_H_</span>
00025 <span class="preprocessor"></span>
00026 <span class="comment">/*</span>
00027 <span class="comment"> * We should include these now, so that we can #undef the functions in</span>
00028 <span class="comment"> * this file.</span>
00029 <span class="comment"> */</span>
00030 <span class="preprocessor">#include &lt;string.h&gt;</span>
00031 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
00032 
00033 <span class="preprocessor">#ifdef __cplusplus</span>
00034 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
00035 <span class="preprocessor">#endif</span>
00036 <span class="preprocessor"></span>
00049 <span class="keywordtype">void</span> *<a class="code" href="leakbug_8h.html#a3">lbMalloc</a>(size_t size, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">int</span> line, <span class="keywordtype">int</span> debug_level);
00050 
00064 <span class="keywordtype">void</span> *<a class="code" href="leakbug_8h.html#a4">lbCalloc</a>(size_t nmemb, size_t size, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">int</span> line,
00065                <span class="keywordtype">int</span> debug_level);
00066 
00080 <span class="keywordtype">void</span> *<a class="code" href="leakbug_8h.html#a5">lbRealloc</a>(<span class="keywordtype">void</span> *data, size_t size, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">int</span> line,
00081                 <span class="keywordtype">int</span> debug_level);
00082 
00093 <span class="keywordtype">void</span> <a class="code" href="leakbug_8h.html#a6">lbFree</a>(<span class="keywordtype">void</span> *ptr, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename, <span class="keywordtype">int</span> line, <span class="keywordtype">int</span> debug_level);
00094 
00126 <span class="keywordtype">void</span> *<a class="code" href="leakbug_8h.html#a7">lbRegister</a>(<span class="keywordtype">void</span> *ptr, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dataSize, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename,
00127                  <span class="keywordtype">int</span> line, <span class="keywordtype">int</span> debug_level);
00128 
00162 <span class="keywordtype">void</span> **<a class="code" href="leakbug_8h.html#a8">lbRegisterArray</a>(<span class="keywordtype">void</span> **ptr, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> dataSize,
00163                        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> numElements, <span class="keyword">const</span> <span class="keywordtype">char</span> *filename,
00164                        <span class="keywordtype">int</span> line, <span class="keywordtype">int</span> debug_level);
00165 
00172 <span class="keywordtype">void</span> <a class="code" href="leakbug_8h.html#a9">lbFreeLeaks</a>(<span class="keywordtype">void</span>);
00173 
00177 <span class="keywordtype">void</span> <a class="code" href="leakbug_8h.html#a10">lbDumpLeaks</a>(<span class="keywordtype">void</span>);
00178 
00183 <span class="preprocessor">#define LEAKBUG_SILENT   0  </span>
<a name="l00184"></a><a class="code" href="leakbug_8h.html#a0">00184</a> <span class="preprocessor">#define LEAKBUG_WARNINGS 1  </span>
<a name="l00185"></a><a class="code" href="leakbug_8h.html#a1">00185</a> <span class="preprocessor">#define LEAKBUG_ERRORS   2  </span>
00187 <span class="preprocessor"></span>
00188 <span class="preprocessor"></span><span class="preprocessor">#ifndef _DOXYGEN_</span>
00189 <span class="preprocessor"></span><span class="preprocessor"># ifndef LEAKBUG_NO_DEBUG</span>
00190 <span class="preprocessor"></span><span class="preprocessor">#  ifndef LEAKBUG_DEBUG_LEVEL</span>
00191 <span class="preprocessor"></span><span class="preprocessor">#   define LEAKBUG_DEBUG_LEVEL (LEAKBUG_WARNINGS | LEAKBUG_ERRORS)</span>
00192 <span class="preprocessor"></span><span class="preprocessor">#  endif</span>
00193 <span class="preprocessor"></span>
00194 <span class="preprocessor">#  undef malloc</span>
00195 <span class="preprocessor"></span><span class="preprocessor">#  undef calloc</span>
00196 <span class="preprocessor"></span><span class="preprocessor">#  undef realloc</span>
00197 <span class="preprocessor"></span><span class="preprocessor">#  undef free</span>
00198 <span class="preprocessor"></span><span class="preprocessor">#  undef strdup</span>
00199 <span class="preprocessor"></span>
00200 <span class="preprocessor">#  define malloc(x) lbMalloc((x),  __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</span>
00201 <span class="preprocessor"></span><span class="preprocessor">#  define calloc(n, x) \</span>
00202 <span class="preprocessor">    lbCalloc((n), (x), __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</span>
00203 <span class="preprocessor"></span><span class="preprocessor">#  define realloc(d, x) \</span>
00204 <span class="preprocessor">    lbRealloc((d), (x), __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</span>
00205 <span class="preprocessor"></span><span class="preprocessor">#  define free(x)   lbFree((x),    __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</span>
00206 <span class="preprocessor"></span>
00207 <span class="preprocessor">#  define strdup(x) lbRegister(strdup(x), (strlen(x) + 1) * sizeof(char), \</span>
00208 <span class="preprocessor">                               __FILE__, __LINE__, LEAKBUG_DEBUG_LEVEL)</span>
00209 <span class="preprocessor"></span><span class="preprocessor"># endif </span><span class="comment">/* !LEAKBUG_NO_DEBUG */</span>
00210 <span class="preprocessor">#endif</span>
00211 <span class="preprocessor"></span>
00212 <span class="preprocessor">#ifdef __cplusplus</span>
00213 <span class="preprocessor"></span>}
00214 <span class="preprocessor">#endif</span>
00215 <span class="preprocessor"></span>
00216 <span class="preprocessor">#endif </span><span class="comment">/* _LEAKBUG_H_ */</span>
</pre></div><hr><address style="align: right;"><small>Generated on Mon Jul 1 21:01:00 2002 for leakbug by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15-20020430 </small></address>
</body>
</html>