/* Copyright 2006 Paul Querna * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef PWT_PRIVATE_CONTEXT_H #define PWT_PRIVATE_CONTEXT_H #include #include #include "apr_hash.h" #include "etl_hash.h" #include "pcre.h" typedef struct pwt_route_struct pwt_route_t; typedef struct stream_string_struct stream_string_t; struct pwt_route_struct { /* XXXX: Convert to pcre match */ const char *path; pcre *match; const char *module; pwt_route_t *next; }; typedef struct pwt_conf_t { const char *root; /** root path */ int global_plugins; const char *plugin_path; const char *template_path; pwt_route_t *routes; } pwt_conf_t; struct stream_string_struct { char *str; int len; int offset; }; struct pwt_ctxt_t { apr_pool_t *m_pool; etl_hash_t *m_env; /* configuration hash */ pwt_conf_t m_conf; /* internal parameters */ apr_hash_t *m_modules; /* output variables */ apr_table_t *m_outheaders; etl_hash_t *m_environment; etl_template_t *m_template; etl_stream_t *out; const char *etl_filename; }; const char* pwt_route_match_path(pwt_ctxt_t *pwt, const char *name, int length); const char* pwt_route_find_path(pwt_ctxt_t *pwt, const char *path); #endif /* PWT_PRIVATE_CONTEXT_H */