summaryrefslogtreecommitdiff
path: root/yajl-2.1.0/yajl__common_8h_source.html
blob: d25b28373e18a1e75b116328a2b04356cc637218 (plain)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>YAJL: yajl_common.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">YAJL
   &#160;<span id="projectnumber">2.1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_da61e3e9a357748887e3ca8d7c5a0c16.html">api</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">yajl_common.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="yajl__common_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2007-2014, Lloyd Hilaiel &lt;me@lloyd.io&gt;</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission to use, copy, modify, and/or distribute this software for any</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * purpose with or without fee is hereby granted, provided that the above</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * copyright notice and this permission notice appear in all copies.</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot; AND THE AUTHOR DISCLAIMS ALL WARRANTIES</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#ifndef __YAJL_COMMON_H__</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#define __YAJL_COMMON_H__</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="yajl__common_8h.html#a5c4e27acd65107c08224f00d0dc57d9e">   26</a></span>&#160;<span class="preprocessor">#define YAJL_MAX_DEPTH 128</span></div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="comment">/* msft dll export gunk.  To build a DLL on windows, you</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="comment"> * must define WIN32, YAJL_SHARED, and YAJL_BUILD.  To use a shared</span></div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="comment"> * DLL, you must define YAJL_SHARED and WIN32 */</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#if (defined(_WIN32) || defined(WIN32)) &amp;&amp; defined(YAJL_SHARED)</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  ifdef YAJL_BUILD</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#    define YAJL_API __declspec(dllexport)</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  else</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#    define YAJL_API __declspec(dllimport)</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  endif</span></div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#else</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  if defined(__GNUC__) &amp;&amp; (__GNUC__ * 100 + __GNUC_MINOR__) &gt;= 303</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#    define YAJL_API __attribute__ ((visibility(&quot;default&quot;)))</span></div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  else</span></div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="yajl__common_8h.html#a112d9a9234313b4fa3d419c0723146c5">   41</a></span>&#160;<span class="preprocessor"></span><span class="preprocessor">#    define YAJL_API</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#  endif</span></div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="yajl__common_8h.html#a97021e33b302878fec5168ccbb8def7f">   47</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">void</span> * (*yajl_malloc_func)(<span class="keywordtype">void</span> *ctx, <span class="keywordtype">size_t</span> sz);</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="yajl__common_8h.html#a198f518fe5c41d9c3fc3818ec4e2b6f0">   51</a></span>&#160;<span class="keyword">typedef</span> void (*<a class="code" href="yajl__common_8h.html#a198f518fe5c41d9c3fc3818ec4e2b6f0">yajl_free_func</a>)(<span class="keywordtype">void</span> *ctx, <span class="keywordtype">void</span> * ptr);</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="yajl__common_8h.html#aa2cd3fc7a89fca29ead305b7fa783db3">   54</a></span>&#160;<span class="keyword">typedef</span> <span class="keywordtype">void</span> * (*yajl_realloc_func)(<span class="keywordtype">void</span> *ctx, <span class="keywordtype">void</span> * ptr, <span class="keywordtype">size_t</span> sz);</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structyajl__alloc__funcs.html">   58</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{</div>
