2 <title>curl_global_init_mem man page
</title>
3 <meta name=
"generator" content=
"roffit 0.7">
4 <STYLE type=
"text/css">
30 background-color: #e0e0e0;
36 font-family: monospace;
46 <p class=
"level0"><a name=
"NAME"></a><h2 class=
"nroffsh">NAME
</h2>
47 <p class=
"level0">curl_global_init_mem - Global libcurl initialisation with memory callbacks
<a name=
"SYNOPSIS"></a><h2 class=
"nroffsh">SYNOPSIS
</h2>
48 <p class=
"level0"><span Class=
"bold">#include
<curl/curl.h
></span> <pre>
49 <p class=
"level0"><span Class=
"bold">CURLcode curl_global_init_mem(long flags,
</span>
50 <span Class=
"bold"> curl_malloc_callback m,
</span>
51 <span Class=
"bold"> curl_free_callback f,
</span>
52 <span Class=
"bold"> curl_realloc_callback r,
</span>
53 <span Class=
"bold"> curl_strdup_callback s,
</span>
54 <span Class=
"bold"> curl_calloc_callback c );
</span>
56 <a name=
"DESCRIPTION"></a><h2 class=
"nroffsh">DESCRIPTION
</h2>
57 <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.
58 <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.
59 <p class=
"level0">The prototypes for the given callbacks should match these:
60 <p class=
"level0"><a name=
"void"></a><span class=
"nroffip">void *malloc_callback(size_t size);
</span>
61 <p class=
"level1">To replace malloc()
62 <p class=
"level0"><a name=
"void"></a><span class=
"nroffip">void free_callback(void *ptr);
</span>
63 <p class=
"level1">To replace free()
64 <p class=
"level0"><a name=
"void"></a><span class=
"nroffip">void *realloc_callback(void *ptr, size_t size);
</span>
65 <p class=
"level1">To replace realloc()
66 <p class=
"level0"><a name=
"char"></a><span class=
"nroffip">char *strdup_callback(const char *str);
</span>
67 <p class=
"level1">To replace strdup()
68 <p class=
"level0"><a name=
"void"></a><span class=
"nroffip">void *calloc_callback(size_t nmemb, size_t size);
</span>
69 <p class=
"level1">To replace calloc()
<a name=
"CAUTION"></a><h2 class=
"nroffsh">CAUTION
</h2>
70 <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>
71 <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>
72 <p class=
"level0"><p class=
"roffit">
73 This HTML page was made with
<a href=
"http://daniel.haxx.se/projects/roffit/">roffit
</a>.