Imported Upstream version 7.44.0
[platform/upstream/curl.git] / docs / libcurl / curl_global_init.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2  "http://www.w3.org/TR/html4/loose.dtd">
3 <html><head>
4 <title>curl_global_init man page</title>
5 <meta name="generator" content="roffit">
6 <STYLE type="text/css">
7 pre {
8   overflow: auto;
9   margin: 0;
10 }
11
12 P.level0, pre.level0 {
13  padding-left: 2em;
14 }
15
16 P.level1, pre.level1 {
17  padding-left: 4em;
18 }
19
20 P.level2, pre.level2 {
21  padding-left: 6em;
22 }
23
24 span.emphasis {
25  font-style: italic;
26 }
27
28 span.bold {
29  font-weight: bold;
30 }
31
32 span.manpage {
33  font-weight: bold;
34 }
35
36 h2.nroffsh {
37  background-color: #e0e0e0;
38 }
39
40 span.nroffip {
41  font-weight: bold;
42  font-size: 120%;
43  font-family: monospace;
44 }
45
46 p.roffit {
47  text-align: center;
48  font-size: 80%;
49 }
50 </STYLE>
51 </head><body>
52
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 &lt;curl/curl.h&gt;</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">See the description in <a Class="bold" href="./libcurl.html">libcurl</a> of global environment requirements for details of how to use this function. 
63 <p class="level0"><a name="FLAGS"></a><h2 class="nroffsh">FLAGS</h2>
64 <p class="level0">
65 <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>. 
66 <p class="level0"><span Class="bold">CURL_GLOBAL_SSL</span> Initialize SSL 
67 <p class="level0"><span Class="bold">CURL_GLOBAL_WIN32</span> Initialize the Win32 socket libraries. 
68 <p class="level0"><span Class="bold">CURL_GLOBAL_NOTHING</span> Initialise nothing extra. This sets no bit. 
69 <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. 
70 <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>
71 <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>
72 <p class="level0"><a Class="manpage" href="./curl_global_init_mem.html">curl_global_init_mem</a>, <span Class="manpage"> </span> <a Class="manpage" href="./curl_global_cleanup.html">curl_global_cleanup</a>, <span Class="manpage"> </span> <a Class="manpage" href="./curl_easy_init.html">curl_easy_init</a>, <a Class="manpage" href="./libcurl.html">libcurl</a>, <p class="roffit">
73  This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
74 </body></html>