--- parser3/src/include/pa_globals.h 2001/03/21 15:53:20 1.18 +++ parser3/src/include/pa_globals.h 2001/04/10 10:32:08 1.45 @@ -5,19 +5,24 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_globals.h,v 1.18 2001/03/21 15:53:20 paf Exp $ + $Id: pa_globals.h,v 1.45 2001/04/10 10:32:08 paf Exp $ */ #ifndef PA_GLOBALS_H #define PA_GLOBALS_H -#include "pa_string.h" -#include "pa_hash.h" +#include "pa_pool.h" + +class String; +class Hash; +class Table; //@{ /// constant string. class name, predefined method & co #define AUTO_FILE_NAME "auto.p" +#define HTML_TYPO_NAME "html-typo" + #define CONTENT_TYPE_NAME "content-type" #define BODY_NAME "body" #define VALUE_NAME "value" @@ -28,54 +33,57 @@ #define TEXT_NAME "text" #define EXCEPTION_METHOD_NAME "exception" +#define POST_PROCESS_METHOD_NAME "post-process" + +#define CONTENT_DISPOSITION_NAME "content-disposition" +#define CONTENT_DISPOSITION_FILENAME_NAME "filename" #define UNNAMED_NAME "unnamed" #define MAIN_METHOD_NAME "main" #define AUTO_METHOD_NAME "auto" -#define ROOT_CLASS_NAME "ROOT" +#define OP_CLASS_NAME "OP" #define MAIN_CLASS_NAME "MAIN" #define TABLE_CLASS_NAME "table" +#define FILE_CLASS_NAME "file" #define ENV_CLASS_NAME "env" #define FORM_CLASS_NAME "form" #define REQUEST_CLASS_NAME "request" #define RESPONSE_CLASS_NAME "response" #define COOKIE_CLASS_NAME "cookie" +#define RANDOM_CLASS_NAME "random" +#define MAIL_CLASS_NAME "mail" +#define IMAGE_CLASS_NAME "image" -#define LIMITS_NAME "limits" +#define LIMITS_NAME "LIMITS" #define POST_MAX_SIZE_NAME "post_max_size" -#define DEFAULTS_NAME "defaults" +#define DEFAULTS_NAME "DEFAULTS" +#define LOCALE_NAME "LOCALE" +#define LOCALE_CTYPE_NAME "ctype" +#define MIME_TYPES_NAME "MIME-TYPES" +#define VFILE_MIME_TYPE_NAME "mime-type" +#define MAIL_NAME "MAIL" -#define RESULT_VAR_NAME "result" -//@} +#define MAIN_SQL_NAME "SQL" +#define MAIN_SQL_DRIVERS_NAME "drivers" -/// target-specific service functions -struct Service_funcs { - /// get env - const char *(*get_env)(Pool& pool, const char *name); - /// read POST request bytes - int (*read_post)(Pool& pool, char *buf, int max_bytes); - /// add response header attribute - void (*add_header_attribute)(Pool& pool, const char *key, const char *value); - /// add response header attribute - void (*send_header)(Pool& pool); - /// output body bytes - void (*send_body)(Pool& pool, const char *buf, size_t size); -}; +#define RESULT_VAR_NAME "result" +#define STRING_PRE_MATCH_NAME "pre-match" +#define STRING_MATCH_NAME "match" +#define STRING_POST_MATCH_NAME "post-match" +//@} /// core func -void globals_init(Pool& pool); +void pa_globals_init(Pool& pool); /// hex_value[c] = hex value of c extern short hex_value[0x100]; -/// target-specific service functions -extern Service_funcs service_funcs; - //@{ /// global string +extern String *html_typo_name; extern String *content_type_name; extern String *body_name; extern String *value_name; @@ -86,6 +94,10 @@ extern String *size_name; extern String *text_name; extern String *exception_method_name; +extern String *post_process_method_name; + +extern String *content_disposition_name; +extern String *content_disposition_filename_name; extern String *unnamed_name; extern String *empty_string; @@ -93,24 +105,45 @@ extern String *empty_string; extern String *auto_method_name; extern String *main_method_name; -extern String *root_class_name; +extern String *op_class_name; extern String *main_class_name; extern String *env_class_name; extern String *table_class_name; +extern String *file_class_name; extern String *form_class_name; extern String *request_class_name; extern String *response_class_name; extern String *cookie_class_name; +extern String *random_class_name; +extern String *mail_class_name; +extern String *image_class_name; extern String *limits_name; extern String *post_max_size_name; extern String *defaults_name; +extern String *locale_name; +extern String *locale_ctype_name; +extern String *mime_types_name; +extern String *vfile_mime_type_name; +extern String *mail_name; + +extern String *main_sql_name; +extern String *main_sql_drivers_name; extern String *result_var_name; +extern String *string_pre_match_name; +extern String *string_match_name; +extern String *string_post_match_name; //@} /// global hash extern Hash *untaint_lang_name2enum; +/// global table +extern Table *default_typo_table; + +/// global pcre tables +extern const unsigned char *pcre_tables; + #endif