FORM_FOREACH(3)

NAME
form_foreach - parse application/x-www-form-urlencoded data

SYNOPSIS

#include <libweb/form.h>

typedef int (*form_iter)(const char *key, const char *value, void *user);
int form_foreach(const struct form *f, form_iter it, void *user);

DESCRIPTION
The form_foreach(3) function takes a struct form instance previously allocated by form_alloc(3), pointed to by f, and iterates over the object, calling the user-defined function pointed to by it for every key-value pair.

RETURN VALUE
On success, zero is returned. Any non-zero return value coming from it makes form_foreach(3) to stop its execution and propagate the return value to the caller.

EXAMPLE
See libweb_form(7) for a complete example on how to use this library.

SEE ALSO
form_alloc(3), form_value(3), form_free(3), libweb_form(7).

COPYRIGHT
Copyright (C) 2023-2025 libweb contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.