--- parser3/src/main/pa_request.C 2001/03/12 17:00:48 1.19 +++ parser3/src/main/pa_request.C 2001/03/13 12:07:15 1.24 @@ -3,7 +3,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: pa_request.C,v 1.19 2001/03/12 17:00:48 paf Exp $ + $Id: pa_request.C,v 1.24 2001/03/13 12:07:15 paf Exp $ */ #include @@ -45,7 +45,7 @@ Request::Request(Pool& apool) : Pooled(a // web - // todo: ifdef WIN32 flip \\ to / + // TODO: ifdef WIN32 flip \\ to / document_root="Y:/parser3/src/"; page_filespec="Y:/parser3/src/test.p"; } @@ -70,7 +70,7 @@ void Request::core() { if(!main_class) THROW(0,0, 0, - "'auto.p' not found"); + "no 'auto.p' found (nither system nor any site's)"); // compiling requested file use_file(page_filespec, true/*don't ignore read problem*/, @@ -145,8 +145,19 @@ char *Request::execute_MAIN() { return 0; } +void Request::fail_if_junction_(bool is, + Value& value, const String& method_name, char *msg) { + + // fail_if_junction(true, junction = fail + // fail_if_junction(false, not junction = fail + if((value.get_junction()!=0) ^ !is) + THROW(0, 0, + &method_name, + msg); +} + char *Request::relative(const char *path, const char *file) { - char *result=static_cast(malloc(strlen(path)+strlen(file)+1)); + char *result=(char *)malloc(strlen(path)+strlen(file)+1); strcpy(result, path); rsplit(result,'/'); strcat(result, "/"); @@ -156,7 +167,7 @@ char *Request::relative(const char *path char *Request::absolute(const char *name) { if(name[0]=='/') { - char *result=static_cast(malloc(strlen(document_root)+strlen(name)+1)); + char *result=(char *)malloc(strlen(document_root)+strlen(name)+1); strcpy(result, document_root); strcat(result, name); return result;