58 lines
1.2 KiB
C
58 lines
1.2 KiB
C
/******************************************************************************
|
|
*
|
|
* Copyright (c) 2017-2019 by Löwenware Ltd
|
|
* Please, refer LICENSE file for legal information
|
|
*
|
|
******************************************************************************/
|
|
|
|
/**
|
|
* @file query.h
|
|
* @author Ilja Kartašov <ik@lowenware.com>
|
|
* @brief HTTP POST/GET query stream parser header file
|
|
*
|
|
* @see https://lowenware.com/aisl
|
|
*/
|
|
|
|
#ifndef QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
|
#define QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <aisl/aisl.h>
|
|
|
|
|
|
typedef int
|
|
(*AxQueryHandler)(const char *key, uint32_t k_len,
|
|
const char *val, uint32_t v_len,
|
|
void *p_ctx );
|
|
|
|
|
|
struct ax_query {
|
|
AxQueryHandler on_var;
|
|
void *p_ctx;
|
|
char *data;
|
|
size_t size;
|
|
size_t total;
|
|
char separator;
|
|
};
|
|
|
|
typedef struct ax_query * AxQuery;
|
|
|
|
|
|
AislStatus
|
|
ax_query_init(AxQuery query, size_t total, AxQueryHandler on_var, void *p_ctx);
|
|
|
|
|
|
void
|
|
ax_query_release(AxQuery query);
|
|
|
|
|
|
AislStatus
|
|
ax_query_feed(AxQuery query, const char *data, int32_t length);
|
|
|
|
|
|
void
|
|
ax_query__decode(char *e_str);
|
|
|
|
#endif /* !QUERY_H */
|