aisl-sdk/components/query.h

59 lines
1.3 KiB
C
Raw Normal View History

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
*/
#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>
2019-04-09 13:23:40 +02:00
typedef int
(*aislx_query_on_var)( 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
struct aislx_query
{
2019-04-16 14:26:37 +02:00
aislx_query_on_var on_var;
void *p_ctx;
char *data;
size_t size;
size_t total;
char separator;
2019-04-09 13:23:40 +02:00
};
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 );
2019-04-09 13:23:40 +02:00
void
aislx_query_release(aislx_query_t query);
aisl_status_t
aislx_query_feed(aislx_query_t query, const char *data, int32_t length);
2019-04-09 13:23:40 +02:00
#endif /* !AISLX_QUERY_H */