richter     02/05/20 05:11:19

  Modified:    .        Tag: Embperl2c Changes.pod epapinit.c
  Log:
  EMBPERL_APDEBUG
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.129.4.69 +3 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.129.4.68
  retrieving revision 1.129.4.69
  diff -u -r1.129.4.68 -r1.129.4.69
  --- Changes.pod       20 May 2002 06:09:50 -0000      1.129.4.68
  +++ Changes.pod       20 May 2002 12:11:19 -0000      1.129.4.69
  @@ -22,6 +22,9 @@
      - Fixed segfault when replacing an attribute. Reported by Michael Stevens.
      - Fixed random segfaults, that had occured when Perl had reallocated it's
        internal Stack.
  +   - When apache is started with -D EMBPERL_APDEBUG, it outputs a configuration 
  +     trace
  +
   
   =head1 2.0b7 (BETA) 21. Mar. 2002
   
  
  
  
  1.1.2.33  +43 -16    embperl/epapinit.c
  
  Index: epapinit.c
  ===================================================================
  RCS file: /home/cvs/embperl/epapinit.c,v
  retrieving revision 1.1.2.32
  retrieving revision 1.1.2.33
  diff -u -r1.1.2.32 -r1.1.2.33
  --- epapinit.c        20 May 2002 06:09:50 -0000      1.1.2.32
  +++ epapinit.c        20 May 2002 12:11:19 -0000      1.1.2.33
  @@ -10,12 +10,13 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epapinit.c,v 1.1.2.32 2002/05/20 06:09:50 richter Exp $
  +#   $Id: epapinit.c,v 1.1.2.33 2002/05/20 12:11:19 richter Exp $
   #
   
###################################################################################*/
   
   
   #include "ep.h"
  +#include <http_core.h>
   
   /* use getenv from runtime library and not from Perl */
   #undef getenv
  @@ -135,8 +136,7 @@
   void embperl_ApacheAddModule ()
   
       {
  -    char * p = getenv("EMBPERL_APDEBUG") ;
  -    bApDebug = p?atoi(p):0 ;
  +    bApDebug = ap_exists_config_define("EMBPERL_APDEBUG") ;
   
       if (!ap_find_linked_module("embperl.c"))
           {
  @@ -245,7 +245,6 @@
   #undef EPCFG_AV
   #undef EPCFG_REGEX
   
  -#define EPCFG_STR EPCFG
   #define EPCFG_INT EPCFG
   #define EPCFG_BOOL EPCFG
   #define EPCFG_CHAR EPCFG
  @@ -262,7 +261,28 @@
           { \
           mrg -> set_##STRUCT##NAME = 1 ; \
           mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
  -        }
  +        if (bApDebug) \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") => %d\n", mrg -> STRUCT.NAME) ; \
  +        } \
  +    else \
  +        {  \
  +        if (bApDebug && mrg -> set_##STRUCT##NAME) \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") stays %d\n", mrg -> STRUCT.NAME) ; \
  +        } 
  +
  +#define EPCFG_STR(STRUCT,TYPE,NAME,CFGNAME)  \
  +    if (add -> set_##STRUCT##NAME) \
  +        { \
  +        mrg -> set_##STRUCT##NAME = 1 ; \
  +        mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
  +        if (bApDebug) \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> STRUCT.NAME?mrg -> 
STRUCT.NAME:"<null>") ; \
  +        } \
  +    else \
  +        {  \
  +        if (bApDebug && mrg -> set_##STRUCT##NAME) \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> STRUCT.NAME?mrg -> 
STRUCT.NAME:"<null>") ; \
  +        } 
   
   #undef EPCFG_SAVE
   #define EPCFG_SAVE(STRUCT,TYPE,NAME,CFGNAME)  \
  @@ -271,7 +291,14 @@
           mrg -> set_##STRUCT##NAME = 1 ; \
           mrg -> STRUCT.NAME = add -> STRUCT.NAME ; \
           mrg -> save_##STRUCT##NAME = add -> save_##STRUCT##NAME ; \
  -        }
  +        if (bApDebug) \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") => %s\n", mrg -> save_##STRUCT##NAME?mrg -> 
