• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1---
2c: Copyright (C) Daniel Stenberg, <daniel.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)
11---
12
13# NAME
14
15curl_easy_option_by_name - find an easy setopt option by name
16
17# SYNOPSIS
18
19~~~c
20#include <curl/curl.h>
21
22const struct curl_easyoption *curl_easy_option_by_name(const char *name);
23~~~
24
25# DESCRIPTION
26
27Given a **name**, this function returns a pointer to the
28*curl_easyoption* struct, holding information about the
29curl_easy_setopt(3) option using that name. The name should be specified
30without the "CURLOPT_" prefix and the name comparison is made case
31insensitive.
32
33If libcurl has no option with the given name, this function returns NULL.
34
35# EXAMPLE
36
37~~~c
38int main(void)
39{
40  const struct curl_easyoption *opt = curl_easy_option_by_name("URL");
41  if(opt) {
42    printf("This option wants CURLoption %x\n", (int)opt->id);
43  }
44}
45~~~
46
47# AVAILABILITY
48
49This function was added in libcurl 7.73.0
50
51# RETURN VALUE
52
53A pointer to the *curl_easyoption* struct for the option or NULL.
54