diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-09-30 23:50:33 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-02 15:52:14 +0200 |
| commit | a0f5f7509bb9040752fa61fe0fdb447608e22b1c (patch) | |
| tree | 53337bce28ed75f26953c5969af6bc76d8841f2b /include | |
| parent | bba0b62f4e9e17927b9a2cda51dd5a4aa1b1f14e (diff) | |
| download | libweb-a0f5f7509bb9040752fa61fe0fdb447608e22b1c.tar.gz | |
Implement form interface
This new interface allows library users to parse
application/x-www-form-urlencoded data conveniently.
Diffstat (limited to 'include')
| -rw-r--r-- | include/libweb/form.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/libweb/form.h b/include/libweb/form.h new file mode 100644 index 0000000..84ede89 --- /dev/null +++ b/include/libweb/form.h @@ -0,0 +1,15 @@ +#ifndef LIBWEB_FORM_H +#define LIBWEB_FORM_H + +#include <stddef.h> + +typedef int (*form_iter)(const char *key, const char *value, void *user); + +struct form; + +int form_alloc(const char *data, struct form **f); +const char *form_value(const struct form *f, const char *key); +int form_foreach(const struct form *f, form_iter it, void *user); +void form_free(struct form *f); + +#endif |
