1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
4 <title>curl_global_init man page
</title>
5 <meta name=
"generator" content=
"roffit">
6 <STYLE type=
"text/css">
12 P.level0, pre.level0 {
16 P.level1, pre.level1 {
20 P.level2, pre.level2 {
37 background-color: #e0e0e0;
43 font-family: monospace;
53 <p class=
"level0"><a name=
"NAME"></a><h2 class=
"nroffsh">NAME
</h2>
54 <p class=
"level0">curl_global_init - Global libcurl initialisation
<a name=
"SYNOPSIS"></a><h2 class=
"nroffsh">SYNOPSIS
</h2>
55 <p class=
"level0"><span Class=
"bold">#include
<curl/curl.h
></span>
56 <p class=
"level0"><span Class=
"bold">CURLcode curl_global_init(long flags );
</span>
57 <p class=
"level0"><a name=
"DESCRIPTION"></a><h2 class=
"nroffsh">DESCRIPTION
</h2>
58 <p class=
"level0">This function sets up the program environment that libcurl needs. Think of it as an extension of the library loader.
59 <p class=
"level0">This function must be called at least once within a program (a program is all the code that shares a memory space) before the program calls any other function in libcurl. The environment it sets up is constant for the life of the program and is the same for every program, so multiple calls have the same effect as one call.
60 <p class=
"level0">The flags option is a bit pattern that tells libcurl exactly what features to init, as described below. Set the desired bits by ORing the values together. In normal operation, you must specify CURL_GLOBAL_ALL. Don't use any other value unless you are familiar with it and mean to control internal operations of libcurl.
61 <p class=
"level0"><span Class=
"bold">This function is not thread safe.
</span> You must not call it when any other thread in the program (i.e. a thread sharing the same memory) is running. This doesn't just mean no other thread that is using libcurl. Because
<a Class=
"emphasis" href=
"./curl_global_init.html">curl_global_init
</a> calls functions of other libraries that are similarly thread unsafe, it could conflict with any other thread that uses these other libraries.
62 <p class=
"level0">If you are initializing libcurl from a Windows DLL you should not initialize it from DllMain or a static initializer because Windows holds the loader lock during that time and it could cause a deadlock.
63 <p class=
"level0">See the description in
<a Class=
"emphasis" href=
"./libcurl.html">libcurl
</a> of global environment requirements for details of how to use this function.
64 <p class=
"level0"><a name=
"FLAGS"></a><h2 class=
"nroffsh">FLAGS
</h2>
66 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_ALL
</span> Initialize everything possible. This sets all known bits except
<span Class=
"bold">CURL_GLOBAL_ACK_EINTR
</span>.
67 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_SSL
</span> Initialize SSL
68 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_WIN32
</span> Initialize the Win32 socket libraries.
69 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_NOTHING
</span> Initialise nothing extra. This sets no bit.
70 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_DEFAULT
</span> A sensible default. It will init both SSL and Win32. Right now, this equals the functionality of the
<span Class=
"bold">CURL_GLOBAL_ALL
</span> mask.
71 <p class=
"level0"><span Class=
"bold">CURL_GLOBAL_ACK_EINTR
</span> When this flag is set, curl will acknowledge EINTR condition when connecting or when waiting for data. Otherwise, curl waits until full timeout elapses. (Added in
7.30.0)
<a name=
"RETURN"></a><h2 class=
"nroffsh">RETURN VALUE
</h2>
72 <p class=
"level0">If this function returns non-zero, something went wrong and you cannot use the other curl functions.
<a name=
"SEE"></a><h2 class=
"nroffsh">SEE ALSO
</h2>
73 <p class=
"level0"><a Class=
"manpage" href=
"./curl_global_init_mem.html">curl_global_init_mem
</a>,
<a Class=
"manpage" href=
"./curl_global_cleanup.html">curl_global_cleanup
</a>,
<a Class=
"manpage" href=
"./curl_easy_init.html">curl_easy_init
</a>,
<a Class=
"manpage" href=
"./libcurl.html">libcurl
</a><p class=
"roffit">
74 This HTML page was made with
<a href=
"http://daniel.haxx.se/projects/roffit/">roffit
</a>.