Annotation of parser3/src/targets/apache/pa_httpd.h, revision 1.2
1.1 moko 1: /** @file
2: Parser: http wrapper.
3:
4: Copyright (c) 2003 ArtLebedev Group (http://www.artlebedev.com)
5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
6: */
7:
8: #ifndef PA_HTTPD_H
9: #define PA_HTTPD_H
10:
1.2 ! moko 11: static const char * const IDENT_HTTPD_H="$Date: 2010-11-13 00:43:22 $";
1.1 moko 12:
13: #ifdef __cplusplus
14: extern "C" {
15: #endif
16:
17: // import from c to c++
18:
19: typedef void pa_pool;
20: typedef void pa_server_rec;
21: typedef void pa_table;
22:
23: typedef struct pa_request_rec_tag {
24: void* real_request_rec;
25:
26: pa_pool* pool;
27: int header_only; /* HEAD request, as opposed to GET */
28: int* status;
29: const char *method; /* GET, HEAD, POST, etc. */
30:
31: pa_table *headers_out;
32: void* subprocess_env;
33: const char ** content_type;
34:
35: char *uri; /* the path portion of the URI */
1.2 ! moko 36: char *filename; /* filename if found, otherwise NULL */
1.1 moko 37: char *path_info;
38: char *args; /* QUERY_ARGS, if any */
1.2 ! moko 39: int file_not_found; /* ST_MODE set to zero if no such file */
1.1 moko 40: } pa_request_rec;
41:
42: /// apache parser module configuration [httpd.conf + .htaccess-es]
43: typedef struct Parser_module_config_tag {
44: const char* parser_config_filespec; ///< filespec of site's config file
45: int parser_status_allowed;
46: } Parser_module_config;
47:
48: const char* pa_version();
49: void pa_setup_module_cells();
50: void pa_destroy_module_cells();
51: int pa_parser_handler(pa_request_rec*, Parser_module_config*);
52:
53: // export from c to c++
54:
55:
56: // http_log.h
57:
58: #define PA_APLOG_EMERG 0 /* system is unusable */
59: #define PA_APLOG_ALERT 1 /* action must be taken immediately */
60: #define PA_APLOG_CRIT 2 /* critical conditions */
61: #define PA_APLOG_ERR 3 /* error conditions */
62: #define PA_APLOG_WARNING 4 /* warning conditions */
63: #define PA_APLOG_NOTICE 5 /* normal but significant condition */
64: #define PA_APLOG_INFO 6 /* informational */
65: #define PA_APLOG_DEBUG 7 /* debug-level messages */
66:
67: #define PA_APLOG_LEVELMASK 7 /* mask off the level value */
68:
69: #define PA_APLOG_NOERRNO (PA_APLOG_LEVELMASK + 1)
70:
71: #define PA_APLOG_MARK __FILE__,__LINE__
72:
73: void pa_ap_log_rerror(const char *file, int line, int level,
74: const pa_request_rec *s, const char *fmt, ...);
75:
76:
77: void pa_ap_log_error(const char *file, int line, int level,
78: const pa_server_rec *s, const char *fmt, ...);
79:
80: // ap_alloc.h
81:
82: const char * pa_ap_table_get(const pa_table *, const char *);
83: void pa_ap_table_addn(pa_table *, const char *name, const char *val);
84:
85: int pa_ap_table_size(const pa_table *);
86:
87: void pa_ap_table_do(int (*comp) (void *, const char *, const char *),
88: void *rec, const pa_table *t,...);
89:
90: char * pa_ap_pstrdup(pa_pool *, const char *s);
91:
92: // http_protocol.h
93:
94: /* Possible values for request_rec.read_body (set by handling module):
95: * REQUEST_NO_BODY Send 413 error if message has any body
96: * REQUEST_CHUNKED_ERROR Send 411 error if body without Content-Length
97: * REQUEST_CHUNKED_DECHUNK If chunked, remove the chunks for me.
98: * REQUEST_CHUNKED_PASS Pass the chunks to me without removal.
99: */
100: #define PA_REQUEST_NO_BODY 0
101: #define PA_REQUEST_CHUNKED_ERROR 1
102: #define PA_REQUEST_CHUNKED_DECHUNK 2
103: #define PA_REQUEST_CHUNKED_PASS 3
104:
105: int pa_ap_setup_client_block(pa_request_rec *r, int read_policy);
106: int pa_ap_should_client_block(pa_request_rec *r);
107: long pa_ap_get_client_block(pa_request_rec *r, char *buffer, int bufsiz);
108: void pa_ap_send_http_header(pa_request_rec *l);
109: int pa_ap_rwrite(const void *buf, int nbyte, pa_request_rec *r);
110:
111:
112: // http_main.h
113:
114: void pa_ap_hard_timeout(char *, pa_request_rec *);
115: void pa_ap_reset_timeout(pa_request_rec *);
116: void pa_ap_kill_timeout(pa_request_rec *);
117:
118:
119: // util_script.h
120:
121: void pa_ap_add_cgi_vars(pa_request_rec *r);
122: void pa_ap_add_common_vars(pa_request_rec *r);
123:
124: // httpd.h
125:
126: #define PA_HTTP_NOT_FOUND 404
127: #define PA_OK 0 /* Module has handled this stage. */
128:
129: // signal.h
130:
131: #define PA_SIGPIPE 1 /* must translate to real one */
132: #define PA_SIG_IGN (void (*)(int))1 /* must translate to real one */
133:
134: void (*pa_signal (int sig, void (*disp)(int)))(int);
135:
136: // ap_md5.h
137:
138: #define PA_MD5_DIGESTSIZE 16
139: typedef void PA_MD5_CTX;
140:
141: void pa_MD5Init(PA_MD5_CTX *context);
142: void pa_MD5Update(PA_MD5_CTX *context, const unsigned char *input,
143: unsigned int inputLen);
144: void pa_MD5Final(unsigned char digest[PA_MD5_DIGESTSIZE],
145: PA_MD5_CTX *context);
146: void pa_MD5Encode(const unsigned char *password,
147: const unsigned char *salt,
148: char *result, size_t nbytes);
149: void pa_to64(char *s, unsigned long v, int n);
150:
151:
152: #ifdef __cplusplus
153: }
154: #endif
155:
156: #endif
E-mail: