#pragma once
#include <stddef.h>
enum replace_zone
{
	kZoneRequestUri = 0,
	kZoneRequestHeaders,
	kZoneRequestBody,
	kZoneResponseHeader,
	kZoneResponseBody,
	kZoneMax
};
struct replace_rule
{
	enum replace_zone zone;
	char * find;
	char * replace_with;
};


//@parm exec_para example input:
//zone=http_req_body; substitute=/中華民國/中华人民共和国;zone=http_resp_header; substitute=/Content-Type:\btext\/html/Content-Type:\bvideo\/mp4
//@return formated rule number.
size_t format_replace_rule(const char * exec_para, struct replace_rule * replace, size_t n_replace);
size_t execute_replace_rule(const char * in, size_t in_sz, enum replace_zone zone, const struct replace_rule * rules, size_t n_rule, char** out);
void simple_replace(const char* find, const char* replacement, const char* input, size_t in_sz, char** output, size_t *output_sz);

