src/http/modules/ngx_http_ssi_filter_module.h - nginx-1.7.10

Data types defined

Macros defined

Source code


  1. /*
  2. * Copyright (C) Igor Sysoev
  3. * Copyright (C) Nginx, Inc.
  4. */


  5. #ifndef _NGX_HTTP_SSI_FILTER_H_INCLUDED_
  6. #define _NGX_HTTP_SSI_FILTER_H_INCLUDED_


  7. #include <ngx_config.h>
  8. #include <ngx_core.h>
  9. #include <ngx_http.h>


  10. #define NGX_HTTP_SSI_MAX_PARAMS       16

  11. #define NGX_HTTP_SSI_COMMAND_LEN      32
  12. #define NGX_HTTP_SSI_PARAM_LEN        32
  13. #define NGX_HTTP_SSI_PARAMS_N         4


  14. #define NGX_HTTP_SSI_COND_IF          1
  15. #define NGX_HTTP_SSI_COND_ELSE        2


  16. #define NGX_HTTP_SSI_NO_ENCODING      0
  17. #define NGX_HTTP_SSI_URL_ENCODING     1
  18. #define NGX_HTTP_SSI_ENTITY_ENCODING  2


  19. typedef struct {
  20.     ngx_hash_t                hash;
  21.     ngx_hash_keys_arrays_t    commands;
  22. } ngx_http_ssi_main_conf_t;


  23. typedef struct {
  24.     ngx_buf_t                *buf;

  25.     u_char                   *pos;
  26.     u_char                   *copy_start;
  27.     u_char                   *copy_end;

  28.     ngx_uint_t                key;
  29.     ngx_str_t                 command;
  30.     ngx_array_t               params;
  31.     ngx_table_elt_t          *param;
  32.     ngx_table_elt_t           params_array[NGX_HTTP_SSI_PARAMS_N];

  33.     ngx_chain_t              *in;
  34.     ngx_chain_t              *out;
  35.     ngx_chain_t             **last_out;
  36.     ngx_chain_t              *busy;
  37.     ngx_chain_t              *free;

  38.     ngx_uint_t                state;
  39.     ngx_uint_t                saved_state;
  40.     size_t                    saved;
  41.     size_t                    looked;

  42.     size_t                    value_len;

  43.     ngx_list_t               *variables;
  44.     ngx_array_t              *blocks;

  45. #if (NGX_PCRE)
  46.     ngx_uint_t                ncaptures;
  47.     int                      *captures;
  48.     u_char                   *captures_data;
  49. #endif

  50.     unsigned                  conditional:2;
  51.     unsigned                  encoding:2;
  52.     unsigned                  block:1;
  53.     unsigned                  output:1;
  54.     unsigned                  output_chosen:1;

  55.     ngx_http_request_t       *wait;
  56.     void                     *value_buf;
  57.     ngx_str_t                 timefmt;
  58.     ngx_str_t                 errmsg;
  59. } ngx_http_ssi_ctx_t;


  60. typedef ngx_int_t (*ngx_http_ssi_command_pt) (ngx_http_request_t *r,
  61.     ngx_http_ssi_ctx_t *ctx, ngx_str_t **);


  62. typedef struct {
  63.     ngx_str_t                 name;
  64.     ngx_uint_t                index;

  65.     unsigned                  mandatory:1;
  66.     unsigned                  multiple:1;
  67. } ngx_http_ssi_param_t;


  68. typedef struct {
  69.     ngx_str_t                 name;
  70.     ngx_http_ssi_command_pt   handler;
  71.     ngx_http_ssi_param_t     *params;

  72.     unsigned                  conditional:2;
  73.     unsigned                  block:1;
  74.     unsigned                  flush:1;
  75. } ngx_http_ssi_command_t;


  76. extern ngx_module_t  ngx_http_ssi_filter_module;


  77. #endif /* _NGX_HTTP_SSI_FILTER_H_INCLUDED_ */