1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.12"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>libcbor: src/allocators.c Source File</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="search/search.css" rel="stylesheet" type="text/css"/> 13<script type="text/javascript" src="search/searchdata.js"></script> 14<script type="text/javascript" src="search/search.js"></script> 15<link href="doxygen.css" rel="stylesheet" type="text/css" /> 16<link href="customdoxygen.css" rel="stylesheet" type="text/css"/> 17</head> 18<body> 19<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 20<div id="titlearea"> 21<table cellspacing="0" cellpadding="0"> 22 <tbody> 23 <tr style="height: 56px;"> 24 <td id="projectalign" style="padding-left: 0.5em;"> 25 <div id="projectname">libcbor 26  <span id="projectnumber">0.5.0</span> 27 </div> 28 <div id="projectbrief">libcbor is a C library for parsing and generating CBOR, the general-purpose schema-less binary data format.</div> 29 </td> 30 </tr> 31 </tbody> 32</table> 33</div> 34<!-- end header part --> 35<!-- Generated by Doxygen 1.8.12 --> 36<script type="text/javascript"> 37var searchBox = new SearchBox("searchBox", "search",false,'Search'); 38</script> 39<script type="text/javascript" src="menudata.js"></script> 40<script type="text/javascript" src="menu.js"></script> 41<script type="text/javascript"> 42$(function() { 43 initMenu('',true,false,'search.php','Search'); 44 $(document).ready(function() { init_search(); }); 45}); 46</script> 47<div id="main-nav"></div> 48<!-- window showing the filter options --> 49<div id="MSearchSelectWindow" 50 onmouseover="return searchBox.OnSearchSelectShow()" 51 onmouseout="return searchBox.OnSearchSelectHide()" 52 onkeydown="return searchBox.OnSearchSelectKey(event)"> 53</div> 54 55<!-- iframe showing the search results (closed by default) --> 56<div id="MSearchResultsWindow"> 57<iframe src="javascript:void(0)" frameborder="0" 58 name="MSearchResults" id="MSearchResults"> 59</iframe> 60</div> 61 62<div id="nav-path" class="navpath"> 63 <ul> 64<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul> 65</div> 66</div><!-- top --> 67<div class="header"> 68 <div class="headertitle"> 69<div class="title">allocators.c</div> </div> 70</div><!--header--> 71<div class="contents"> 72<a href="allocators_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2014-2017 Pavel Kalvoda <me@pavelkalvoda.com></span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * libcbor is free software; you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * it under the terms of the MIT license. See LICENSE for details.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> */</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> </div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "<a class="code" href="common_8h.html">cbor/common.h</a>"</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> </div><div class="line"><a name="l00010"></a><span class="lineno"><a class="line" href="common_8h.html#a3218c24af00a3efeaecb1716c8f5a289"> 10</a></span> <a class="code" href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a> <a class="code" href="allocators_8c.html#a3218c24af00a3efeaecb1716c8f5a289">_cbor_malloc</a> = malloc;</div><div class="line"><a name="l00011"></a><span class="lineno"><a class="line" href="common_8h.html#a84ecc1fc92c3812ab6ced693f2c6254c"> 11</a></span> <a class="code" href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a> <a class="code" href="allocators_8c.html#a84ecc1fc92c3812ab6ced693f2c6254c">_cbor_realloc</a> = realloc;</div><div class="line"><a name="l00012"></a><span class="lineno"><a class="line" href="common_8h.html#a994f4145360ef0bfa3c48e59a5ca7186"> 12</a></span> <a class="code" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a> <a class="code" href="allocators_8c.html#a994f4145360ef0bfa3c48e59a5ca7186">_cbor_free</a> = free;</div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"><a class="line" href="common_8h.html#a3f9f1d527374dbb4b48ef3fafa92e0bf"> 14</a></span> <span class="keywordtype">void</span> <a class="code" href="allocators_8c.html#a3f9f1d527374dbb4b48ef3fafa92e0bf">cbor_set_allocs</a>(<a class="code" href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a> custom_malloc, <a class="code" href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a> custom_realloc, <a class="code" href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a> custom_free)</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> {</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  <a class="code" href="allocators_8c.html#a3218c24af00a3efeaecb1716c8f5a289">_cbor_malloc</a> = custom_malloc;</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <a class="code" href="allocators_8c.html#a84ecc1fc92c3812ab6ced693f2c6254c">_cbor_realloc</a> = custom_realloc;</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  <a class="code" href="allocators_8c.html#a994f4145360ef0bfa3c48e59a5ca7186">_cbor_free</a> = custom_free;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> }</div><div class="ttc" id="common_8h_html_af05bb33f6d22cdac535576c8edaf208c"><div class="ttname"><a href="common_8h.html#af05bb33f6d22cdac535576c8edaf208c">_cbor_free_t</a></div><div class="ttdeci">void(* _cbor_free_t)(void *)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00063">common.h:63</a></div></div> 73<div class="ttc" id="common_8h_html_a5b52369a95930104d33301d12faabe75"><div class="ttname"><a href="common_8h.html#a5b52369a95930104d33301d12faabe75">_cbor_realloc_t</a></div><div class="ttdeci">void *(* _cbor_realloc_t)(void *, size_t)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00062">common.h:62</a></div></div> 74<div class="ttc" id="allocators_8c_html_a3218c24af00a3efeaecb1716c8f5a289"><div class="ttname"><a href="allocators_8c.html#a3218c24af00a3efeaecb1716c8f5a289">_cbor_malloc</a></div><div class="ttdeci">_cbor_malloc_t _cbor_malloc</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00010">allocators.c:10</a></div></div> 75<div class="ttc" id="allocators_8c_html_a84ecc1fc92c3812ab6ced693f2c6254c"><div class="ttname"><a href="allocators_8c.html#a84ecc1fc92c3812ab6ced693f2c6254c">_cbor_realloc</a></div><div class="ttdeci">_cbor_realloc_t _cbor_realloc</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00011">allocators.c:11</a></div></div> 76<div class="ttc" id="common_8h_html_ad89d15c2e3f18e8914fcdffe4d725d42"><div class="ttname"><a href="common_8h.html#ad89d15c2e3f18e8914fcdffe4d725d42">_cbor_malloc_t</a></div><div class="ttdeci">void *(* _cbor_malloc_t)(size_t)</div><div class="ttdef"><b>Definition:</b> <a href="common_8h_source.html#l00061">common.h:61</a></div></div> 77<div class="ttc" id="common_8h_html"><div class="ttname"><a href="common_8h.html">common.h</a></div></div> 78<div class="ttc" id="allocators_8c_html_a3f9f1d527374dbb4b48ef3fafa92e0bf"><div class="ttname"><a href="allocators_8c.html#a3f9f1d527374dbb4b48ef3fafa92e0bf">cbor_set_allocs</a></div><div class="ttdeci">void cbor_set_allocs(_cbor_malloc_t custom_malloc, _cbor_realloc_t custom_realloc, _cbor_free_t custom_free)</div><div class="ttdoc">Sets the memory management routines to use. </div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00014">allocators.c:14</a></div></div> 79<div class="ttc" id="allocators_8c_html_a994f4145360ef0bfa3c48e59a5ca7186"><div class="ttname"><a href="allocators_8c.html#a994f4145360ef0bfa3c48e59a5ca7186">_cbor_free</a></div><div class="ttdeci">_cbor_free_t _cbor_free</div><div class="ttdef"><b>Definition:</b> <a href="allocators_8c_source.html#l00012">allocators.c:12</a></div></div> 80</div><!-- fragment --></div><!-- contents --> 81<!-- start footer part --> 82<hr class="footer"/><address class="footer"><small> 83Generated on Mon Feb 6 2017 00:26:19 for libcbor by  <a href="http://www.doxygen.org/index.html"> 84<img class="footer" src="doxygen.png" alt="doxygen"/> 85</a> 1.8.12 86</small></address> 87</body> 88</html> 89