1curl_global_init(3) libcurl Manual curl_global_init(3)
2
3
4
6 curl_global_init - Global libcurl initialisation
7
9 #include <curl/curl.h>
10
11 CURLcode curl_global_init(long flags);
12
14 This function sets up the program environment that libcurl needs.
15 Think of it as an extension of the library loader.
16
17 This function must be called at least once within a program (a program
18 is all the code that shares a memory space) before the program calls
19 any other function in libcurl. The environment it sets up is constant
20 for the life of the program and is the same for every program, so mul‐
21 tiple calls have the same effect as one call.
22
23 The flags option is a bit pattern that tells libcurl exactly what fea‐
24 tures to init, as described below. Set the desired bits by ORing the
25 values together. In normal operation, you must specify
26 CURL_GLOBAL_ALL. Don't use any other value unless you are familiar
27 with it and mean to control internal operations of libcurl.
28
29 This function is not thread safe. You must not call it when any other
30 thread in the program (i.e. a thread sharing the same memory) is run‐
31 ning. This doesn't just mean no other thread that is using libcurl.
32 Because curl_global_init() calls functions of other libraries that are
33 similarly thread unsafe, it could conflict with any other thread that
34 uses these other libraries.
35
36 See the description in libcurl(3) of global environment requirements
37 for details of how to use this function.
38
39
41 CURL_GLOBAL_ALL
42 Initialize everything possible. This sets all known bits.
43
44 CURL_GLOBAL_SSL
45 Initialize SSL
46
47 CURL_GLOBAL_WIN32
48 Initialize the Win32 socket libraries.
49
50 CURL_GLOBAL_NOTHING
51 Initialise nothing extra. This sets no bit.
52
53 CURL_GLOBAL_DEFAULT
54 A sensible default. It will init both SSL and Win32. Right now,
55 this equals the functionality of the CURL_GLOBAL_ALL mask.
56
57 CURL_GLOBAL_ACK_EINTR
58 When this flag is set, curl will acknowledge EINTR condition when
59 connecting or when waiting for data. Otherwise, curl waits until
60 full timeout elapses.
61
63 If this function returns non-zero, something went wrong and you cannot
64 use the other curl functions.
65
67 curl_global_init_mem(3), curl_global_cleanup(3), curl_easy_init(3)
68 libcurl(3)
69
70
71
72libcurl 7.12 11 May 2004 curl_global_init(3)