#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <libxml/tree.h>
#include <libxml/parser.h>
#include "ngx_http_xxslt_filter_module.h"
#include "ngx_http_xxslt_udata.h"
#include "ngx_http_xxslt_parse.h"
Go to the source code of this file.
Data Structures | |
struct | ngx_http_xxslt_selector_match_t |
Selector structure. More... | |
struct | ngx_http_xxslt_selector_data_t |
Selector data structure. More... | |
Defines | |
#define | NGX_HTTP_XXSLT_MATCH_OPEN 1 |
#define | NGX_HTTP_XXSLT_MATCH_CLOSE 2 |
#define | NGX_HTTP_XXSLT_SELECTOR_UNKNOWN 3 |
#define | NGX_HTTP_XXSLT_SELECTOR_PARSE 5 |
Functions | |
ngx_http_xxslt_selector_data_t * | ngx_http_xxslt_selector_init (ngx_http_request_t *r) |
Allocates and initializes selector structure. | |
ngx_int_t | ngx_http_xxslt_selector_add_data_chunk (ngx_http_xxslt_selector_data_t *sel_ctx, ngx_chain_t *in) |
Adds new data chunk to selector. | |
void | ngx_http_xxslt_selector_log_chain (ngx_http_request_t *r, ngx_chain_t *cl, u_char *label) |
Helper function - writes chain to log-file. | |
void | ngx_http_xxslt_selector_cleanup (ngx_http_xxslt_selector_data_t *sel_ctx) |
Frees all resources allocated by selector. |
#define NGX_HTTP_XXSLT_MATCH_CLOSE 2 |
Definition at line 36 of file ngx_http_xxslt_selector.h.
Referenced by ngx_http_xxslt_selector_add_data_chunk().
#define NGX_HTTP_XXSLT_MATCH_OPEN 1 |
Definition at line 35 of file ngx_http_xxslt_selector.h.
Referenced by ngx_http_xxslt_selector_add_data_chunk(), and ngx_http_xxslt_selector_init().
#define NGX_HTTP_XXSLT_SELECTOR_PARSE 5 |
Definition at line 39 of file ngx_http_xxslt_selector.h.
Referenced by ngx_http_xxslt_cleanup(), ngx_http_xxslt_process_data(), ngx_http_xxslt_selector_add_data_chunk(), and ngx_http_xxslt_selector_parse_match().
#define NGX_HTTP_XXSLT_SELECTOR_UNKNOWN 3 |
Definition at line 38 of file ngx_http_xxslt_selector.h.
Referenced by ngx_http_xxslt_cleanup(), ngx_http_xxslt_process_data(), ngx_http_xxslt_selector_add_data_chunk(), ngx_http_xxslt_selector_init(), and ngx_http_xxslt_selector_unknown_match().
ngx_int_t ngx_http_xxslt_selector_add_data_chunk | ( | ngx_http_xxslt_selector_data_t * | ctx, | |
ngx_chain_t * | in | |||
) |
Adds new data chunk to selector.
Parse/any: divides data into chunks and forwards to the relevant modules. XML: forwards data to xml module.
ctx | selector structure | |
in | input chain |
Definition at line 107 of file ngx_http_xxslt_selector.c.
References ngx_http_xxslt_selector_data_t::act_out_data_parse, ngx_http_xxslt_selector_data_t::act_out_data_unknown, ngx_http_xxslt_selector_data_t::backup_in, ngx_http_xxslt_selector_match_t::buf_before, ngx_http_xxslt_selector_match_t::c_len, ngx_http_xxslt_selector_match_t::c_pos, ngx_http_xxslt_selector_match_t::cl_before, ngx_http_xxslt_selector_match_t::close, ngx_http_xxslt_out_data_s::last, ngx_http_xxslt_selector_data_t::match_data, NGX_HTTP_XXSLT_MATCH_CLOSE, NGX_HTTP_XXSLT_MATCH_OPEN, ngx_http_xxslt_process_data(), NGX_HTTP_XXSLT_SELECTOR_PARSE, ngx_http_xxslt_selector_parse_match(), ngx_http_xxslt_selector_prepare_in(), ngx_http_xxslt_selector_set_pos(), NGX_HTTP_XXSLT_SELECTOR_UNKNOWN, ngx_http_xxslt_selector_unknown_match(), ngx_http_xxslt_selector_match_t::o_len, ngx_http_xxslt_selector_match_t::o_pos, ngx_http_xxslt_selector_match_t::open, ngx_http_xxslt_selector_data_t::r, ngx_http_xxslt_selector_data_t::select_mode, and ngx_http_xxslt_selector_match_t::state.
Referenced by ngx_http_xxslt_body_filter().
void ngx_http_xxslt_selector_cleanup | ( | ngx_http_xxslt_selector_data_t * | sel_ctx | ) |
Frees all resources allocated by selector.
sel_ctx | selector structure |
Definition at line 657 of file ngx_http_xxslt_selector.c.
References ngx_http_xxslt_selector_data_t::includes.
Referenced by ngx_http_xxslt_cleanup().
ngx_http_xxslt_selector_data_t* ngx_http_xxslt_selector_init | ( | ngx_http_request_t * | r | ) |
Allocates and initializes selector structure.
Uses request pool to allocate structure.
r | nginx http request |
Definition at line 53 of file ngx_http_xxslt_selector.c.
References ngx_http_xxslt_selector_data_t::act_out_data_parse, ngx_http_xxslt_selector_data_t::act_out_data_unknown, ngx_http_xxslt_selector_data_t::backup_in, ngx_http_xxslt_selector_match_t::c_len, ngx_http_xxslt_selector_match_t::close, ngx_http_xxslt_selector_data_t::id_data, ngx_http_xxslt_selector_data_t::includes, ngx_http_xxslt_selector_data_t::match_data, NGX_HTTP_XXSLT_MATCH_OPEN, NGX_HTTP_XXSLT_SELECTOR_UNKNOWN, ngx_http_xxslt_selector_match_t::o_len, ngx_http_xxslt_selector_match_t::open, ngx_http_xxslt_selector_data_t::r, ngx_http_xxslt_selector_data_t::select_mode, and ngx_http_xxslt_selector_match_t::state.
Referenced by ngx_http_xxslt_body_filter().
void ngx_http_xxslt_selector_log_chain | ( | ngx_http_request_t * | r, | |
ngx_chain_t * | cl, | |||
u_char * | label | |||
) |
Helper function - writes chain to log-file.
r | nginx http request | |
cl | chain link | |
label | additional string that will appear in logs |
Definition at line 343 of file ngx_http_xxslt_selector.c.