|
|
| version 1.1, 2001/03/23 10:27:30 | version 1.26.8.1, 2005/08/05 13:02:59 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: web server api interface object decl. | Parser: web server api interface object decl. |
| Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | |
| $Id$ | |
| */ | */ |
| #ifndef PA_SAPI_H | #ifndef PA_SAPI_H |
| #define PA_SAPI_H | #define PA_SAPI_H |
| #include "pa_pool.h" | static const char * const IDENT_SAPI_H="$Date$"; |
| // includes | |
| #include "pa_types.h" | #include "pa_types.h" |
| #include "pa_array.h" | |
| // forwards | |
| class SAPI_Info; | |
| /// target web-server api | /// target web-Server API |
| struct SAPI { | struct SAPI { |
| /// get env | /// log error message |
| static const char *get_env(Pool& pool, const char *name); | static void log(SAPI_Info& info, const char* fmt, ...); |
| /// log error message & exit | |
| static void die(const char* fmt, ...); | |
| /// log error message & abort[write core] | |
| static void abort(const char* fmt, ...); | |
| /// environment strings | |
| static const char* const* environment(SAPI_Info& info); | |
| /// get environment string | |
| static char* get_env(SAPI_Info& info, const char* name); | |
| /// read POST request bytes | /// read POST request bytes |
| static uint read_post(Pool& pool, char *buf, uint max_bytes); | static size_t read_post(SAPI_Info& info, char *buf, size_t max_bytes); |
| /// add response header attribute | /// add response header attribute [but do not send it to client] |
| static void add_header_attribute(Pool& pool, const char *key, const char *value); | static void add_header_attribute(SAPI_Info& info, |
| /// add response header attribute | const char* dont_store_key, const char* dont_store_value); |
| static void send_header(Pool& pool); | /// send collected header attributes to client |
| static void send_header(SAPI_Info& info); | |
| /// output body bytes | /// output body bytes |
| static void send_body(Pool& pool, const char *buf, size_t size); | static size_t send_body(SAPI_Info& info, const void *buf, size_t size); |
| }; | }; |
| #endif | #endif |