--- parser3/src/include/pa_sapi.h 2001/03/24 14:30:57 1.2 +++ parser3/src/include/pa_sapi.h 2001/12/15 21:28:20 1.16 @@ -2,10 +2,9 @@ Parser: web server api interface object decl. Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://paf.design.ru) - Author: Alexander Petrosyan (http://design.ru/paf) - - $Id: pa_sapi.h,v 1.2 2001/03/24 14:30:57 paf Exp $ + $Id: pa_sapi.h,v 1.16 2001/12/15 21:28:20 paf Exp $ */ #ifndef PA_SAPI_H @@ -14,20 +13,26 @@ #include "pa_pool.h" #include "pa_types.h" -/// target web-server api +class Array; +class String; +class Hash; + +/// target web-Server API struct SAPI { - /// get env + /// log error message + static void log(Pool& pool, const char *fmt, ...); + /// log error message & die + static void die(const char *fmt, ...); + /// get environment string static const char *get_env(Pool& pool, const char *name); /// read POST request bytes - static uint read_post(Pool& pool, char *buf, uint max_bytes); - /// add response header attribute + static size_t read_post(Pool& pool, char *buf, size_t max_bytes); + /// add response header attribute [but do not send it to client] static void add_header_attribute(Pool& pool, const char *key, const char *value); - /// add response header attribute + /// send collected header attributes to client static void send_header(Pool& pool); /// output body bytes - static void send_body(Pool& pool, const char *buf, size_t size); - /// log error message - static void log(Pool& pool, const char *fmt, ...); + static void send_body(Pool& pool, const void *buf, size_t size); }; #endif