curl_easy_option_next.3 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .TH curl_easy_option_next 3 "27 Aug 2020" "libcurl" "libcurl"
  25. .SH NAME
  26. curl_easy_option_next - iterate over easy setopt options
  27. .SH SYNOPSIS
  28. .nf
  29. #include <curl/curl.h>
  30. typedef enum {
  31. CURLOT_LONG, /* long (a range of values) */
  32. CURLOT_VALUES, /* (a defined set or bitmask) */
  33. CURLOT_OFF_T, /* curl_off_t (a range of values) */
  34. CURLOT_OBJECT, /* pointer (void *) */
  35. CURLOT_STRING, /* (char * to null-terminated buffer) */
  36. CURLOT_SLIST, /* (struct curl_slist *) */
  37. CURLOT_CBPTR, /* (void * passed as-is to a callback) */
  38. CURLOT_BLOB, /* blob (struct curl_blob *) */
  39. CURLOT_FUNCTION /* function pointer */
  40. } curl_easytype;
  41. /* The CURLOPTTYPE_* id ranges can still be used to figure out what type/size
  42. to use for curl_easy_setopt() for the given id */
  43. struct curl_easyoption {
  44. const char *name;
  45. CURLoption id;
  46. curl_easytype type;
  47. unsigned int flags;
  48. };
  49. const struct curl_easyoption *
  50. curl_easy_option_next(const struct curl_easyoption *prev);
  51. .fi
  52. .SH DESCRIPTION
  53. This function returns a pointer to the first or the next \fIcurl_easyoption\fP
  54. struct, providing an ability to iterate over all known options for
  55. \fIcurl_easy_setopt(3)\fP in this instance of libcurl.
  56. Pass a \fBNULL\fP argument as \fBprev\fP to get the first option returned, or
  57. pass in the current option to get the next one returned. If there is no more
  58. option to return, \fIcurl_easy_option_next(3)\fP returns NULL.
  59. The options returned by this functions are the ones known to this libcurl and
  60. information about what argument type they want.
  61. If the \fBCURLOT_FLAG_ALIAS\fP bit is set in the flags field, it means the
  62. name is provided for backwards compatibility as an alias.
  63. .SH EXAMPLE
  64. .nf
  65. /* iterate over all available options */
  66. const struct curl_easyoption *opt;
  67. opt = curl_easy_option_by_next(NULL);
  68. while(opt) {
  69. printf("Name: %s\\n", opt->name);
  70. opt = curl_easy_option_by_next(opt);
  71. }
  72. .fi
  73. .SH AVAILABILITY
  74. This function was added in libcurl 7.73.0
  75. .SH RETURN VALUE
  76. A pointer to the \fIcurl_easyoption\fP struct for the next option or NULL if
  77. no more options.
  78. .SH "SEE ALSO"
  79. .BR curl_easy_option_by_name "(3)," curl_easy_option_by_id "(3),"
  80. .BR curl_easy_setopt "(3),"