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