<div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="structyajl__alloc__funcs.html#a4e32ade73f896e6446f8cb0ad0ee7456">   61</a></span>&#160;    <a class="code" href="yajl__common_8h.html#a97021e33b302878fec5168ccbb8def7f">yajl_malloc_func</a> <a class="code" href="structyajl__alloc__funcs.html#a4e32ade73f896e6446f8cb0ad0ee7456">malloc</a>;</div>
<div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="structyajl__alloc__funcs.html#ae677d7c736fe2d735f83f3dd17cfacb7">   63</a></span>&#160;    <a class="code" href="yajl__common_8h.html#aa2cd3fc7a89fca29ead305b7fa783db3">yajl_realloc_func</a> <a class="code" href="structyajl__alloc__funcs.html#ae677d7c736fe2d735f83f3dd17cfacb7">realloc</a>;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structyajl__alloc__funcs.html#a0c29b65b64754fdadbbbe9ea04701a2f">   66</a></span>&#160;    <a class="code" href="yajl__common_8h.html#a198f518fe5c41d9c3fc3818ec4e2b6f0">yajl_free_func</a> <a class="code" href="structyajl__alloc__funcs.html#a0c29b65b64754fdadbbbe9ea04701a2f">free</a>;</div>
<div class="line"><a name="l00068"></a><span class="lineno"><a class="line" href="structyajl__alloc__funcs.html#afa64c0d73d185a6fdabd648e9746f6b5">   68</a></span>&#160;    <span class="keywordtype">void</span> * <a class="code" href="structyajl__alloc__funcs.html#afa64c0d73d185a6fdabd648e9746f6b5">ctx</a>;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;} <a class="code" href="structyajl__alloc__funcs.html">yajl_alloc_funcs</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="preprocessor"></span>}</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor"></span></div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="structyajl__alloc__funcs_html_a0c29b65b64754fdadbbbe9ea04701a2f"><div class="ttname"><a href="structyajl__alloc__funcs.html#a0c29b65b64754fdadbbbe9ea04701a2f">yajl_alloc_funcs::free</a></div><div class="ttdeci">yajl_free_func free</div><div class="ttdef"><b>Definition:</b> yajl_common.h:66</div></div>
<div class="ttc" id="yajl__common_8h_html_aa2cd3fc7a89fca29ead305b7fa783db3"><div class="ttname"><a href="yajl__common_8h.html#aa2cd3fc7a89fca29ead305b7fa783db3">yajl_realloc_func</a></div><div class="ttdeci">void *(* yajl_realloc_func)(void *ctx, void *ptr, size_t sz)</div><div class="ttdef"><b>Definition:</b> yajl_common.h:54</div></div>
<div class="ttc" id="structyajl__alloc__funcs_html_ae677d7c736fe2d735f83f3dd17cfacb7"><div class="ttname"><a href="structyajl__alloc__funcs.html#ae677d7c736fe2d735f83f3dd17cfacb7">yajl_alloc_funcs::realloc</a></div><div class="ttdeci">yajl_realloc_func realloc</div><div class="ttdef"><b>Definition:</b> yajl_common.h:63</div></div>
<div class="ttc" id="yajl__common_8h_html_a198f518fe5c41d9c3fc3818ec4e2b6f0"><div class="ttname"><a href="yajl__common_8h.html#a198f518fe5c41d9c3fc3818ec4e2b6f0">yajl_free_func</a></div><div class="ttdeci">void(* yajl_free_func)(void *ctx, void *ptr)</div><div class="ttdef"><b>Definition:</b> yajl_common.h:51</div></div>
<div class="ttc" id="structyajl__alloc__funcs_html_afa64c0d73d185a6fdabd648e9746f6b5"><div class="ttname"><a href="structyajl__alloc__funcs.html#afa64c0d73d185a6fdabd648e9746f6b5">yajl_alloc_funcs::ctx</a></div><div class="ttdeci">void * ctx</div><div class="ttdef"><b>Definition:</b> yajl_common.h:68</div></div>
<div class="ttc" id="yajl__common_8h_html_a97021e33b302878fec5168ccbb8def7f"><div class="ttname"><a href="yajl__common_8h.html#a97021e33b302878fec5168ccbb8def7f">yajl_malloc_func</a></div><div class="ttdeci">void *(* yajl_malloc_func)(void *ctx, size_t sz)</div><div class="ttdef"><b>Definition:</b> yajl_common.h:47</div></div>
<div class="ttc" id="structyajl__alloc__funcs_html"><div class="ttname"><a href="structyajl__alloc__funcs.html">yajl_alloc_funcs</a></div><div class="ttdef"><b>Definition:</b> yajl_common.h:58</div></div>
<div class="ttc" id="structyajl__alloc__funcs_html_a4e32ade73f896e6446f8cb0ad0ee7456"><div class="ttname"><a href="structyajl__alloc__funcs.html#a4e32ade73f896e6446f8cb0ad0ee7456">yajl_alloc_funcs::malloc</a></div><div class="ttdeci">yajl_malloc_func malloc</div><div class="ttdef"><b>Definition:</b> yajl_common.h:61</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 18 2014 22:12:15 for YAJL by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.6
</small></address>
</body>
</html>