Libcurl-curl_global_init ()

Source: Internet
Author: User
Curl libcurl APICurl_global_init

Curl_global_init.3 -- man page

Name

Curl_global_init-Global libcurl initialisation

Synopsis

# Include <curl/curl. h>

Curlcode curl_global_init (long flags );

Description

This function sets up the program environment that libcurl needs. Think of it as an extension of the Library loader.

This function installs the program environment required by libcurl. It can be considered as a library loader. This function is used to load library files.

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 CILS any other function in libcurl. the environment it sets up is constant for the life of
Program and is the same for every program, so multiple callhave the same effect as one call.

Before the program calls other functions in libcurl, curl_global_init must be called once. Once initialized, it will be valid for the lifetime of your program. Multiple calls to this function serve the same purpose as one call. Therefore, you only need to call it once.

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.

The flags option is a single-bit mode used to accurately indicate which features libcurl initializes. Normal operation. You can set flags = curl_global_all. Unless you are familiar with libcurl, do not use other values, which means to perform internal operations on libcurl.

This function is not thread safe. 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 curl_global_init () callfunctions of other libraries that are similarly thread unsafe, it cocould conflict with any other thread that uses these other libraries.

This function is not thread-safe.In a program, do not call this function when other threads are running. This does not just mean that other threads are using libcurl. Because the curl_global_init function calls functions of other libraries, it may also be thread insecure, which will conflict with other threads that use these libraries.

See the description in libcurl (3) of global environment requirements for details of how to use this function.

Flags

 

Curl_global_all initialize everything possible. This sets all known bits.

Curl_global_ssl initialize SSL

Curl_global_win32 initialize the Win32 socket libraries.

Curl_global_nothing initialise nothing extra. This sets no bit.

Curl_global_default a sensible default. It will init both SSL and win32. right now, this equals the functionality of the curl_global_all mask.

Return Value

If this function returns non-zero, something wrong and you cannot use the other cURL functions.

See also

Curl_global_init_mem (3) curl_global_cleanup
(3) curl_easy_init (3) libcurl (3)

This html page was made with roffit.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.