--- parser3/src/include/pa_globals.h 2001/03/23 10:14:33 1.22 +++ parser3/src/include/pa_globals.h 2001/03/26 10:36:53 1.28 @@ -5,19 +5,24 @@ Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_globals.h,v 1.22 2001/03/23 10:14:33 paf Exp $ + $Id: pa_globals.h,v 1.28 2001/03/26 10:36:53 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" @@ -37,6 +42,7 @@ #define ROOT_CLASS_NAME "ROOT" #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" @@ -50,32 +56,15 @@ #define RESULT_VAR_NAME "result" //@} -/// target-specific service functions -struct SAPI { - /// get env - const char *(*get_env)(Pool& pool, const char *name); - /// read POST request bytes - uint (*read_post)(Pool& pool, char *buf, uint 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); -}; - - /// 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 SAPI sapi; - //@{ /// global string +extern String *html_typo_name; extern String *content_type_name; extern String *body_name; extern String *value_name; @@ -97,6 +86,7 @@ extern String *root_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; @@ -113,4 +103,7 @@ extern String *result_var_name; /// global hash extern Hash *untaint_lang_name2enum; +/// global table +extern Table *default_typo_table; + #endif