libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit e891b0218fefa1ec89b06a1948bc32639fb4a955
parent e7ff2c85d6a6858f225a74946ba7dfb664e2db8d
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Fri, 30 Oct 2026 18:25:07 +0100

Replaced more variable-length array parameters with pointers

Diffstat:
Mdoc/manual/postprocessor.inc | 2+-
Mdoc/manual/requests.inc | 2+-
Msrc/include/mhd_future.h | 12++++++------
Msrc/include/microhttpd2.h | 6+++---
Msrc/include/microhttpd2_main.h.in | 6+++---
Msrc/mhd2/auth_digest.c | 2+-
6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/manual/postprocessor.inc b/doc/manual/postprocessor.inc @@ -349,7 +349,7 @@ space for the @var{elements} itself and using @anchor{MHD_request_get_post_data_list} -@deftypefun size_t MHD_request_get_post_data_list (struct MHD_Request *request, size_t num_elements, struct MHD_PostField elements[num_elements]) +@deftypefun size_t MHD_request_get_post_data_list (struct MHD_Request *request, size_t num_elements, struct MHD_PostField *elements) Stores all of the post records from the @var{request} in @var{elements}. diff --git a/doc/manual/requests.inc b/doc/manual/requests.inc @@ -160,7 +160,7 @@ would contain the string ``key''. @c FIXME: why int? what would negative values be used for? @anchor{MHD_request_get_values_list} -@deftypefun int MHD_request_get_values_list (struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, struct MHD_NameValueKind elements[num_elements]) +@deftypefun int MHD_request_get_values_list (struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, struct MHD_NameValueKind *elements) Get all the headers matching @var{kind} from the request. The pointers to the strings returned in @var{elements} are valid until diff --git a/src/include/mhd_future.h b/src/include/mhd_future.h @@ -183,10 +183,10 @@ MHD_EXTERN_ enum MHD_StatusCode MHD_get_watched_fds ( struct MHD_Daemon *daemon, unsigned int num_elements, - struct MHD_WatchedFD wfds[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)], + struct MHD_WatchedFD *wfds, uint_fast64_t *max_wait) MHD_FN_PAR_NONNULL_ (1) -MHD_FN_PAR_OUT_ (3) MHD_FN_PAR_NONNULL_ (3) +MHD_FN_PAR_OUT_SIZE_ (3, 2) MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (4) MHD_FN_PAR_NONNULL_ (4); @@ -252,10 +252,10 @@ MHD_EXTERN_ enum MHD_StatusCode MHD_get_watched_fds_update ( struct MHD_Daemon *daemon, unsigned int num_elements, - struct MHD_WatchedFdUpdate wfdus[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)], + struct MHD_WatchedFdUpdate *wfdus, uint_fast64_t *max_wait) MHD_FN_PAR_NONNULL_ (1) -MHD_FN_PAR_OUT_ (3) MHD_FN_PAR_NONNULL_ (3) +MHD_FN_PAR_OUT_SIZE_ (3, 2) MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_ (4) MHD_FN_PAR_NONNULL_ (4); ; @@ -275,9 +275,9 @@ MHD_EXTERN_ enum MHD_StatusCode MHD_process_watched_fds ( struct MHD_Daemon *daemon, unsigned int num_elements, - const struct MHD_WatchedFD fds[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)]) + const struct MHD_WatchedFD *fds) MHD_FN_PAR_NONNULL_ (1) -MHD_FN_PAR_IN_ (3) MHD_FN_PAR_NONNULL_ (3); +MHD_FN_PAR_IN_SIZE_ (3, 2) MHD_FN_PAR_NONNULL_ (3); // FIXME: convert introspection diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h @@ -5737,7 +5737,7 @@ MHD_request_get_values_list ( struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, - struct MHD_NameValueKind elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)]) + struct MHD_NameValueKind *elements) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4, 3); @@ -7324,7 +7324,7 @@ MHD_EXTERN_ size_t MHD_request_get_post_data_list ( struct MHD_Request *request, size_t num_elements, - struct MHD_PostField elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)]) + struct MHD_PostField *elements) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3, 2); @@ -7920,7 +7920,7 @@ MHD_digest_auth_calc_userhash_hex ( const char *MHD_RESTRICT username, const char *MHD_RESTRICT realm, size_t hex_buf_size, - char userhash_hex[MHD_FN_PAR_DYN_ARR_SIZE_ (hex_buf_size)]) + char *userhash_hex) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2) MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5, 4); diff --git a/src/include/microhttpd2_main.h.in b/src/include/microhttpd2_main.h.in @@ -675,7 +675,7 @@ MHD_request_get_values_list ( struct MHD_Request *request, enum MHD_ValueKind kind, size_t num_elements, - struct MHD_NameValueKind elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)]) + struct MHD_NameValueKind *elements) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (4) MHD_FN_PAR_OUT_SIZE_ (4, 3); @@ -2262,7 +2262,7 @@ MHD_EXTERN_ size_t MHD_request_get_post_data_list ( struct MHD_Request *request, size_t num_elements, - struct MHD_PostField elements[MHD_FN_PAR_DYN_ARR_SIZE_ (num_elements)]) + struct MHD_PostField *elements) MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (3) MHD_FN_PAR_OUT_SIZE_ (3, 2); @@ -2858,7 +2858,7 @@ MHD_digest_auth_calc_userhash_hex ( const char *MHD_RESTRICT username, const char *MHD_RESTRICT realm, size_t hex_buf_size, - char userhash_hex[MHD_FN_PAR_DYN_ARR_SIZE_ (hex_buf_size)]) + char *userhash_hex) MHD_FN_PAR_NONNULL_ALL_ MHD_FN_PAR_CSTR_ (2) MHD_FN_PAR_CSTR_ (3) MHD_FN_PAR_OUT_SIZE_ (5, 4); diff --git a/src/mhd2/auth_digest.c b/src/mhd2/auth_digest.c @@ -2106,7 +2106,7 @@ MHD_digest_auth_calc_userhash_hex ( const char *MHD_RESTRICT username, const char *MHD_RESTRICT realm, size_t hex_buf_size, - char userhash_hex[MHD_FN_PAR_DYN_ARR_SIZE_ (hex_buf_size)]) + char *userhash_hex) { uint8_t userhash_bin[mhd_MAX_DIGEST] = { 0u /* mute compiler warning */ }; size_t digest_size;