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