59 lines
1.3 KiB
C
59 lines
1.3 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 AISLX_QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
|
#define AISLX_QUERY_H_9306EAEB_6DFC_4936_934A_6472F00E490C
|
|
|
|
#include <stdint.h>
|
|
#include <stddef.h>
|
|
#include <aisl/aisl.h>
|
|
|
|
|
|
typedef int
|
|
(*aislx_query_on_var)( const char *key, uint32_t k_len,
|
|
const char *val, uint32_t v_len,
|
|
void *p_ctx );
|
|
|
|
|
|
struct aislx_query
|
|
{
|
|
aislx_query_on_var on_var;
|
|
void *p_ctx;
|
|
char *data;
|
|
size_t size;
|
|
size_t total;
|
|
char separator;
|
|
};
|
|
|
|
typedef struct aislx_query * aislx_query_t;
|
|
|
|
|
|
aisl_status_t
|
|
aislx_query_init( aislx_query_t query,
|
|
size_t total,
|
|
aislx_query_on_var on_var,
|
|
void *p_ctx );
|
|
|
|
|
|
void
|
|
aislx_query_release(aislx_query_t query);
|
|
|
|
|
|
aisl_status_t
|
|
aislx_query_feed(aislx_query_t query, const char *data, int32_t length);
|
|
|
|
|
|
#endif /* !AISLX_QUERY_H */
|