     1			/*
     2			 * This file was generated automatically by ExtUtils::ParseXS version 2.10 from the
     3			 * contents of Syslog.xs. Do not edit this file, edit Syslog.xs instead.
     4			 *
     5			 *	ANY CHANGES MADE HERE WILL BE LOST! 
     6			 *
     7			 */
     8			
     9			#line 1 "Syslog.xs"
    10			#include "EXTERN.h"
    11			#include "perl.h"
    12			#include "XSUB.h"
    13			
    14			#ifdef I_SYSLOG
    15			#include <syslog.h>
    16			#endif
    17			
    18			#include "const-c.inc"
    19			
    20			#ifndef PERL_UNUSED_VAR
    21			#  define PERL_UNUSED_VAR(var) if (0) var = var
    22			#endif
    23			
    24			#line 25 "Syslog.c"
    25			
    26			/* INCLUDE:  Including 'const-xs.inc' from 'Syslog.xs' */
    27			
    28			
    29			XS(XS_Sys__Syslog_constant); /* prototype to pass -Wmissing-prototypes */
    30			XS(XS_Sys__Syslog_constant)
    31	           5    {
    32	           5        dXSARGS;
    33	           5        if (items != 1)
    34	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::constant(sv)");
    35	           5        PERL_UNUSED_VAR(cv); /* -W */
    36	           5        PERL_UNUSED_VAR(ax); /* -Wall */
    37	           5        SP -= items;
    38			    {
    39			#line 4 "Syslog.xs"
    40			#ifdef dXSTARG
    41				dXSTARG; /* Faster if we have it.  */
    42			#else
    43				dTARGET;
    44			#endif
    45				STRLEN		len;
    46			        int		type;
    47				IV		iv;
    48				/* NV		nv;	Uncomment this if you need to return NVs */
    49				const char	*pv;
    50			#line 51 "Syslog.c"
    51	           5    	SV *	sv = ST(0);
    52	           5    	const char *	s = SvPV(sv, len);
    53			#line 18 "Syslog.xs"
    54			        /* Change this to constant(aTHX_ s, len, &iv, &nv);
    55			           if you need to return both NVs and IVs */
    56				type = constant(aTHX_ s, len, &iv, &pv);
    57			      /* Return 1 or 2 items. First is error message, or undef if no error.
    58			           Second, if present, is found value */
    59			        switch (type) {
    60			        case PERL_constant_NOTFOUND:
    61			          sv = sv_2mortal(newSVpvf("%s is not a valid Sys::Syslog macro", s));
    62			          PUSHs(sv);
    63			          break;
    64			        case PERL_constant_NOTDEF:
    65			          sv = sv_2mortal(newSVpvf(
    66				    "Your vendor has not defined Sys::Syslog macro %s, used", s));
    67			          PUSHs(sv);
    68			          break;
    69			        case PERL_constant_ISIV:
    70			          EXTEND(SP, 1);
    71			          PUSHs(&PL_sv_undef);
    72			          PUSHi(iv);
    73			          break;
    74				/* Uncomment this if you need to return NOs
    75			        case PERL_constant_ISNO:
    76			          EXTEND(SP, 1);
    77			          PUSHs(&PL_sv_undef);
    78			          PUSHs(&PL_sv_no);
    79			          break; */
    80				/* Uncomment this if you need to return NVs
    81			        case PERL_constant_ISNV:
    82			          EXTEND(SP, 1);
    83			          PUSHs(&PL_sv_undef);
    84			          PUSHn(nv);
    85			          break; */
    86			        case PERL_constant_ISPV:
    87			          EXTEND(SP, 1);
    88			          PUSHs(&PL_sv_undef);
    89			          PUSHp(pv, strlen(pv));
    90			          break;
    91				/* Uncomment this if you need to return PVNs
    92			        case PERL_constant_ISPVN:
    93			          EXTEND(SP, 1);
    94			          PUSHs(&PL_sv_undef);
    95			          PUSHp(pv, iv);
    96			          break; */
    97				/* Uncomment this if you need to return SVs
    98			        case PERL_constant_ISSV:
    99			          EXTEND(SP, 1);
   100			          PUSHs(&PL_sv_undef);
   101			          PUSHs(sv);
   102			          break; */
   103				/* Uncomment this if you need to return UNDEFs
   104			        case PERL_constant_ISUNDEF:
   105			          break; */
   106				/* Uncomment this if you need to return UVs
   107			        case PERL_constant_ISUV:
   108			          EXTEND(SP, 1);
   109			          PUSHs(&PL_sv_undef);
   110			          PUSHu((UV)iv);
   111			          break; */
   112				/* Uncomment this if you need to return YESs
   113			        case PERL_constant_ISYES:
   114			          EXTEND(SP, 1);
   115			          PUSHs(&PL_sv_undef);
   116			          PUSHs(&PL_sv_yes);
   117			          break; */
   118			        default:
   119			          sv = sv_2mortal(newSVpvf(
   120				    "Unexpected return type %d while processing Sys::Syslog macro %s, used",
   121			               type, s));
   122			          PUSHs(sv);
   123			        }
   124			#line 125 "Syslog.c"
   125	           5    	PUTBACK;
   126				return;
   127			    }
   128			}
   129			
   130			
   131			/* INCLUDE: Returning to 'Syslog.xs' from 'const-xs.inc' */
   132			
   133			
   134			XS(XS_Sys__Syslog_LOG_FAC); /* prototype to pass -Wmissing-prototypes */
   135			XS(XS_Sys__Syslog_LOG_FAC)
   136	      ######    {
   137	      ######        dXSARGS;
   138	      ######        if (items != 1)
   139	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::LOG_FAC(p)");
   140	      ######        PERL_UNUSED_VAR(cv); /* -W */
   141			    {
   142	      ######    	int	p = (int)SvIV(ST(0));
   143	      ######    	int	RETVAL;
   144	      ######    	dXSTARG;
   145			#line 20 "Syslog.xs"
   146			#ifdef LOG_FAC
   147				RETVAL = LOG_FAC(p);
   148			#else
   149				croak("Your vendor has not defined the Sys::Syslog macro LOG_FAC");
   150				RETVAL = -1;
   151			#endif
   152			#line 153 "Syslog.c"
   153	      ######    	XSprePUSH; PUSHi((IV)RETVAL);
   154			    }
   155	      ######        XSRETURN(1);
   156			}
   157			
   158			
   159			XS(XS_Sys__Syslog_LOG_PRI); /* prototype to pass -Wmissing-prototypes */
   160			XS(XS_Sys__Syslog_LOG_PRI)
   161	      ######    {
   162	      ######        dXSARGS;
   163	      ######        if (items != 1)
   164	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::LOG_PRI(p)");
   165	      ######        PERL_UNUSED_VAR(cv); /* -W */
   166			    {
   167	      ######    	int	p = (int)SvIV(ST(0));
   168	      ######    	int	RETVAL;
   169	      ######    	dXSTARG;
   170			#line 34 "Syslog.xs"
   171			#ifdef LOG_PRI
   172				RETVAL = LOG_PRI(p);
   173			#else
   174				croak("Your vendor has not defined the Sys::Syslog macro LOG_PRI");
   175				RETVAL = -1;
   176			#endif
   177			#line 178 "Syslog.c"
   178	      ######    	XSprePUSH; PUSHi((IV)RETVAL);
   179			    }
   180	      ######        XSRETURN(1);
   181			}
   182			
   183			
   184			XS(XS_Sys__Syslog_LOG_MAKEPRI); /* prototype to pass -Wmissing-prototypes */
   185			XS(XS_Sys__Syslog_LOG_MAKEPRI)
   186	      ######    {
   187	      ######        dXSARGS;
   188	      ######        if (items != 2)
   189	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::LOG_MAKEPRI(fac, pri)");
   190	      ######        PERL_UNUSED_VAR(cv); /* -W */
   191			    {
   192	      ######    	int	fac = (int)SvIV(ST(0));
   193	      ######    	int	pri = (int)SvIV(ST(1));
   194	      ######    	int	RETVAL;
   195	      ######    	dXSTARG;
   196			#line 49 "Syslog.xs"
   197			#ifdef LOG_MAKEPRI
   198				RETVAL = LOG_MAKEPRI(fac,pri);
   199			#else
   200				croak("Your vendor has not defined the Sys::Syslog macro LOG_MAKEPRI");
   201				RETVAL = -1;
   202			#endif
   203			#line 204 "Syslog.c"
   204	      ######    	XSprePUSH; PUSHi((IV)RETVAL);
   205			    }
   206	      ######        XSRETURN(1);
   207			}
   208			
   209			
   210			XS(XS_Sys__Syslog_LOG_MASK); /* prototype to pass -Wmissing-prototypes */
   211			XS(XS_Sys__Syslog_LOG_MASK)
   212	           1    {
   213	           1        dXSARGS;
   214	           1        if (items != 1)
   215	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::LOG_MASK(pri)");
   216	           1        PERL_UNUSED_VAR(cv); /* -W */
   217			    {
   218	           1    	int	pri = (int)SvIV(ST(0));
   219	           1    	int	RETVAL;
   220	           1    	dXSTARG;
   221			#line 63 "Syslog.xs"
   222			#ifdef LOG_MASK
   223				RETVAL = LOG_MASK(pri);
   224			#else
   225				croak("Your vendor has not defined the Sys::Syslog macro LOG_MASK");
   226				RETVAL = -1;
   227			#endif
   228			#line 229 "Syslog.c"
   229	           1    	XSprePUSH; PUSHi((IV)RETVAL);
   230			    }
   231	           1        XSRETURN(1);
   232			}
   233			
   234			
   235			XS(XS_Sys__Syslog_LOG_UPTO); /* prototype to pass -Wmissing-prototypes */
   236			XS(XS_Sys__Syslog_LOG_UPTO)
   237	           1    {
   238	           1        dXSARGS;
   239	           1        if (items != 1)
   240	      ######    	Perl_croak(aTHX_ "Usage: Sys::Syslog::LOG_UPTO(pri)");
   241	           1        PERL_UNUSED_VAR(cv); /* -W */
   242			    {
   243	           1    	int	pri = (int)SvIV(ST(0));
   244	           1    	int	RETVAL;
   245	           1    	dXSTARG;
   246			#line 77 "Syslog.xs"
   247			#ifdef LOG_UPTO
   248				RETVAL = LOG_UPTO(pri);
   249			#else
   250				croak("Your vendor has not defined the Sys::Syslog macro LOG_UPTO");
   251				RETVAL = -1;
   252			#endif
   253			#line 254 "Syslog.c"
   254	           1    	XSprePUSH; PUSHi((IV)RETVAL);
   255			    }
   256	           1        XSRETURN(1);
   257			}
   258			
   259			#ifdef __cplusplus
   260			extern "C"
   261			#endif
   262			XS(boot_Sys__Syslog); /* prototype to pass -Wmissing-prototypes */
   263			XS(boot_Sys__Syslog)
   264	           1    {
   265	           1        dXSARGS;
   266	           1        char* file = __FILE__;
   267			
   268	           1        PERL_UNUSED_VAR(cv); /* -W */
   269	           1        PERL_UNUSED_VAR(items); /* -W */
   270	           1        XS_VERSION_BOOTCHECK ;
   271			
   272	           1            newXS("Sys::Syslog::constant", XS_Sys__Syslog_constant, file);
   273	           1            newXS("Sys::Syslog::LOG_FAC", XS_Sys__Syslog_LOG_FAC, file);
   274	           1            newXS("Sys::Syslog::LOG_PRI", XS_Sys__Syslog_LOG_PRI, file);
   275	           1            newXS("Sys::Syslog::LOG_MAKEPRI", XS_Sys__Syslog_LOG_MAKEPRI, file);
   276	           1            newXS("Sys::Syslog::LOG_MASK", XS_Sys__Syslog_LOG_MASK, file);
   277	           1            newXS("Sys::Syslog::LOG_UPTO", XS_Sys__Syslog_LOG_UPTO, file);
   278	           1        XSRETURN_YES;
   279			}
   280			
