Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 155a6b8ffc33b073b9bc0b0d9ec80b13 > files > 46

lib64neon0.27-devel-0.28.0-1mdv2008.1.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_malloc</title><link rel="stylesheet" href="../manual.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refiaddr.html" title="ne_iaddr_make"><link rel="next" href="refsess.html" title="ne_session_create"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_malloc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refiaddr.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refsess.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="refalloc"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_malloc, ne_calloc, ne_realloc, ne_strdup, ne_strndup, ne_oom_callback — memory allocation wrappers</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;ne_alloc.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">void *<b class="fsfunc">ne_malloc</b>(</code></td><td>size_t  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">void *<b class="fsfunc">ne_calloc</b>(</code></td><td>size_t  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">void *<b class="fsfunc">ne_realloc</b>(</code></td><td>void * </td><td><var class="pdparam">size</var>, </td></tr><tr><td> </td><td>size_t  </td><td><var class="pdparam">len</var><code>)</code>;</td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">char *<b class="fsfunc">ne_strdup</b>(</code></td><td>const char * </td><td><var class="pdparam">s</var><code>)</code>;</td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">char *<b class="fsfunc">ne_strndup</b>(</code></td><td>const char * </td><td><var class="pdparam">s</var>, </td></tr><tr><td> </td><td>size_t  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">ne_oom_callback</b>(</code></td><td>void (* </td><td><var class="pdparam">callback</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en"><a name="id349880"></a><h2>Description</h2><p>The functions <code class="function">ne_malloc</code>,
<code class="function">ne_calloc</code>, <code class="function">ne_realloc</code>,
<code class="function">ne_strdup</code> and <code class="function">ne_strdnup</code>
provide wrappers for the equivalent functions in the standard C
library.  The wrappers provide the extra guarantee that if the C
library equivalent returns <code class="literal">NULL</code> when no memory is available, an
optional callback will be called, and the library will then call
<code class="function">abort</code>().</p><p><code class="function">ne_oom_callback</code> registers a callback
which will be invoked if an out of memory error is detected.</p></div><div class="refsect1" lang="en"><a name="id349942"></a><h2>Notes</h2><p>If the operating system uses optimistic memory
allocation, the C library memory allocation routines will not return
<code class="literal">NULL</code>, so it is not possible to gracefully handle memory allocation
failures.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refiaddr.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refsess.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_iaddr_make </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_session_create</td></tr></table></div></body></html>