save_##STRUCT##NAME:"<null>") ; \
  +        } \
  +    else \
  +        {  \
  +        if (bApDebug && mrg -> set_##STRUCT##NAME) \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
Merge "#CFGNAME" (type="#TYPE") stays %s\n", mrg -> save_##STRUCT##NAME?mrg -> 
save_##STRUCT##NAME:"<null>") ; \
  +        } 
   
   
   
  @@ -369,7 +396,7 @@
       if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
           { \
           if (bApDebug) \
  -            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" to perl data\n") ; \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" (type="#TYPE";SV) to perl data\n") ; \
   \
           pDirCfg -> STRUCT.NAME = newSVpv((char *)pDirCfg -> save_##STRUCT##NAME, 0) 
; \
           }
  @@ -380,7 +407,7 @@
           { \
           int rc ;\
           if (bApDebug) \
  -            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" to perl data\n") ; \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" (type="#TYPE";CV) to perl data\n") ; \
   \
           if ((rc = EvalConfig (pApp, sv_2mortal(newSVpv(pDirCfg -> 
save_##STRUCT##NAME, 0)), 0, NULL, "Configuration: EMBPERL_"#CFGNAME, &pDirCfg -> 
STRUCT.NAME)) != ok) \
               LogError (pReq, rc) ; \
  @@ -393,7 +420,7 @@
       if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
           { \
           if (bApDebug) \
  -            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" to perl data\n") ; \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" (type="#TYPE";AV) to perl data\n") ; \
   \
           pDirCfg -> STRUCT.NAME = embperl_String2AV(pApp, pDirCfg -> 
save_##STRUCT##NAME, SEPARATOR) ;\
           tainted = 0 ; \
  @@ -405,7 +432,7 @@
       if (pDirCfg -> save_##STRUCT##NAME && !pDirCfg -> STRUCT.NAME) \
           { \
           if (bApDebug) \
  -            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" to perl data\n") ; \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" (type="#TYPE";HV) to perl data\n") ; \
   \
           pDirCfg -> STRUCT.NAME = embperl_String2HV(pApp, pDirCfg -> 
save_##STRUCT##NAME, ' ', NULL) ;\
           tainted = 0 ; \
  @@ -418,7 +445,7 @@
           { \
           int rc ; \
           if (bApDebug) \
  -            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" to perl data\n") ; \
  +            aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: 
About to convert "#CFGNAME" (type="#TYPE";REGEX) to perl data\n") ; \
   \
           if ((rc = EvalRegEx (pApp, pDirCfg -> save_##STRUCT##NAME, "Configuration: 
EMBPERL_"#CFGNAME, &pDirCfg -> STRUCT.NAME)) != ok) \
               return rc ; \
  @@ -606,7 +633,7 @@
       pDirCfg -> STRUCT.NAME = (TYPE)strtol(arg, NULL, 0) ; \
       pDirCfg -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
  -        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" = %s\n", arg) ; \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" (type="#TYPE";INT) = %s\n", arg) ; \
       return NULL; \
       } 
   
  @@ -617,7 +644,7 @@
       pDirCfg -> STRUCT.NAME = (TYPE)arg ; \
       pDirCfg -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
  -        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" = %s\n", arg) ; \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" (type="#TYPE";BOOL) = %s\n", arg) ; \
       return NULL; \
       } 
   
  @@ -630,7 +657,7 @@
       pDirCfg -> STRUCT.NAME = ap_pstrdup(p, arg) ; \
       pDirCfg -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
  -        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" = %s\n", arg) ; \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" (type="#TYPE";STR) = %s\n", arg) ; \
       return NULL; \
       } 
   
  @@ -641,7 +668,7 @@
       pDirCfg -> STRUCT.NAME = (TYPE)arg[0] ; \
       pDirCfg -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
  -        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" = %s\n", arg) ; \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" (type="#TYPE";CHAR) = %s\n", arg) ; \
       return NULL; \
       } 
   
  @@ -663,7 +690,7 @@
       pDirCfg -> save_##STRUCT##NAME = ap_pstrdup(cmd -> pool, arg) ; \
       pDirCfg -> set_##STRUCT##NAME = 1 ; \
       if (bApDebug) \
  -        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" = %s (save for later conversion to Perl data)\n", arg) ; \
  +        aplog_error (APLOG_MARK, APLOG_WARNING | APLOG_NOERRNO, NULL, "Embperl: Set 
"#CFGNAME" (type="#TYPE") = %s (save for later conversion to Perl data)\n", arg) ; \
       return NULL ; \
       } 
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to