curl_easy_option_next.3 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .\" generated by cd2nroff 0.1 from curl_easy_option_next.md
  2. .TH curl_easy_option_next 3 "2025-01-17" libcurl
  3. .SH NAME
  4. curl_easy_option_next \- iterate over easy setopt options
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. const struct curl_easyoption *
  9. curl_easy_option_next(const struct curl_easyoption *prev);
  10. .fi
  11. .SH DESCRIPTION
  12. This function returns a pointer to the first or the next \fIcurl_easyoption\fP
  13. struct, providing an ability to iterate over all known options for
  14. \fIcurl_easy_setopt(3)\fP in this instance of libcurl.
  15. Pass a \fBNULL\fP argument as \fBprev\fP to get the first option returned, or
  16. pass in the current option to get the next one returned. If there is no more
  17. option to return, \fIcurl_easy_option_next(3)\fP returns NULL.
  18. The options returned by this functions are the ones known to this libcurl and
  19. information about what argument type they want.
  20. If the \fBCURLOT_FLAG_ALIAS\fP bit is set in the flags field, it means the
  21. name is provided for backwards compatibility as an alias.
  22. .SH struct
  23. .nf
  24. typedef enum {
  25. CURLOT_LONG, /* long (a range of values) */
  26. CURLOT_VALUES, /* (a defined set or bitmask) */
  27. CURLOT_OFF_T, /* curl_off_t (a range of values) */
  28. CURLOT_OBJECT, /* pointer (void *) */
  29. CURLOT_STRING, /* (char * to null-terminated buffer) */
  30. CURLOT_SLIST, /* (struct curl_slist *) */
  31. CURLOT_CBPTR, /* (void * passed as-is to a callback) */
  32. CURLOT_BLOB, /* blob (struct curl_blob *) */
  33. CURLOT_FUNCTION /* function pointer */
  34. } curl_easytype;
  35. /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
  36. to use for curl_easy_setopt() for the given id */
  37. struct curl_easyoption {
  38. const char *name;
  39. CURLoption id;
  40. curl_easytype type;
  41. unsigned int flags;
  42. };
  43. .fi
  44. .SH PROTOCOLS
  45. This functionality affects all supported protocols
  46. .SH EXAMPLE
  47. .nf
  48. int main(void)
  49. {
  50. /* iterate over all available options */
  51. const struct curl_easyoption *opt;
  52. opt = curl_easy_option_next(NULL);
  53. while(opt) {
  54. printf("Name: %s\\n", opt->name);
  55. opt = curl_easy_option_next(opt);
  56. }
  57. }
  58. .fi
  59. .SH AVAILABILITY
  60. Added in curl 7.73.0
  61. .SH RETURN VALUE
  62. A pointer to the \fIcurl_easyoption\fP struct for the next option or NULL if
  63. no more options.
  64. .SH SEE ALSO
  65. .BR curl_easy_option_by_id (3),
  66. .BR curl_easy_option_by_name (3),
  67. .BR curl_easy_setopt (3)