--- parser3/src/include/pa_globals.h 2001/03/19 15:53:14 1.14 +++ parser3/src/include/pa_globals.h 2001/03/23 10:14:33 1.22 @@ -1,9 +1,11 @@ /** @file - Parser + Parser: global decls. + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_globals.h,v 1.14 2001/03/19 15:53:14 paf Exp $ + $Id: pa_globals.h,v 1.22 2001/03/23 10:14:33 paf Exp $ */ #ifndef PA_GLOBALS_H @@ -21,6 +23,9 @@ #define VALUE_NAME "value" #define EXPIRES_NAME "expires" #define PATH_NAME "path" +#define NAME_NAME "name" +#define SIZE_NAME "size" +#define TEXT_NAME "text" #define EXCEPTION_METHOD_NAME "exception" @@ -46,13 +51,17 @@ //@} /// target-specific service functions -struct Service_funcs { +struct SAPI { + /// get env + const char *(*get_env)(Pool& pool, const char *name); /// read POST request bytes - int (*read_post)(char *buf, int max_bytes); - /// output response header attribute - void (*output_header_attribute)(const char *key, const char *value); + 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 (*output_body)(const char *buf, size_t size); + void (*send_body)(Pool& pool, const char *buf, size_t size); }; @@ -63,7 +72,7 @@ void globals_init(Pool& pool); extern short hex_value[0x100]; /// target-specific service functions -extern Service_funcs service_funcs; +extern SAPI sapi; //@{ /// global string @@ -72,6 +81,9 @@ extern String *body_name; extern String *value_name; extern String *expires_name; extern String *path_name; +extern String *name_name; +extern String *size_name; +extern String *text_name; extern String *exception_method_name;