--- parser3/src/include/pa_sapi.h 2001/03/24 14:30:57 1.2 +++ parser3/src/include/pa_sapi.h 2001/04/09 08:55:28 1.5 @@ -5,7 +5,7 @@ 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.5 2001/04/09 08:55:28 paf Exp $ */ #ifndef PA_SAPI_H @@ -14,9 +14,15 @@ #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, ...); + /// 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); @@ -25,9 +31,12 @@ struct SAPI { /// add response header attribute 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); + /// @return exit_status + static int execute(const String& file_spec, + const Hash *env, + const Array *argv, + const String& in, String& out, String& err); }; #endif