You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2001/11/12 13:45:41 UTC

cvs commit: embperl/driver eplibxslt.MAKEPL

richter     01/11/12 04:45:41

  Modified:    .        Tag: Embperl2c Makefile.PL epcache.c epcomp.c
                        epdom.c epdom.h epnames.h epprovider.c
               Embperl  Tag: Embperl2c Recipe.pm
               driver   Tag: Embperl2c eplibxslt.MAKEPL
  Log:
  Embperl 2 - memory debug support
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.31.4.35 +17 -3     embperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/embperl/Makefile.PL,v
  retrieving revision 1.31.4.34
  retrieving revision 1.31.4.35
  diff -u -r1.31.4.34 -r1.31.4.35
  --- Makefile.PL	2001/11/11 19:19:50	1.31.4.34
  +++ Makefile.PL	2001/11/12 12:45:39	1.31.4.35
  @@ -3,7 +3,7 @@
   #
   # (C) 1997-2001 G.Richter (richter@dev.ecos.de) / ECOS
   #
  -# $Id: Makefile.PL,v 1.31.4.34 2001/11/11 19:19:50 richter Exp $
  +# $Id: Makefile.PL,v 1.31.4.35 2001/11/12 12:45:39 richter Exp $
   #
   
   
  @@ -435,6 +435,8 @@
   
   $ccdebug = '' ;
   $lddebug = '' ;
  +$libs    = '' ;
  +$d       = '' ;
   
   if ($ARGV[0] eq 'debug')
       {
  @@ -451,6 +453,19 @@
           }
       }
   
  +if ($ARGV[0] eq 'dmalloc')
  +    {
  +    shift @ARGV;
  +    if ($win32)
  +        {
  +        }
  +    else
  +        {
  +        $libs .= '-L/usr/local/lib -ldmalloc' ;
  +        $d    .= '-DDMALLOC' ;
  +        }
  +    }
  +
   if (defined ($ARGV[0]) && ($ARGV[0] =~ /^\W/))
       {
       $apache = 2 ;
  @@ -627,7 +642,7 @@
           $i = "-I$inc_dir -I$apache_src/regex -I$apache_src/os/unix" ; 
           $o = '' ;
           }
  -    $d = "-DAPACHE" ;
  +    $d .= ' -DAPACHE' ;
       $EPNOAPACHELIB = 0 ;
       }
   else
  @@ -642,7 +657,6 @@
   
       print "Will build without mod_perl support\n" ;
       $i = '' ;
  -    $d = '' ;
       $o = '' ;
       }
   		
  
  
  
  1.1.2.12  +17 -2     embperl/Attic/epcache.c
  
  Index: epcache.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcache.c,v
  retrieving revision 1.1.2.11
  retrieving revision 1.1.2.12
  diff -u -r1.1.2.11 -r1.1.2.12
  --- epcache.c	2001/11/10 15:21:28	1.1.2.11
  +++ epcache.c	2001/11/12 12:45:39	1.1.2.12
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epcache.c,v 1.1.2.11 2001/11/10 15:21:28 richter Exp $
  +#   $Id: epcache.c,v 1.1.2.12 2001/11/12 12:45:39 richter Exp $
   #
   ###################################################################################*/
   
  @@ -754,7 +754,10 @@
           {
           if (pItem -> pProvider -> pProviderClass -> fGetContentSV)
               if ((rc = ((*pItem -> pProvider -> pProviderClass -> fGetContentSV) (r, pItem -> pProvider, pData))) != ok)
  -                return rc ;
  +		{
  +                Cache_FreeContent (r, pItem)  ;
  +		return rc ;
  +		}
           Cache_SetNotExpired (r, pItem) ;
           pItem -> pSVData = *pData ;
           }
  @@ -814,7 +817,10 @@
               lprintf (r, "[%d]CACHE: %s get from provider\n", r -> nPid,  pItem -> sKey) ; 
           if (pItem -> pProvider -> pProviderClass -> fGetContentPtr)
               if ((rc = (*pItem -> pProvider -> pProviderClass -> fGetContentPtr) (r, pItem -> pProvider, pData)) != ok)
  +		{
  +                Cache_FreeContent (r, pItem)  ;
                   return rc ;
  +		}
           pItem -> pData = *pData ;
           Cache_SetNotExpired (r, pItem) ;
           }
  @@ -872,7 +878,10 @@
               lprintf (r, "[%d]CACHE: %s get from provider\n", r -> nPid,  pItem -> sKey) ; 
           if (pItem -> pProvider -> pProviderClass -> fGetContentIndex)
               if ((rc = (*pItem -> pProvider -> pProviderClass -> fGetContentIndex) (r, pItem -> pProvider, pData)) != ok)
  +		{
  +                Cache_FreeContent (r, pItem)  ;
                   return rc ;
  +		}
           pItem -> xData = *pData ;
           Cache_SetNotExpired (r, pItem) ;
           }
  @@ -937,7 +946,10 @@
               lprintf (r, "[%d]CACHE: %s get from provider\n", r -> nPid,  pItem -> sKey) ; 
           if (pItem -> pProvider -> pProviderClass -> fGetContentIndex)
               if ((rc = (*pItem -> pProvider -> pProviderClass -> fGetContentIndex) (r, pItem -> pProvider, pData)) != ok)
  +		{
  +                Cache_FreeContent (r, pItem)  ;
                   return rc ;
  +		}
           pItem -> xData = *pData ;
           bUpdate = TRUE ;
           }
  @@ -950,7 +962,10 @@
               lprintf (r, "[%d]CACHE: %s get from provider\n", r -> nPid,  pItem -> sKey) ; 
           if (pItem -> pProvider -> pProviderClass -> fGetContentSV)
               if ((rc = (*pItem -> pProvider -> pProviderClass -> fGetContentSV) (r, pItem -> pProvider, pSVData)) != ok)
  +		{
  +                Cache_FreeContent (r, pItem)  ;
                   return rc ;
  +		}
           pItem -> pSVData = *pSVData ;
           bUpdate = TRUE ;
           }
  
  
  
  1.4.2.73  +18 -13    embperl/Attic/epcomp.c
  
  Index: epcomp.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcomp.c,v
  retrieving revision 1.4.2.72
  retrieving revision 1.4.2.73
  diff -u -r1.4.2.72 -r1.4.2.73
  --- epcomp.c	2001/11/12 08:44:29	1.4.2.72
  +++ epcomp.c	2001/11/12 12:45:39	1.4.2.73
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epcomp.c,v 1.4.2.72 2001/11/12 08:44:29 richter Exp $
  +#   $Id: epcomp.c,v 1.4.2.73 2001/11/12 12:45:39 richter Exp $
   #
   ###################################################################################*/
   
  @@ -1335,7 +1335,6 @@
       int		    nCheckpointCodeOffset = 0 ;               
       int		    nCheckpointArrayOffset = 0 ;               
       tEmbperlCompilerInfo * pInfo = (tEmbperlCompilerInfo *)(*(void * *)r -> pTokenTable) ;
  -    tIndex          xDomTree = pDomTree -> xNdx ;
   
       pCmd = NULL ;
       
  @@ -1401,7 +1400,6 @@
                   while (pChild)
                       {
                       embperl_CompileNode (r, pDomTree, pChild -> xNdx, bCheckpointPending) ;
  -	            pDomTree = DomTree_self (xDomTree) ; /* addr may have changed */
                       pNext = Node_selfNextSibling (pDomTree, pChild, 0) ;
                       if (pChild -> bFlags == 0)
                           Node_selfRemoveChild(pDomTree, -1, pChild) ;
  @@ -1417,8 +1415,7 @@
   	{
   	if ((rc = embperl_CompileCmd (r, pDomTree, pNode, pCmd, &nStartCodeOffset)) != ok)
   	    return rc ;
  -	pDomTree = DomTree_self (xDomTree) ; /* addr may have changed */
  -        pCmd = pCmd -> pNext ;
  +	pCmd = pCmd -> pNext ;
   	}
   
       pCmd = pCmdHead ;
  @@ -1438,7 +1435,6 @@
   	    if ((rc = embperl_CompileNode (r, pDomTree, xChildNode, bCheckpointPending)) != ok)
   		return rc ;
   
  -	    pDomTree = DomTree_self (xDomTree) ; /* addr may have changed */
   	    pChildNode = Node_self (pDomTree, xChildNode) ;
               xChildNode  = Node_nextSibling (pDomTree, xChildNode, 0) ;
               if (pChildNode -> bFlags == 0)
  @@ -1484,7 +1480,6 @@
       {
       int rc ;
       int         bCheckpointPending = 0 ;
  -    tIndex      xDomTree = pDomTree -> xNdx ;
   
   
       pDomTree -> xCurrNode = 0 ;
  @@ -1492,8 +1487,6 @@
       if ((rc = embperl_CompileNode (r, pDomTree, pDomTree -> xDocument, &bCheckpointPending)) != ok)
   	return rc ;
   
  -    pDomTree = DomTree_self (xDomTree) ; /* addr may have changed */
  -
       if (bCheckpointPending)
   	{
   	int l ;
  @@ -1544,9 +1537,6 @@
       else if (nStep > 4096)
           nStep = 4096 ;
   
  -    if (r -> bDebug & dbgCompile)
  -	lprintf (r, "[%d]EPCOMP: Start compiling %s DomTree = %d\n", r -> nPid, r -> Buf.pFile -> sSourcefile, xDomTree) ; 
  -
       r -> nPhase  = phCompile ;
   
       r -> pProgRun = NULL ;
  @@ -1557,7 +1547,10 @@
       r -> pProg = &r -> pProgRun ;
   
       pDomTree -> pSV = (SV *)newHV () ;
  -    ArrayNew (&pDomTree -> pCheckpoints, 256, sizeof (tDomTreeCheckpoint)) ;
  +    if (pDomTree -> pCheckpoints)
  +	ArraySetSize (&pDomTree -> pCheckpoints, 0) ;
  +    else
  +	ArrayNew (&pDomTree -> pCheckpoints, 256, sizeof (tDomTreeCheckpoint)) ;
       ArrayAdd (&pDomTree -> pCheckpoints, 1) ;
       pDomTree -> pCheckpoints[0].xNode = 0 ;
   
  @@ -1575,11 +1568,15 @@
   	*/
           StringFree (&r -> pProgRun) ;
   	StringFree (&r -> pProgDef) ;
  +	ArrayFree (&pDomTree -> pCheckpoints) ;
   	
  +	pDomTree = DomTree_self (xDomTree) ;
  +	DomTree_Delete (pDomTree) ;
  +	*pxResultDomTree = 0 ;
  +
   	return rc ;
   	}
   
  -    pDomTree = DomTree_self (xDomTree) ; /* addr may have changed */
       SvREFCNT_dec (pDomTree -> pSV) ;
       pDomTree -> pSV = NULL ;
   
  @@ -1644,6 +1641,14 @@
   	    
       StringFree (&r -> pProgRun) ;
       StringFree (&r -> pProgDef) ;
  +
  +    if (rc != ok && xDomTree)
  +	{
  +	pDomTree = DomTree_self (xDomTree) ;
  +	if (pDomTree)
  +	    DomTree_Delete (pDomTree) ;
  +	*pxResultDomTree = 0 ;
  +	}
   
       cl4 = clock () ;
   
  
  
  
  1.4.2.71  +58 -6     embperl/Attic/epdom.c
  
  Index: epdom.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.c,v
  retrieving revision 1.4.2.70
  retrieving revision 1.4.2.71
  diff -u -r1.4.2.70 -r1.4.2.71
  --- epdom.c	2001/11/12 08:44:29	1.4.2.70
  +++ epdom.c	2001/11/12 12:45:39	1.4.2.71
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdom.c,v 1.4.2.70 2001/11/12 08:44:29 richter Exp $
  +#   $Id: epdom.c,v 1.4.2.71 2001/11/12 12:45:39 richter Exp $
   #
   ###################################################################################*/
   
  @@ -194,7 +194,26 @@
       return m ;
       }
   
  +#ifdef DMALLOC
   
  +void * str_malloc_dbg (size_t  n, char * fn, int l)
  +    {
  +    void * m = _malloc_leap(fn, l, n + sizeof (size_t)) ;
  +    size_t * m_size;
  +    if (m)
  +	{
  +	nMemUsage += n ;
  +	/* make the following in multiple step, so sun-cc is happy... */
  +	m_size = (size_t *) m;
  +	*m_size = n;
  +	m_size++;
  +	m = (void *) m_size ;
  +	}
  +
  +    return m ;
  +    }
  +
  +#endif
   
   void * str_realloc (void * s, size_t  n)
       {
  @@ -259,16 +278,28 @@
   *                                                                          
   * ------------------------------------------------------------------------ */
   
  +#ifdef DMALLOC
  +int ArrayNew_dbg (/*in*/ const tArray * pArray,
  +	      /*in*/ int	nAdd,
  +	      /*in*/ int	nElementSize,
  +	      /*in*/ char *     sFile,
  +	      /*in*/ int        nLine) 
  +#else
   int ArrayNew (/*in*/ const tArray * pArray,
   	      /*in*/ int	nAdd,
   	      /*in*/ int	nElementSize)
  -
  +#endif
   
       {
       struct tArrayCtrl * pNew ;
       
  +#ifdef DMALLOC
  +    if ((pNew = str_malloc_dbg (nAdd * nElementSize + sizeof (struct tArrayCtrl), sFile, nLine)) == NULL)
  +	return 0 ;
  +#else
       if ((pNew = str_malloc (nAdd * nElementSize + sizeof (struct tArrayCtrl))) == NULL)
   	return 0 ;
  +#endif
       
       memset (pNew, 0, nAdd * nElementSize + sizeof (struct tArrayCtrl)) ; 
       *(void * *)pArray = (struct tArray *)(pNew + 1) ;
  @@ -276,7 +307,10 @@
       pNew -> nAdd = nAdd ;
       pNew -> nFill = 0  ;
       pNew -> nElementSize = nElementSize  ;
  -
  +#ifdef DMALLOC
  +    strncpy (pNew -> sFile, sFile, sizeof (pNew -> sFile)) ;
  +    pNew -> nLine = nLine ;
  +#endif
       return ok ;
       }
   
  @@ -306,16 +340,28 @@
   *                                                                          
   * ------------------------------------------------------------------------ */
   
  +#ifdef DMALLOC
  +int ArrayNewZero_dbg (/*in*/ const tArray * pArray,
  +	      /*in*/ int	nAdd,
  +	      /*in*/ int	nElementSize,
  +	      /*in*/ char *     sFile,
  +	      /*in*/ int        nLine) 
  +#else
   int ArrayNewZero (/*in*/ const tArray * pArray,
   	      /*in*/ int	nAdd,
   	      /*in*/ int	nElementSize)
  -
  +#endif
   
       {
       struct tArrayCtrl * pNew ;
       
  +#ifdef DMALLOC
  +    if ((pNew = str_malloc_dbg (nAdd * nElementSize + sizeof (struct tArrayCtrl), sFile, nLine)) == NULL)
  +	return 0 ;
  +#else
       if ((pNew = str_malloc (nAdd * nElementSize + sizeof (struct tArrayCtrl))) == NULL)
   	return 0 ;
  +#endif
       
       memset (pNew, 0, nAdd * nElementSize + sizeof (struct tArrayCtrl)) ; 
       *(void * *)pArray = (struct tArray *)(pNew + 1) ;
  @@ -323,6 +369,10 @@
       pNew -> nAdd = nAdd ;
       pNew -> nFill = 0  ;
       pNew -> nElementSize = nElementSize  ;
  +#ifdef DMALLOC
  +    strncpy (pNew -> sFile, sFile, sizeof (pNew -> sFile)) ;
  +    pNew -> nLine = nLine ;
  +#endif
   
       memset (pNew+1, 0, nAdd * nElementSize) ;
   
  @@ -974,7 +1024,9 @@
   	    if (pNode -> nText)
   		NdxStringFree (pNode -> nText) ;
   	    
  -	    if ((pLookupLevelNode = pLookup ->  pLookupLevel) && pLookupLevelNode -> xNullNode == pNode -> xNdx)
  +	    dom_free (pNode, &numNodes) ;
  +
  +	    if (pLookupLevelNode = pLookup ->  pLookupLevel)
   		{
   		pLookupLevelNodeLevel = pLookupLevelNode -> items ;
   		n = pLookupLevelNode -> numItems ;
  @@ -993,7 +1045,7 @@
   		
   		dom_free_size (pLookupLevelNode, sizeof (tRepeatLevelLookup)  + sizeof (tRepeatLevelLookupItem) * pLookupLevelNode -> numItems, &numLevelLookup) ;
   		}
  -            dom_free (pNode, &numNodes) ;
  +
   	    }
   
   	pLookup-- ;
  
  
  
  1.4.2.43  +23 -1     embperl/Attic/epdom.h
  
  Index: epdom.h
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epdom.h,v
  retrieving revision 1.4.2.42
  retrieving revision 1.4.2.43
  diff -u -r1.4.2.42 -r1.4.2.43
  --- epdom.h	2001/11/07 21:11:26	1.4.2.42
  +++ epdom.h	2001/11/12 12:45:40	1.4.2.43
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epdom.h,v 1.4.2.42 2001/11/07 21:11:26 richter Exp $
  +#   $Id: epdom.h,v 1.4.2.43 2001/11/12 12:45:40 richter Exp $
   #
   ###################################################################################*/
   
  @@ -17,6 +17,10 @@
   
   struct tArrayCtrl
       {
  +#ifdef DMALLOC
  +    int	    nLine ;
  +    char    sFile [128] ;
  +#endif
       int	    nFill ;	    /* index of last element */
       int	    nMax ;	    /* number of last element for which is space */
       int	    nAdd ;	    /* number of elements to add on grow */
  @@ -262,6 +266,23 @@
   #define NdxStringRefcntInc(nNdx) (SvREFCNT_inc (HeVAL (pStringTableArray[nNdx])))
   
   
  +#ifdef DMALLOC
  +int ArrayNew_dbg (/*in*/ const tArray * pArray,
  +	      /*in*/ int	nAdd,
  +	      /*in*/ int	nElementSize,
  +	      /*in*/ char *     sFile,
  +	      /*in*/ int        nLine) ;
  +int ArrayNewZero_dbg (/*in*/ const tArray * pArray,
  +	      /*in*/ int	nAdd,
  +	      /*in*/ int	nElementSize,
  +	      /*in*/ char *     sFile,
  +	      /*in*/ int        nLine) ;
  +
  +#define ArrayNew(a,n,s) ArrayNew_dbg(a,n,s,__FILE__,__LINE__)
  +#define ArrayNewZero(a,n,s) ArrayNewZero_dbg(a,n,s,__FILE__,__LINE__)
  +
  +#else
  +
   int ArrayNew (/*in*/ const tArray * pArray,
   	      /*in*/ int	nAdd,
   	      /*in*/ int	nElementSize) ;
  @@ -269,6 +290,7 @@
   int ArrayNewZero (/*in*/ const tArray * pArray,
   	      /*in*/ int	nAdd,
   	      /*in*/ int	nElementSize) ;
  +#endif
   
   int ArrayFree (/*in*/ const tArray * pArray) ;
   
  
  
  
  1.19.4.12 +4 -1      embperl/epnames.h
  
  Index: epnames.h
  ===================================================================
  RCS file: /home/cvs/embperl/epnames.h,v
  retrieving revision 1.19.4.11
  retrieving revision 1.19.4.12
  diff -u -r1.19.4.11 -r1.19.4.12
  --- epnames.h	2001/11/12 08:44:29	1.19.4.11
  +++ epnames.h	2001/11/12 12:45:40	1.19.4.12
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epnames.h,v 1.19.4.11 2001/11/12 08:44:29 richter Exp $
  +#   $Id: epnames.h,v 1.19.4.12 2001/11/12 12:45:40 richter Exp $
   #
   ###################################################################################*/
   
  @@ -121,7 +121,10 @@
   #define ArrayClone		    EMBPERL_ArrayClone		   
   #define ArrayFree		    EMBPERL_ArrayFree		   
   #define ArrayGetSize		    EMBPERL_ArrayGetSize		   
  +#ifndef DMALLOC
   #define ArrayNew		    EMBPERL_ArrayNew		   
  +#define ArrayNewZero		    EMBPERL_ArrayNewZero
  +#endif
   #define ArraySet		    EMBPERL_ArraySet		   
   #define ArraySetSize		    EMBPERL_ArraySetSize		   
   #define ArraySub		    EMBPERL_ArraySub		   
  @@ -351,7 +354,7 @@
   #undef apache_mode_t
   #endif
   
  -#ifdef xxxapache_stat
  +#ifdef apache_stat
   #undef stat
   #define stat apache_stat
   #undef apache_stat
  
  
  
  1.1.2.9   +2 -0      embperl/Attic/epprovider.c
  
  Index: epprovider.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epprovider.c,v
  retrieving revision 1.1.2.8
  retrieving revision 1.1.2.9
  diff -u -r1.1.2.8 -r1.1.2.9
  --- epprovider.c	2001/11/12 07:32:22	1.1.2.8
  +++ epprovider.c	2001/11/12 12:45:40	1.1.2.9
  @@ -9,7 +9,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: epprovider.c,v 1.1.2.8 2001/11/12 07:32:22 richter Exp $
  +#   $Id: epprovider.c,v 1.1.2.9 2001/11/12 12:45:40 richter Exp $
   #
   ###################################################################################*/
   
  @@ -708,6 +708,8 @@
       if ((rc = Provider_NewDependOne (r, sizeof(tProviderEpParse), "source", pItem, pProviderClass, pParam)) != ok)
           return rc ;
   
  +    pItem -> bCache = FALSE ; /* do not cache, because it's cached by the compiler */
  +    
       return ok ;
       }
   
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +16 -50    embperl/Embperl/Attic/Recipe.pm
  
  Index: Recipe.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Recipe.pm,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- Recipe.pm	2001/11/12 07:32:23	1.1.2.1
  +++ Recipe.pm	2001/11/12 12:45:40	1.1.2.2
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Recipe.pm,v 1.1.2.1 2001/11/12 07:32:23 richter Exp $
  +#   $Id: Recipe.pm,v 1.1.2.2 2001/11/12 12:45:40 richter Exp $
   #
   ###################################################################################
    
  @@ -32,66 +32,32 @@
   sub GetRecipe
   
       {
  -    my ($name, $oldname) = @_ ;
  +    my ($param, $name) = @_ ;
   
  -    my %names ;
  -    my $op = '' ;
  -    if ($name =~ /^(\+|\-)\s*(.*?)$/)
  -        {
  -        $op   = $1 ;
  -        $name = $2;
  -        }
  -    $name = "$oldname $name" if ($op eq '+') ;
  -
  -    my @split = split (/\s/, $name) ;
  -    if ($op eq '-')
  +    my @names = split (/\s/, $name) ;
  +    
  +    foreach $recipe (@names)
           {
  -        my @mnames = map { /::/?$_:'HTML::Embperl::Recipe::'. $_ } @split  ;
  -        foreach (@mnames)
  +        if (exists ($Recipes{$recipe})) 
               {
  -            $names{$_} = 1 ;
  +            my $obj = $Recipes{$recipe} ;
  +            next if (!$obj -> CanHandle ($param) ;
  +            return $obj ;
               }
  -        @split = split (/\s/, $oldname) ;
  -        }                
  -    
  -    my @xnames = map { /::/?$_:'HTML::Embperl::Recipe::'. $_ } @split  ;
  -    my @names ;
  -    foreach (@xnames)
  -        {
  -        push @names, $1 if (!$names{$_} && (/^\s*([a-zA-Z_0-9:]+)\s*$/)) ;
  -        $names{$_} = 1 ;
  -        }
  -            
  -    $name = join (' ', @names) ;
  -
  -    print HTML::Embperl::LOG "[$$]RECIPE: switch to $name\n" ; 
  -
  -    return undef if (!$name) ;
  -    return $Recipes{$name} if (exists ($Recipes{$name})) ;
  -
  -    foreach my $n (@names)
  -        {
  -        eval "require $n" ;
  +        my $mod = ($name =~ /::/)?$recipe:'HTML::Embperl::Recipe::'. $recipe ;
  +        eval "require $mod" ;
           if ($@) 
               {
               warn $@ ;
               return undef ;
               }
  -        }
  -
  -    my $first = shift @names ;
  -
  -    my $self = $first -> new ;
  -
  -    foreach my $n (@names)
  -        {
   no strict ;
  -        &{"${n}::new"}($self) ;
  +        my $obj = $Recipes{$recipe} = $mod -> new ($recipe, $param) ;
   use strict ;
  +        next if (!$obj -> CanHandle ($param) ;
  +        return $obj ;
           }
  -
  -    $self -> {-name} = $name ;
  -
  -    $Recipes{$name} = $self ;
  -    return $self ;
  +        
  +    return undef ;                
       }
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.4   +8 -0      embperl/driver/Attic/eplibxslt.MAKEPL
  
  Index: eplibxslt.MAKEPL
  ===================================================================
  RCS file: /home/cvs/embperl/driver/Attic/eplibxslt.MAKEPL,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- eplibxslt.MAKEPL	2001/09/20 20:26:05	1.1.2.3
  +++ eplibxslt.MAKEPL	2001/11/12 12:45:40	1.1.2.4
  @@ -2,6 +2,14 @@
   
   $win32 = ($^O eq 'MSWin32') ;
   
  +my $prefix  ;
  +my $prefix2  ;
  +my $libs  ;
  +my $libs2  ;
  +my $cflags  ;
  +my $cflags2  ;
  +my $version ;
  +my $version2 ;
   
   if (!$win32)
       {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org