/*
 * This file was generated automatically by ExtUtils::ParseXS version 2.18 from the
 * contents of Customize.xs. Do not edit this file, edit Customize.xs instead.
 *
 *	ANY CHANGES MADE HERE WILL BE LOST! 
 *
 */

#line 1 "Customize.xs"
/* Copyright (c) 1997-2006			 -*- C -*-
   Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany)
   http://www.math.tu-berlin.de/polymake,  mailto:polymake@math.tu-berlin.de

   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 2, or (at your option) any
   later version: http://www.gnu.org/licenses/gpl.txt.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
*/

#ident "$Project: polymake $$Id: Customize.xs 6714 2006-01-11 15:24:36Z gawrilow $"

#include "Ext.h"
#include <stdio.h>

typedef OP* (*op_func)(pTHX);

static op_func saved_op_sassign, saved_op_aassign;
static SV *scalar_pkg, *array_pkg, *hash_pkg;

static
OP* custom_op_sassign(pTHX)
{
   dSP;
   SV *var=TOPs;
   OP *ret=(*saved_op_sassign)(aTHX);
   if (!(SvFLAGS(var) & (SVs_TEMP | SVs_PADMY | SVs_GMG | SVs_SMG | SVs_RMG))) {
      SPAGAIN;
      PUSHMARK(PL_stack_sp);
      PUSHs(var);
      PUSHs(scalar_pkg);
      XPUSHs(var);
      PUTBACK;
      pp_tie();
   }
   return ret;
}

static
OP* custom_op_aassign(pTHX)
{
   dSP;
   SV *var=TOPs;
   OP *ret=(*saved_op_aassign)(aTHX);
   if (!(SvFLAGS(var) & (SVs_TEMP | SVs_PADMY | SVs_GMG | SVs_SMG | SVs_RMG))) {
      SPAGAIN;
      PUSHMARK(PL_stack_sp);
      PUSHs(var);
      PUSHs(SvTYPE(var)==SVt_PVAV ? array_pkg : hash_pkg);
      XPUSHs(sv_2mortal(newRV(var)));
      PUTBACK;
      pp_tie();
   }
   return ret;
}


#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#line 77 "Customize.c"

XS(XS_Poly__Customize_compile_start); /* prototype to pass -Wmissing-prototypes */
XS(XS_Poly__Customize_compile_start)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 0)
       Perl_croak(aTHX_ "Usage: %s(%s)", "Poly::Customize::compile_start", "");
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 70 "Customize.xs"
{
   saved_op_sassign=PL_ppaddr[OP_SASSIGN];
   saved_op_aassign=PL_ppaddr[OP_AASSIGN];
   PL_ppaddr[OP_SASSIGN]=&custom_op_sassign;
   PL_ppaddr[OP_AASSIGN]=&custom_op_aassign;
}
#line 100 "Customize.c"
	PUTBACK;
	return;
    }
}


XS(XS_Poly__Customize_compile_end); /* prototype to pass -Wmissing-prototypes */
XS(XS_Poly__Customize_compile_end)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    if (items != 0)
       Perl_croak(aTHX_ "Usage: %s(%s)", "Poly::Customize::compile_end", "");
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 80 "Customize.xs"
{
   PL_ppaddr[OP_SASSIGN]=saved_op_sassign;
   PL_ppaddr[OP_AASSIGN]=saved_op_aassign;
}
#line 126 "Customize.c"
	PUTBACK;
	return;
    }
}

#ifdef __cplusplus
extern "C"
#endif
XS(boot_Poly__Customize); /* prototype to pass -Wmissing-prototypes */
XS(boot_Poly__Customize)
{
#ifdef dVAR
    dVAR; dXSARGS;
#else
    dXSARGS;
#endif
    char* file = __FILE__;

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    XS_VERSION_BOOTCHECK ;

        newXS("Poly::Customize::compile_start", XS_Poly__Customize_compile_start, file);
        newXS("Poly::Customize::compile_end", XS_Poly__Customize_compile_end, file);

    /* Initialisation Section */

#line 86 "Customize.xs"
   scalar_pkg=newSVpvn_share("Poly::Customize::Scalar", 23, 0);
   array_pkg=newSVpvn_share("Poly::Customize::Array", 22, 0);
   hash_pkg=newSVpvn_share("Poly::Customize::Hash", 21, 0);

#line 159 "Customize.c"

    /* End of Initialisation Section */

    XSRETURN_YES;
}



syntax highlighted by Code2HTML, v. 0.9.1