Linux-RTC-Ioctl

 view release on metacpan or  search on metacpan

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

    hashAccessFailedMsg[] = "Failed to access $rtc object hash keys.",
    objectFieldsMissingMsg[] = "Member field \"%s\" is missing or is non-numeric in RTC object.";

MODULE = Linux::RTC::Ioctl		PACKAGE = Linux::RTC::Ioctl		

INCLUDE: const-xs.inc

void
wait_for_timer(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	int fd = -1;
	char const *node = "";
	unsigned long record = 0;
	ssize_t read_size = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);

	{
	    SV **nodename = hv_fetch(rtc, "nodename", 8, 0);

	    if (nodename && (node = SvPV_nolen(*nodename), SvPOK(*nodename)))

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	        // return undef after a read error, check $!
	        XPUSHs(&PL_sv_undef);
	        XSRETURN(1);
	    }

#if defined(RTC_IRQP_SET) && defined(RTC_IRQP_READ)

void
periodic_frequency(HV *rtc, ...)
    PROTOTYPE: \%;$
    PPCODE:
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {
		PerlIO *device_perlio = IoIFP(file_io);

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_PIE_ON) && defined(RTC_PIE_OFF)

void
periodic_interrupt(HV *rtc, bool fEnable)
    PROTOTYPE: \%$
    PPCODE:
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {
		PerlIO *device_perlio = IoIFP(file_io);

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_UIE_ON) && defined(RTC_UIE_OFF)

void
update_interrupt(HV *rtc, bool fEnable)
    PROTOTYPE: \%$
    PPCODE:
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {
		PerlIO *device_perlio = IoIFP(file_io);

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_AIE_ON) && defined(RTC_AIE_OFF)

void
alarm_interrupt(HV *rtc, bool fEnable)
    PROTOTYPE: \%$
    PPCODE:
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {
		PerlIO *device_perlio = IoIFP(file_io);

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_RD_TIME)

void
read_time(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	struct rtc_time tm = { 0, 0, 0,  0, 0, 0,  -1, -1, -1 };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);
	int result;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

		XSRETURN(1);
	    }

#endif

#if defined(RTC_SET_TIME)

void
set_time(HV *rtc, ...)
    PROTOTYPE: \*%;$$$$$$$$$
    PPCODE:
	int args_count = items;
	struct rtc_time tm = { 0, 0, 0,  0, 0, 0,  -1, -1, -1 };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_ALM_READ)

void
read_alarm(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	struct rtc_time tm = { 0, 0, 0,  0, 0, 0,  -1, -1, -1 };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;
	int result;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    }

#endif


#if defined(RTC_ALM_SET)

void
set_alarm(HV *rtc, ...)
    PROTOTYPE: \*%;$$$$$$$$$
    PPCODE:
	int args_count = items;
	struct rtc_time tm = { 0, 0, 0,  0, 0, 0,  -1, -1, -1 };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_WKALM_RD)

void
read_wakeup_alarm(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	struct rtc_wkalrm tm = { 0, 0, { 0, 0, 0,  0, 0, 0,  -1, -1, -1 } };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;
	int result;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    }

#endif


#if defined(RTC_WKALM_SET)

void
set_wakeup_alarm(HV *rtc, ...)
    PROTOTYPE: \*%;$$$$$$$$$
    PPCODE:
	int args_count = items;
	struct rtc_wkalrm tm = { 0, 0, { 0, 0, 0,  0, 0, 0,  -1, -1, -1 } };
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_VL_READ)

void
read_voltage_low_indicator(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	int result, voltage_low_indicator;
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {

lib/Linux/RTC/Ioctl.xs  view on Meta::CPAN

	    XSRETURN(1);
	}

#endif

#if defined(RTC_VL_CLR)

void
clear_voltage_low_indicator(HV *rtc)
    PROTOTYPE: \%
    PPCODE:
	int fd = -1;
	SV **device = hv_fetch(rtc, "device", 6, 0);;

	if (device)
	{
	    IO *file_io = sv_2io(*device);

	    if (file_io)
	    {
		PerlIO *device_perlio = IoIFP(file_io);

lib/Linux/RTC/const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Linux::RTC::Ioctl macro", s));
          PUSHs(sv);



( run in 0.997 second using v1.01-cache-2.11-cpan-5511b514fd6 )