curl_easy_option_by_id.md (1220B)
1 --- 2 c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 SPDX-License-Identifier: curl 4 Title: curl_easy_option_by_id 5 Section: 3 6 Source: libcurl 7 See-also: 8 - curl_easy_option_by_name (3) 9 - curl_easy_option_next (3) 10 - curl_easy_setopt (3) 11 Protocol: 12 - All 13 Added-in: 7.73.0 14 --- 15 16 # NAME 17 18 curl_easy_option_by_id - find an easy setopt option by id 19 20 # SYNOPSIS 21 22 ~~~c 23 #include <curl/curl.h> 24 25 const struct curl_easyoption *curl_easy_option_by_id(CURLoption id); 26 ~~~ 27 28 # DESCRIPTION 29 30 Given a *CURLoption* **id**, this function returns a pointer to the 31 *curl_easyoption* struct, holding information about the curl_easy_setopt(3) 32 option using that id. The option id is the `CURLOPT_` prefixed ones provided 33 in the standard curl/curl.h header file. This function returns the non-alias 34 version of the cases where there is an alias function as well. 35 36 If libcurl has no option with the given id, this function returns NULL. 37 38 # %PROTOCOLS% 39 40 # EXAMPLE 41 42 ~~~c 43 int main(void) 44 { 45 const struct curl_easyoption *opt = curl_easy_option_by_id(CURLOPT_URL); 46 if(opt) { 47 printf("This option wants type %x\n", opt->type); 48 } 49 } 50 ~~~ 51 52 # %AVAILABILITY% 53 54 # RETURN VALUE 55 56 A pointer to the *curl_easyoption* struct for the option or NULL.