/*################################################################################### # # Embperl - Copyright (c) 1997-1999 Gerald Richter / ECOS # # You may distribute under the terms of either the GNU General Public # License or the Artistic License, as specified in the Perl README file. # For use with Apache httpd and mod_perl, see also Apache copyright. # # THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. # ###################################################################################*/ #include "ep.h" #include "epmacro.h" /* Version */ static char sVersion [] = VERSION ; static int bInitDone = 0 ; /* c part is already initialized */ static char sEnvHashName [] = "ENV" ; static char sFormHashName [] = "HTML::Embperl::fdat" ; static char sUserHashName [] = "HTML::Embperl::udat" ; static char sModHashName [] = "HTML::Embperl::mdat" ; static char sFormSplitHashName [] = "HTML::Embperl::fsplitdat" ; static char sFormArrayName [] = "HTML::Embperl::ffld" ; static char sInputHashName [] = "HTML::Embperl::idat" ; static char sErrArrayName [] = "HTML::Embperl::errors" ; static char sErrFillName [] = "HTML::Embperl::errfill" ; static char sErrStateName [] = "HTML::Embperl::errstate" ; static char sHeaderArrayName [] = "HTML::Embperl::headers" ; static char sTabCountName [] = "HTML::Embperl::cnt" ; static char sTabRowName [] = "HTML::Embperl::row" ; static char sTabColName [] = "HTML::Embperl::col" ; static char sTabMaxRowName [] = "HTML::Embperl::maxrow" ; static char sTabMaxColName [] = "HTML::Embperl::maxcol" ; static char sTabModeName [] = "HTML::Embperl::tabmode" ; static char sEscModeName [] = "HTML::Embperl::escmode" ; static char sOpcodeMaskName[] = "HTML::Embperl::opcodemask" ; static char sPackageName[] = "HTML::Embperl::package" ; static char sEvalPackageName[]= "HTML::Embperl::evalpackage" ; static char sDefaultPackageName [] = "HTML::Embperl::DOC::_%d" ; static char sUIDName [] = "_ID" ; static char sSetCookie [] = "Set-Cookie" ; static char sCookieNameDefault [] = "EMBPERL_UID" ; static int nPackNo = 1 ; /* Number for createing unique package names */ static tReq * pReqFree = NULL ; /* Chain of unused req structures */ tReq InitialReq ; /* Initial request - holds default values */ tReq * pCurrReq ; /* Set before every eval (NOT thread safe!!) */ static HV * pCacheHash ; /* Hash which holds all cached data (key=>filename, value=>cache hash for file) */ /* */ /* print error */ /* */ char * LogError (/*i/o*/ register req * r, /*in*/ int rc) { const char * msg ; char * sText ; SV * pSV ; SV ** ppSV ; int n ; EPENTRY (LogError) ; r -> errdat1 [sizeof (r -> errdat1) - 1] = '\0' ; r -> errdat2 [sizeof (r -> errdat2) - 1] = '\0' ; GetLineNo (r) ; if (rc != rcPerlWarn) r -> bError = 1 ; switch (rc) { case ok: msg ="[%d]ERR: %d: Line %d: ok%s%s" ; break ; case rcStackOverflow: msg ="[%d]ERR: %d: Line %d: Stack Overflow%s%s" ; break ; case rcArgStackOverflow: msg ="[%d]ERR: %d: Line %d: Argumnet Stack Overflow (%s)%s" ; break ; case rcStackUnderflow: msg ="[%d]ERR: %d: Line %d: Stack Underflow%s%s" ; break ; case rcEndifWithoutIf: msg ="[%d]ERR: %d: Line %d: endif without if%s%s" ; break ; case rcElseWithoutIf: msg ="[%d]ERR: %d: Line %d: else without if%s%s" ; break ; case rcEndwhileWithoutWhile: msg ="[%d]ERR: %d: Line %d: endwhile without while%s%s" ; break ; case rcEndtableWithoutTable: msg ="[%d]ERR: %d: Line %d: blockend <%s> does not match blockstart <%s>" ; break ; case rcTablerowOutsideOfTable: msg ="[%d]ERR: %d: Line %d: