blob: 8c25eac5e6fd0775b7515e1acf484b8bb9630abf [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
<title>curl_global_init_mem man page</title>
<meta name="generator" content="roffit">
<STYLE type="text/css">
P.level0 {
padding-left: 2em;
P.level1 {
padding-left: 4em;
P.level2 {
padding-left: 6em;
span.emphasis {
font-style: italic;
span.bold {
font-weight: bold;
span.manpage {
font-weight: bold;
h2.nroffsh {
background-color: #e0e0e0;
span.nroffip {
font-weight: bold;
font-size: 120%;
font-family: monospace;
p.roffit {
text-align: center;
font-size: 80%;
<p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
<p class="level0">curl_global_init_mem - Global libcurl initialisation with memory callbacks <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
<p class="level0"><span Class="bold">#include &lt;curl/curl.h&gt;</span>
<p class="level0"><span Class="bold">CURLcode curl_global_init_mem(long flags,</span> <span Class="bold"> curl_malloc_callback m,</span> <span Class="bold"> curl_free_callback f,</span> <span Class="bold"> curl_realloc_callback r,</span> <span Class="bold"> curl_strdup_callback s,</span> <span Class="bold"> curl_calloc_callback c );</span> <a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
<p class="level0">This function works exactly as <a class="emphasis" href="./curl_global_init.html">curl_global_init(3)</a> with one addition: it allows the application to set callbacks to replace the otherwise used internal memory functions.
<p class="level0">This man page only adds documentation for the callbacks, see the <a class="emphasis" href="./curl_global_init.html">curl_global_init(3)</a> man page for all the rest. When you use this function, all callback arguments must be set to valid function pointers.
<p class="level0">The prototypes for the given callbacks should match these:
<p class="level0"><a name="void"></a><span class="nroffip">void *malloc_callback(size_t size);</span>
<p class="level1">To replace malloc()
<p class="level0"><a name="void"></a><span class="nroffip">void free_callback(void *ptr);</span>
<p class="level1">To replace free()
<p class="level0"><a name="void"></a><span class="nroffip">void *realloc_callback(void *ptr, size_t size);</span>
<p class="level1">To replace realloc()
<p class="level0"><a name="char"></a><span class="nroffip">char *strdup_callback(const char *str);</span>
<p class="level1">To replace strdup()
<p class="level0"><a name="void"></a><span class="nroffip">void *calloc_callback(size_t nmemb, size_t size);</span>
<p class="level1">To replace calloc() <a name="CAUTION"></a><h2 class="nroffsh">CAUTION</h2>
<p class="level0">Manipulating these gives considerable powers to the application to severly screw things up for libcurl. Take care! <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
<p class="level0"><a class="manpage" href="./curl_global_init.html">curl_global_init (3)</a> <span Class="manpage"> </span> <a class="manpage" href="./curl_global_cleanup.html">curl_global_cleanup (3)</a> <span Class="manpage"> </span>
<p class="level0"><p class="roffit">
This HTML page was made with <a href="">roffit</a>.