2019-04-09 13:23:40 +02:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
#ifndef QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
|
|
|
#define QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2019-04-17 10:17:27 +02:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <aisl/aisl.h>
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
typedef int
|
2019-04-25 13:54:07 +02:00
|
|
|
(*AxQueryHandler)(const char *key, uint32_t k_len,
|
|
|
|
const char *val, uint32_t v_len,
|
|
|
|
void *p_ctx );
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
struct ax_query {
|
|
|
|
AxQueryHandler on_var;
|
2019-04-17 10:17:27 +02:00
|
|
|
void *p_ctx;
|
|
|
|
char *data;
|
|
|
|
size_t size;
|
|
|
|
size_t total;
|
|
|
|
char separator;
|
2019-04-09 13:23:40 +02:00
|
|
|
};
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
typedef struct ax_query * AxQuery;
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
AislStatus
|
|
|
|
ax_query_init(AxQuery query, size_t total, AxQueryHandler on_var, void *p_ctx);
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
|
|
|
void
|
2019-04-25 13:54:07 +02:00
|
|
|
ax_query_release(AxQuery query);
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
AislStatus
|
|
|
|
ax_query_feed(AxQuery query, const char *data, int32_t length);
|
2019-04-09 13:23:40 +02:00
|
|
|
|
|
|
|
|
2019-04-29 09:08:18 +02:00
|
|
|
void
|
|
|
|
ax_query__decode(char *e_str);
|
|
|
|
|
2019-04-25 13:54:07 +02:00
|
|
|
#endif /* !QUERY_H */
|