view release on metacpan or search on metacpan
MODULE = Data::Peek PACKAGE = Data::Peek
void
DPeek (...)
PROTOTYPE: ;$
PPCODE:
I32 gimme = GIMME_V;
SV *sv = items ? ST (0) : DEFSV;
if (items == 0) EXTEND (SP, 1);
ST (0) = _DPeek (aTHX_ items, sv);
if (gimme == G_VOID) warn ("%s\n", SvPVX (ST (0)));
/* XS DPeek */
void
DDisplay (...)
PROTOTYPE: ;$
PPCODE:
I32 gimme = GIMME_V;
SV *sv = items ? ST (0) : DEFSV;
SV *dsp = newSVpv ("", 0);
if (SvPOK (sv) || SvPOKp (sv))
pv_pretty (dsp, SvPVX (sv), SvCUR (sv), 0,
SV *pv
SV *iv
SV *nv
PROTOTYPE: $$$
PPCODE:
SV *tv = newSVpvs ("");
SvUPGRADE (tv, SVt_PVNV);
if (SvPOK (pv) || SvPOKp (pv)) {
sv_setpvn (tv, SvPVX (pv), SvCUR (pv));
void
DDual (sv, ...)
SV *sv
PROTOTYPE: $;$
PPCODE:
I32 gimme = GIMME_V;
if (items > 1 && SvGMAGICAL (sv) && SvTRUE (ST (1)))
mg_get (sv);
DGrow (sv, size)
SV *sv
IV size
PROTOTYPE: $$
PPCODE:
if (SvROK (sv))
sv = SvRV (sv);
if (!SvPOK (sv))
sv_setpvn (sv, "", 0);
SvGROW (sv, size);
void
DDump_XS (sv)
SV *sv
PROTOTYPE: $
PPCODE:
SV *dd = _DDump (aTHX_ sv);
if (dd) {
ST (0) = dd;
XSRETURN (1);
DDump_IO (io, sv, level)
PerlIO *io
SV *sv
IV level
PPCODE:
do_sv_dump (0, io, sv, 1, level, 1, 0);
XSRETURN (1);
/* XS DDump */
view all matches for this distribution
view release on metacpan or search on metacpan
SV *self
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int::Sub", self);
int64_t value;
PPCODE:
for (UV i = 0; i < count; i++) {
int r = pubsub_int_poll(sub, &value);
if (r != 1) break;
mXPUSHi((IV)value);
}
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int::Sub", self);
int64_t value;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int_poll(sub, &value))
mXPUSHi((IV)value);
void
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int::Sub", self);
double timeout = -1;
int64_t value;
PPCODE:
if (count == 0) XSRETURN(0);
if (items > 2) timeout = SvNV(ST(2));
if (!pubsub_int_poll_wait(sub, &value, timeout)) XSRETURN(0);
mXPUSHi((IV)value);
for (UV i = 1; i < count; i++) {
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int::Sub", self);
int64_t value;
uint32_t max_count;
PPCODE:
pubsub_sub_eventfd_consume(sub);
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int_poll(sub, &value))
mXPUSHi((IV)value);
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Str::Sub", self);
const char *str;
uint32_t len;
bool utf8;
PPCODE:
for (UV i = 0; i < count; i++) {
int r = pubsub_str_poll(sub, &str, &len, &utf8);
if (r != 1) break;
SV *sv = newSVpvn(str, len);
if (utf8) SvUTF8_on(sv);
EXTRACT_SUB("Data::PubSub::Shared::Str::Sub", self);
const char *str;
uint32_t len;
bool utf8;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_str_poll(sub, &str, &len, &utf8) == 1) {
SV *sv = newSVpvn(str, len);
if (utf8) SvUTF8_on(sv);
mXPUSHs(sv);
EXTRACT_SUB("Data::PubSub::Shared::Str::Sub", self);
double timeout = -1;
const char *str;
uint32_t len;
bool utf8;
PPCODE:
if (count == 0) XSRETURN(0);
if (items > 2) timeout = SvNV(ST(2));
if (pubsub_str_poll_wait(sub, &str, &len, &utf8, timeout) != 1) XSRETURN(0);
{
SV *sv = newSVpvn(str, len);
EXTRACT_SUB("Data::PubSub::Shared::Str::Sub", self);
const char *str;
uint32_t len;
bool utf8;
uint32_t max_count;
PPCODE:
pubsub_sub_eventfd_consume(sub);
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_str_poll(sub, &str, &len, &utf8) == 1) {
SV *sv = newSVpvn(str, len);
if (utf8) SvUTF8_on(sv);
SV *self
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int32::Sub", self);
int32_t value;
PPCODE:
for (UV i = 0; i < count; i++) {
int r = pubsub_int32_poll(sub, &value);
if (r != 1) break;
mXPUSHi((IV)value);
}
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int32::Sub", self);
int32_t value;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int32_poll(sub, &value))
mXPUSHi((IV)value);
void
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int32::Sub", self);
double timeout = -1;
int32_t value;
PPCODE:
if (count == 0) XSRETURN(0);
if (items > 2) timeout = SvNV(ST(2));
if (!pubsub_int32_poll_wait(sub, &value, timeout)) XSRETURN(0);
mXPUSHi((IV)value);
for (UV i = 1; i < count; i++) {
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int32::Sub", self);
int32_t value;
uint32_t max_count;
PPCODE:
pubsub_sub_eventfd_consume(sub);
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int32_poll(sub, &value))
mXPUSHi((IV)value);
SV *self
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int16::Sub", self);
int16_t value;
PPCODE:
for (UV i = 0; i < count; i++) {
int r = pubsub_int16_poll(sub, &value);
if (r != 1) break;
mXPUSHi((IV)value);
}
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int16::Sub", self);
int16_t value;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int16_poll(sub, &value))
mXPUSHi((IV)value);
void
UV count
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int16::Sub", self);
double timeout = -1;
int16_t value;
PPCODE:
if (count == 0) XSRETURN(0);
if (items > 2) timeout = SvNV(ST(2));
if (!pubsub_int16_poll_wait(sub, &value, timeout)) XSRETURN(0);
mXPUSHi((IV)value);
for (UV i = 1; i < count; i++) {
SV *self
PREINIT:
EXTRACT_SUB("Data::PubSub::Shared::Int16::Sub", self);
int16_t value;
uint32_t max_count;
PPCODE:
pubsub_sub_eventfd_consume(sub);
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && pubsub_int16_poll(sub, &value))
mXPUSHi((IV)value);
view all matches for this distribution
view release on metacpan or search on metacpan
SV *self
UV count
PREINIT:
EXTRACT_HANDLE("Data::Queue::Shared::Int", self);
int64_t value;
PPCODE:
for (UV i = 0; i < count; i++) {
if (!queue_int_try_pop(h, &value)) break;
mXPUSHi((IV)value);
}
SV *self
PREINIT:
EXTRACT_HANDLE("Data::Queue::Shared::Int", self);
int64_t value;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
while (max_count-- > 0 && queue_int_try_pop(h, &value))
mXPUSHi((IV)value);
void
UV count
PREINIT:
EXTRACT_HANDLE("Data::Queue::Shared::Int", self);
double timeout = -1;
int64_t value;
PPCODE:
if (items > 2) timeout = SvNV(ST(2));
/* Block until at least 1 */
if (!queue_int_pop_wait(h, &value, timeout)) XSRETURN(0);
mXPUSHi((IV)value);
/* Grab up to count-1 more non-blocking */
PREINIT:
EXTRACT_HANDLE("Data::Queue::Shared::Str", self);
const char *str;
uint32_t len;
bool utf8;
PPCODE:
/* Hoist Perl SV construction out of the process-shared mutex:
* newSVpvn can longjmp on OOM and deadlock peers on the futex. */
struct { char *buf; uint32_t len; bool utf8; } *items_buf = NULL;
UV n = 0;
int last_r = 0;
EXTRACT_HANDLE("Data::Queue::Shared::Str", self);
const char *str;
uint32_t len;
bool utf8;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
/* Hoist SV construction out of the mutex (see pop_multi). */
struct drain_item { char *buf; uint32_t len; bool utf8; struct drain_item *next; } *drained_head = NULL, *drained_tail = NULL;
UV drained_n = 0;
int last_r = 0;
EXTRACT_HANDLE("Data::Queue::Shared::Str", self);
double timeout = -1;
const char *str;
uint32_t len;
bool utf8;
PPCODE:
if (items > 2) timeout = SvNV(ST(2));
/* Block until at least 1 */
{
int r = queue_str_pop_wait(h, &str, &len, &utf8, timeout);
if (r == -1) croak("Data::Queue::Shared::Str: out of memory");
view all matches for this distribution
view release on metacpan or search on metacpan
EXTRACT_HANDLE("Data::ReqRep::Shared", self);
const char *str;
uint32_t len;
uint64_t id;
bool utf8;
PPCODE:
int r = reqrep_try_recv(h, &str, &len, &utf8, &id);
if (r == -1) croak("Data::ReqRep::Shared: out of memory");
if (r == 1) {
SV *sv = newSVpvn(str, len);
if (utf8) SvUTF8_on(sv);
double timeout = -1;
const char *str;
uint32_t len;
uint64_t id;
bool utf8;
PPCODE:
if (items > 1) timeout = SvNV(ST(1));
int r = reqrep_recv_wait(h, &str, &len, &utf8, &id, timeout);
if (r == -1) croak("Data::ReqRep::Shared: out of memory");
if (r == 1) {
SV *sv = newSVpvn(str, len);
EXTRACT_HANDLE("Data::ReqRep::Shared", self);
const char *str;
uint32_t len;
uint64_t id;
bool utf8;
PPCODE:
/* Hoist Perl SV construction out of process-shared futex mutex. */
struct { char *buf; uint32_t len; uint64_t id; bool utf8; } *items_buf = NULL;
UV n = 0;
int last_r = 0;
int oom = 0;
double timeout = -1;
const char *str;
uint32_t len;
uint64_t id;
bool utf8;
PPCODE:
if (items > 2) timeout = SvNV(ST(2));
/* Block until at least 1 */
int r = reqrep_recv_wait(h, &str, &len, &utf8, &id, timeout);
if (r == -1) croak("Data::ReqRep::Shared: out of memory");
if (r != 1) XSRETURN(0);
const char *str;
uint32_t len;
uint64_t id;
bool utf8;
uint32_t max_count;
PPCODE:
max_count = (items > 1) ? (uint32_t)SvUV(ST(1)) : UINT32_MAX;
/* Hoist SV construction out of the mutex (see recv_multi). */
struct drain_item { char *buf; uint32_t len; uint64_t id; bool utf8; struct drain_item *next; } *drained_head = NULL, *drained_tail = NULL;
UV drained_n = 0;
int last_r = 0;
SV *self
PREINIT:
EXTRACT_HANDLE("Data::ReqRep::Shared::Int", self);
int64_t value;
uint64_t id;
PPCODE:
if (reqrep_int_try_recv(h, &value, &id)) {
mXPUSHi((IV)value);
mXPUSHu((UV)id);
}
PREINIT:
EXTRACT_HANDLE("Data::ReqRep::Shared::Int", self);
double timeout = -1;
int64_t value;
uint64_t id;
PPCODE:
if (items > 1) timeout = SvNV(ST(1));
if (reqrep_int_recv_wait(h, &value, &id, timeout)) {
mXPUSHi((IV)value);
mXPUSHu((UV)id);
}
view all matches for this distribution
view release on metacpan or search on metacpan
deref(...)
PREINIT:
I32 i, n = 0;
I32 sref;
SV *sv;
PPCODE:
sref = (GIMME == G_SCALAR) && (PL_op->op_flags & OPf_REF);
for (i = 0; i < items; i++) {
if (!SvROK(ST(i))) {
STRLEN z;
if (SvOK(ST(i)))
view all matches for this distribution
view release on metacpan or search on metacpan
SV *uu2_sv;
PROTOTYPE: $$
PREINIT:
uuid_t uu1;
uuid_t uu2;
PPCODE:
if ( sv_to_uuid(uu1_sv, uu1) && sv_to_uuid(uu2_sv, uu2) )
if ( uuid_compare(uu1, uu2) == 0 )
XSRETURN_YES;
else
XSRETURN_NO;
SV *uu2_sv;
PROTOTYPE: $$
PREINIT:
uuid_t uu1;
uuid_t uu2;
PPCODE:
if ( sv_to_uuid(uu1_sv, uu1) && sv_to_uuid(uu2_sv, uu2) )
XSRETURN_IV(uuid_compare(uu1, uu2));
else
XSRETURN_UNDEF;
view all matches for this distribution
view release on metacpan or search on metacpan
perl_uuid_time_t timestamp;
unsigned16 clockseq;
perl_uuid_t uuid;
FILE *fd;
mode_t mask;
PPCODE:
clockseq = self->state.cs;
get_current_time(×tamp);
if ( self->state.ts == I64(0) ||
memcmp(&(self->nodeid), &(self->state.node), sizeof(uuid_node_t)))
clockseq = true_random();
PREINIT:
SV *ctx;
unsigned char hash[16];
perl_uuid_t net_nsid;
perl_uuid_t uuid;
PPCODE:
net_nsid = *nsid;
net_nsid.time_low = htonl(net_nsid.time_low);
net_nsid.time_mid = htons(net_nsid.time_mid);
net_nsid.time_hi_and_version = htons(net_nsid.time_hi_and_version);
uuid_context_t *self;
perl_uuid_t *uuid;
ALIAS:
Data::UUID::to_hexstring = F_HEX
Data::UUID::to_b64string = F_B64
PPCODE:
ST(0) = make_ret(*uuid, ix ? ix : F_STR);
XSRETURN(1);
void
from_string(self,str)
perl_uuid_t uuid;
char *from, *to;
int c;
unsigned int i;
unsigned char buf[4];
PPCODE:
switch(ix) {
case F_BIN:
case F_STR:
case F_HEX:
from = str;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Util.xs view on Meta::CPAN
get_code_info(code)
CV* code
PREINIT:
GV* gv;
HV* stash;
PPCODE:
if( (gv = CvGV(code)) && isGV_with_GP(gv)
&& (stash = (GvSTASH(gv))) && HvNAME_get(stash) ){
if(GIMME_V == G_ARRAY){
EXTEND(SP, 2);
lib/Data/Util.xs view on Meta::CPAN
*/
MAGIC* mg;
AV* modifiers; /* (before, around, after, original, current) */
SV* property;
const char* property_pv;
PPCODE:
mg = mg_find_by_vtbl((SV*)code, &modified_vtbl);
if(items == 1){ /* check only */
ST(0) = boolSV(mg);
XSRETURN(1);
view all matches for this distribution
view release on metacpan or search on metacpan
void
DateCalc_Days_in_Year(year,month)
Z_int year
Z_int month
PPCODE:
{
if (year > 0)
{
if ((month >= 1) and (month <= 12))
{
void
DateCalc_Days_in_Month(year,month)
Z_int year
Z_int month
PPCODE:
{
if (year > 0)
{
if ((month >= 1) and (month <= 12))
{
void
DateCalc_Week_of_Year(year,month,day)
Z_int year
Z_int month
Z_int day
PPCODE:
{
Z_int week;
if (DateCalc_week_of_year(&week,&year,month,day))
{
void
DateCalc_Monday_of_Week(week,year)
Z_int week
Z_int year
PPCODE:
{
Z_int month;
Z_int day;
if (year > 0)
DateCalc_Nth_Weekday_of_Month_Year(year,month,dow,n)
Z_int year
Z_int month
Z_int dow
Z_int n
PPCODE:
{
Z_int day;
if (year > 0)
{
void
DateCalc_Standard_to_Business(year,month,day)
Z_int year
Z_int month
Z_int day
PPCODE:
{
Z_int week;
Z_int dow;
if (DateCalc_standard_to_business(&year,&week,&dow,month,day))
void
DateCalc_Business_to_Standard(year,week,dow)
Z_int year
Z_int week
Z_int dow
PPCODE:
{
Z_int month;
Z_int day;
if (DateCalc_business_to_standard(&year,&month,&day,week,dow))
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_long Dd;
Z_int Dh;
Z_int Dm;
Z_int Ds;
Z_int month1
Z_int day1
Z_int year2
Z_int month2
Z_int day2
PPCODE:
{
if (DateCalc_delta_ymd(&year1,&month1,&day1, year2,month2,day2))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year1)));
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_int D_y;
Z_int D_m;
Z_int D_d;
Z_int Dh;
Z_int month1
Z_int day1
Z_int year2
Z_int month2
Z_int day2
PPCODE:
{
if (DateCalc_norm_delta_ymd(&year1,&month1,&day1, year2,month2,day2))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year1)));
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_int D_y;
Z_int D_m;
Z_int D_d;
Z_int Dhh;
DateCalc_Normalize_DHMS(Dd,Dh,Dm,Ds)
Z_long Dd
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
DateCalc_Normalize_DHMS(&Dd,&Dh,&Dm,&Ds);
EXTEND(sp,4);
PUSHs(sv_2mortal(newSViv((IV)Dd)));
PUSHs(sv_2mortal(newSViv((IV)Dh)));
DateCalc_Add_Delta_Days(year,month,day, Dd)
Z_int year
Z_int month
Z_int day
Z_long Dd
PPCODE:
{
if (DateCalc_add_delta_days(&year,&month,&day, Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
Z_int sec
Z_long Dd
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
Z_int year
Z_int month
Z_int day
Z_long Dy
Z_long Dm
PPCODE:
{
if (DateCalc_add_delta_ym(&year,&month,&day, Dy,Dm))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
Z_int month
Z_int day
Z_long Dy
Z_long Dm
Z_long Dd
PPCODE:
{
if (DateCalc_add_delta_ymd(&year,&month,&day, Dy,Dm,Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
Z_long D_m
Z_long D_d
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
Z_int month
Z_int day
Z_long Dy
Z_long Dm
Z_long Dd
PPCODE:
{
if (DateCalc_add_norm_delta_ymd(&year,&month,&day, Dy,Dm,Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
Z_long D_m
Z_long D_d
Z_long Dhh
Z_long Dmm
Z_long Dss
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
}
void
DateCalc_System_Clock(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
}
void
DateCalc_Today(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
}
void
DateCalc_Now(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
}
void
DateCalc_Today_and_Now(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
}
void
DateCalc_This_Year(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
}
void
DateCalc_Gmtime(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
}
void
DateCalc_Localtime(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
Z_int month
Z_int day
Z_int hour
Z_int min
Z_int sec
PPCODE:
{
time_t seconds;
if (DateCalc_mktime(&seconds, year,month,day, hour,min,sec, -1,-1,-1))
{
}
void
DateCalc_Timezone(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_when;
#endif
time_t when;
Z_int month
Z_int day
Z_int hour
Z_int min
Z_int sec
PPCODE:
{
time_t seconds;
if (DateCalc_date2time(&seconds, year,month,day, hour,min,sec))
{
}
void
DateCalc_Time_to_Date(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
void
DateCalc_Easter_Sunday(year)
Z_int year
PPCODE:
{
Z_int month;
Z_int day;
if ((year > 0) and DateCalc_easter_sunday(&year,&month,&day))
}
void
DateCalc_Decode_Month(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
}
void
DateCalc_Decode_Day_of_Week(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
RETVAL
void
DateCalc_Decode_Date_EU(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
Z_int year;
}
void
DateCalc_Decode_Date_US(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
Z_int year;
void
DateCalc_Uncompress(date)
Z_int date
PPCODE:
{
Z_int century;
Z_int year;
Z_int month;
Z_int day;
Z_int date
void
DateCalc_Compressed_to_Text(...)
PPCODE:
{
charptr string;
Z_int date;
Z_int lang;
}
void
DateCalc_Date_to_Text(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
Z_int day;
}
void
DateCalc_Date_to_Text_Long(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
Z_int day;
void
DateCalc_English_Ordinal(number)
Z_int number
PPCODE:
{
blockdef(string,64);
DateCalc_English_Ordinal(string,number);
EXTEND(sp,1);
}
void
DateCalc_Calendar(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
boolean orthodox;
}
void
DateCalc_Month_to_Text(...)
PPCODE:
{
Z_int month;
Z_int lang = 0;
if ((items == 1) or (items == 2))
}
void
DateCalc_Day_of_Week_to_Text(...)
PPCODE:
{
Z_int dow;
Z_int lang = 0;
if ((items == 1) or (items == 2))
}
void
DateCalc_Day_of_Week_Abbreviation(...)
PPCODE:
{
blockdef(buffer,4);
Z_int dow;
Z_int lang = 0;
void
DateCalc_Language_to_Text(lang)
Z_int lang
PPCODE:
{
if ((lang >= 1) and (lang <= DateCalc_LANGUAGES))
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVpv((char *)DateCalc_Language_to_Text_[lang],0)));
void
DateCalc_ISO_LC(scalar)
SV * scalar
PPCODE:
{
charptr string;
charptr buffer;
N_int length;
N_int index;
void
DateCalc_ISO_UC(scalar)
SV * scalar
PPCODE:
{
charptr string;
charptr buffer;
N_int length;
N_int index;
}
void
DateCalc_Version()
PPCODE:
{
charptr string;
string = DateCalc_Version();
if (string != NULL)
view all matches for this distribution
view release on metacpan or search on metacpan
void
expand_recurrence(rule, start=0, count=INT_MAX)
const char * rule
int start
int count
PPCODE:
struct icalrecurrencetype recur, err;
icalrecur_iterator *ritr;
struct icaltimetype icstart, next;
icalrecurrencetype_clear(&err);
view all matches for this distribution
view release on metacpan or search on metacpan
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Days_in_Year(year,month)
Z_int year
Z_int month
PPCODE:
{
if (year > 0)
{
if ((month >= 1) and (month <= 12))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Days_in_Month(year,month)
Z_int year
Z_int month
PPCODE:
{
if (year > 0)
{
if ((month >= 1) and (month <= 12))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Week_of_Year(year,month,day)
Z_int year
Z_int month
Z_int day
PPCODE:
{
Z_int week;
if (DateCalc_week_of_year(&week,&year,month,day))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Monday_of_Week(week,year)
Z_int week
Z_int year
PPCODE:
{
Z_int month;
Z_int day;
if (year > 0)
src/C_XS/Pcalc.xs view on Meta::CPAN
DateCalc_Nth_Weekday_of_Month_Year(year,month,dow,n)
Z_int year
Z_int month
Z_int dow
Z_int n
PPCODE:
{
Z_int day;
if (year > 0)
{
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Standard_to_Business(year,month,day)
Z_int year
Z_int month
Z_int day
PPCODE:
{
Z_int week;
Z_int dow;
if (DateCalc_standard_to_business(&year,&week,&dow,month,day))
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Business_to_Standard(year,week,dow)
Z_int year
Z_int week
Z_int dow
PPCODE:
{
Z_int month;
Z_int day;
if (DateCalc_business_to_standard(&year,&month,&day,week,dow))
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_long Dd;
Z_int Dh;
Z_int Dm;
Z_int Ds;
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month1
Z_int day1
Z_int year2
Z_int month2
Z_int day2
PPCODE:
{
if (DateCalc_delta_ymd(&year1,&month1,&day1, year2,month2,day2))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year1)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_int D_y;
Z_int D_m;
Z_int D_d;
Z_int Dh;
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month1
Z_int day1
Z_int year2
Z_int month2
Z_int day2
PPCODE:
{
if (DateCalc_norm_delta_ymd(&year1,&month1,&day1, year2,month2,day2))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year1)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month2
Z_int day2
Z_int hour2
Z_int min2
Z_int sec2
PPCODE:
{
Z_int D_y;
Z_int D_m;
Z_int D_d;
Z_int Dhh;
src/C_XS/Pcalc.xs view on Meta::CPAN
DateCalc_Normalize_DHMS(Dd,Dh,Dm,Ds)
Z_long Dd
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
DateCalc_Normalize_DHMS(&Dd,&Dh,&Dm,&Ds);
EXTEND(sp,4);
PUSHs(sv_2mortal(newSViv((IV)Dd)));
PUSHs(sv_2mortal(newSViv((IV)Dh)));
src/C_XS/Pcalc.xs view on Meta::CPAN
DateCalc_Add_Delta_Days(year,month,day, Dd)
Z_int year
Z_int month
Z_int day
Z_long Dd
PPCODE:
{
if (DateCalc_add_delta_days(&year,&month,&day, Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int sec
Z_long Dd
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int year
Z_int month
Z_int day
Z_long Dy
Z_long Dm
PPCODE:
{
if (DateCalc_add_delta_ym(&year,&month,&day, Dy,Dm))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month
Z_int day
Z_long Dy
Z_long Dm
Z_long Dd
PPCODE:
{
if (DateCalc_add_delta_ymd(&year,&month,&day, Dy,Dm,Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_long D_m
Z_long D_d
Z_long Dh
Z_long Dm
Z_long Ds
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month
Z_int day
Z_long Dy
Z_long Dm
Z_long Dd
PPCODE:
{
if (DateCalc_add_norm_delta_ymd(&year,&month,&day, Dy,Dm,Dd))
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSViv((IV)year)));
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_long D_m
Z_long D_d
Z_long Dhh
Z_long Dmm
Z_long Dss
PPCODE:
{
if (DateCalc_check_date(year,month,day))
{
if (DateCalc_check_time(hour,min,sec))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_System_Clock(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Today(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Now(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Today_and_Now(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_This_Year(...)
PPCODE:
{
Z_int year;
Z_int month;
Z_int day;
Z_int hour;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Gmtime(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Localtime(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month
Z_int day
Z_int hour
Z_int min
Z_int sec
PPCODE:
{
time_t seconds;
if (DateCalc_mktime(&seconds, year,month,day, hour,min,sec, -1,-1,-1))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Timezone(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_when;
#endif
time_t when;
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int month
Z_int day
Z_int hour
Z_int min
Z_int sec
PPCODE:
{
time_t seconds;
if (DateCalc_date2time(&seconds, year,month,day, hour,min,sec))
{
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Time_to_Date(...)
PPCODE:
{
#ifdef MACOS_TRADITIONAL
double f_seconds;
#endif
time_t seconds;
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Easter_Sunday(year)
Z_int year
PPCODE:
{
Z_int month;
Z_int day;
if ((year > 0) and DateCalc_easter_sunday(&year,&month,&day))
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Decode_Month(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Decode_Day_of_Week(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
src/C_XS/Pcalc.xs view on Meta::CPAN
RETVAL
void
DateCalc_Decode_Date_EU(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
Z_int year;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Decode_Date_US(...)
PPCODE:
{
charptr string;
N_int length;
Z_int lang;
Z_int year;
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Uncompress(date)
Z_int date
PPCODE:
{
Z_int century;
Z_int year;
Z_int month;
Z_int day;
src/C_XS/Pcalc.xs view on Meta::CPAN
Z_int date
void
DateCalc_Compressed_to_Text(...)
PPCODE:
{
charptr string;
Z_int date;
Z_int lang;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Date_to_Text(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
Z_int day;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Date_to_Text_Long(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
Z_int day;
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_English_Ordinal(number)
Z_int number
PPCODE:
{
blockdef(string,64);
DateCalc_English_Ordinal(string,number);
EXTEND(sp,1);
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Calendar(...)
PPCODE:
{
charptr string;
Z_int year;
Z_int month;
boolean orthodox;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Month_to_Text(...)
PPCODE:
{
Z_int month;
Z_int lang = 0;
if ((items == 1) or (items == 2))
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Day_of_Week_to_Text(...)
PPCODE:
{
Z_int dow;
Z_int lang = 0;
if ((items == 1) or (items == 2))
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Day_of_Week_Abbreviation(...)
PPCODE:
{
blockdef(buffer,4);
Z_int dow;
Z_int lang = 0;
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_Language_to_Text(lang)
Z_int lang
PPCODE:
{
if ((lang >= 1) and (lang <= DateCalc_LANGUAGES))
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVpv((char *)DateCalc_Language_to_Text_[lang],0)));
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_ISO_LC(scalar)
SV * scalar
PPCODE:
{
charptr string;
charptr buffer;
N_int length;
N_int index;
src/C_XS/Pcalc.xs view on Meta::CPAN
void
DateCalc_ISO_UC(scalar)
SV * scalar
PPCODE:
{
charptr string;
charptr buffer;
N_int length;
N_int index;
src/C_XS/Pcalc.xs view on Meta::CPAN
}
void
DateCalc_Version()
PPCODE:
{
charptr string;
string = DateCalc_Version();
if (string != NULL)
view all matches for this distribution
view release on metacpan or search on metacpan
RETVAL
void
days_to_ymd(days)
IV days
PPCODE:
{
IV ymd[3];
days_to_ymd (days, ymd);
EXTEND (sp, 3);
PUSHs (sv_2mortal (newSViv (ymd[0])));
RETVAL
void
as_ymd(date)
SV* date
PPCODE:
{
IV ymd[3];
if (! SvROK (date))
XSRETURN_EMPTY;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Astro.xs view on Meta::CPAN
DT_Astro_gregorian_components_from_rd(rd)
long rd;
PREINIT:
long y;
int m, d;
PPCODE:
EXTEND(SP, 3);
gregorian_components_from_rd(rd, &y, &m, &d);
mPUSHi(y);
mPUSHi(m);
lib/DateTime/Astro.xs view on Meta::CPAN
DT_Astro_ymd_seconds_from_moment(moment)
SV_TO_MPFR moment;
PREINIT:
long y;
int m, d, s;
PPCODE:
ymd_seconds_from_moment( &moment, &y, &m, &d, &s );
mpfr_clear(moment);
EXTEND(SP, 4);
mPUSHi(y);
view all matches for this distribution
view release on metacpan or search on metacpan
DateTime-Lite.xs view on Meta::CPAN
IV quarter;
IV yadj = 0;
IV dow, doy, doq;
IV rd_days;
PPCODE:
rd_days = d;
d += MARCH_1;
if( d <= 0 )
DateTime-Lite.xs view on Meta::CPAN
IV d;
PREINIT:
IV adj;
PPCODE:
if( m <= 2 )
{
adj = (14 - m) / 12;
y -= adj;
m += 12 * adj;
DateTime-Lite.xs view on Meta::CPAN
IV secs_modifier;
PREINIT:
IV h, m, s;
PPCODE:
secs -= secs_modifier;
h = secs / 3600;
secs -= h * 3600;
DateTime-Lite.xs view on Meta::CPAN
_time_as_seconds(self, h, m, s)
IV h;
IV m;
IV s;
PPCODE:
EXTEND(SP, 1);
mPUSHi(h * 3600 + m * 60 + s);
# Leap year / leap second helpers
void
_is_leap_year(self, y)
IV y;
PPCODE:
EXTEND(SP, 1);
mPUSHi(_real_is_leap_year(y));
void
_day_length(self, utc_rd)
IV utc_rd;
PPCODE:
IV day_length;
SET_DAY_LENGTH(utc_rd, day_length);
EXTEND(SP, 1);
mPUSHi(day_length);
void
_day_has_leap_second(self, utc_rd)
IV utc_rd;
PPCODE:
IV day_length;
SET_DAY_LENGTH(utc_rd, day_length);
EXTEND(SP, 1);
mPUSHi(day_length > SECONDS_PER_DAY ? 1 : 0);
void
_accumulated_leap_seconds(self, utc_rd)
IV utc_rd;
PPCODE:
IV leap_seconds;
SET_LEAP_SECONDS(utc_rd, leap_seconds);
EXTEND(SP, 1);
mPUSHi(leap_seconds);
DateTime-Lite.xs view on Meta::CPAN
void
_normalize_tai_seconds(self, days, secs)
SV* days;
SV* secs;
PPCODE:
if( dtl_isfinite(SvNV(days)) && dtl_isfinite(SvNV(secs)) )
{
IV d = SvIV(days);
IV s = SvIV(secs);
IV adj;
DateTime-Lite.xs view on Meta::CPAN
void
_normalize_leap_seconds(self, days, secs)
SV* days;
SV* secs;
PPCODE:
if( dtl_isfinite(SvNV(days)) && dtl_isfinite(SvNV(secs)) )
{
IV d = SvIV(days);
IV s = SvIV(secs);
IV day_length;
DateTime-Lite.xs view on Meta::CPAN
IV epoch;
PREINIT:
IV d, s;
PPCODE:
d = epoch / SECONDS_PER_DAY;
s = epoch - d * SECONDS_PER_DAY;
if( s < 0 )
{
DateTime-Lite.xs view on Meta::CPAN
void
_normalize_nanoseconds(self, secs, nanosecs)
SV* secs;
SV* nanosecs;
PPCODE:
{
IV s = SvIV(secs);
IV ns = SvIV(nanosecs);
IV overflow;
view all matches for this distribution
view release on metacpan or search on metacpan
DateTime.xs view on Meta::CPAN
IV quarter;
IV yadj = 0;
IV dow, doy, doq;
IV rd_days;
PPCODE:
rd_days = d;
d += MARCH_1;
if (d <= 0) {
DateTime.xs view on Meta::CPAN
IV d;
PREINIT:
IV adj;
PPCODE:
if (m <= 2) {
adj = (14 - m) / 12;
y -= adj;
m += 12 * adj;
} else if (m > 14) {
DateTime.xs view on Meta::CPAN
IV secs_modifier;
PREINIT:
IV h, m, s;
PPCODE:
secs -= secs_modifier;
h = secs / 3600;
secs -= h * 3600;
DateTime.xs view on Meta::CPAN
void
_normalize_tai_seconds(self, days, secs)
SV* days;
SV* secs;
PPCODE:
if (dt_isfinite(SvNV(days)) && dt_isfinite(SvNV(secs))) {
IV d = SvIV(days);
IV s = SvIV(secs);
IV adj;
DateTime.xs view on Meta::CPAN
void
_normalize_leap_seconds(self, days, secs)
SV* days;
SV* secs;
PPCODE:
if (dt_isfinite(SvNV(days)) && dt_isfinite(SvNV(secs))) {
IV d = SvIV(days);
IV s = SvIV(secs);
IV day_length;
DateTime.xs view on Meta::CPAN
_time_as_seconds(self, h, m, s)
IV h;
IV m;
IV s;
PPCODE:
EXTEND(SP, 1);
mPUSHi(h * 3600 + m * 60 + s);
void
_is_leap_year(self, y)
IV y;
PPCODE:
EXTEND(SP, 1);
mPUSHi(_real_is_leap_year(y));
void
_day_length(self, utc_rd)
IV utc_rd;
PPCODE:
IV day_length;
SET_DAY_LENGTH(utc_rd, day_length);
EXTEND(SP, 1);
mPUSHi(day_length);
void
_day_has_leap_second(self, utc_rd)
IV utc_rd;
PPCODE:
IV day_length;
SET_DAY_LENGTH(utc_rd, day_length);
EXTEND(SP, 1);
mPUSHi(day_length > 86400 ? 1 : 0);
void
_accumulated_leap_seconds(self, utc_rd)
IV utc_rd;
PPCODE:
IV leap_seconds;
SET_LEAP_SECONDS(utc_rd, leap_seconds);
EXTEND(SP, 1);
mPUSHi(leap_seconds);
view all matches for this distribution
view release on metacpan or search on metacpan
# custom GetDODA returns values as list type
#
void
MyGetDODA(datano)
COUNT datano
PPCODE:
DATOBJ doda[100];
int i=0;
i=GetDODA(datano,sizeof(DATOBJ)*100,doda,SCHEMA_DODA);
if (i)
for(i=0; i<100 ; i++)
view all matches for this distribution
view release on metacpan or search on metacpan
_str2list = 1
GTM::gvn2list = 2
GTM::_str2list = 3
GtmEnvPtr::gvn2list = 4
GtmEnvPtr::_str2list = 5
PPCODE:
{
cppack *start = NULL, *next; SV *ret; unsigned s , x; char *glvn;
s = (ix < 4) ? 0 : 1; if(items < s) XSRETURN_UNDEF;
start = unpackgvn( SvPV(ST(s),x) ); while(start) {
ret = sv_newmortal(); sv_setpv(ret, start->loc); XPUSHs(ret);
GTM::list2gvn = 2
GTM::_list2str = 3
GtmEnvPtr::list2gvn = 4
GtmEnvPtr::_list2str = 5
GtmEnvPtr::node = 6
PPCODE:
{
strpack *args;
GtmEnv *pfx = (ix<4) ? NULL : (GtmEnv *)SvIV((SV*)SvRV(ST(0)));
unsigned i,s = (ix<4) ? 0 : 1, n; SV *ret;
gtm_string_t value, glvn;
} else PUSHs(&PL_sv_undef);
}
void
END()
PPCODE:
{
if( _GTMinvoc ) {
gtm_exit();
#ifdef _GT_NEED_TERMFIX
tcsetattr(STDIN_FILENO,0,_GTMterm); free(_GTMterm);
MODULE = Db::GTM PACKAGE = GtmEnvPtr
void
DESTROY(gt_env)
GtmEnv *gt_env
PPCODE:
{
gtenv_clear(gt_env);
}
void
ALIAS:
retrieve = 1
FETCH = 2
EXISTS = 3
exists = 4
PPCODE:
{
strpack *args; unsigned i;
unsigned long exst=0,n; gtm_string_t value,glvn;
SV *ret=sv_newmortal(); EXTEND(SP, 1);
set(gt_env,...)
GtmEnv *gt_env
ALIAS:
store = 1
STORE = 2
PPCODE:
{
strpack *args; unsigned i,n; gtm_string_t glvn;
if(items>2) {
args = (strpack *)calloc(items-2,sizeof(strpack));
FIRSTKEY = 4
haschildren = 5
last = 6
revorder = 7
prev = 8
PPCODE:
{
strpack *args,*x; unsigned i, aq=0,n; int dir=(ix>5)?-1:1; SV *ret;
char *addquot=""; gtm_string_t value, glvn;
if( GIMME_V==G_VOID ) XSRETURN_UNDEF;
ALIAS:
DELETE = 1
CLEAR = 2
ks = 3
kv = 4
PPCODE:
{
strpack *args; unsigned i,n; gtm_string_t glvn;
if(items>1) {
args = (strpack *)calloc(items-1,sizeof(strpack));
}
void
query(gt_env,...)
GtmEnv *gt_env
PPCODE:
{
SV *ret; char **brk;
strpack *args; cppack *start=NULL,*next; gtm_string_t value, glvn;
unsigned i,z,n;
}
void
children(gt_env,...)
GtmEnv *gt_env
PPCODE:
{
char *end="\")\x00\x00",*loc; unsigned count=0,n,kids=0,base;
strpack *args; gtm_string_t value,glvn,buf;
if( GIMME_V==G_VOID ) XSRETURN_UNDEF;
GTM::clobber = 6
GTMDB::clobber = 10
overwrite = 3
GTM::overwrite = 7
GTMDB::overwrite = 11
PPCODE:
{
strpack *args; unsigned i,mid=0,ov=(ix & 2)?1:0,ob=(ix<4)?1:0,s=1,d=1;
GtmEnv *gt_env = (ob) ? (GtmEnv *)SvIV((SV*)SvRV(ST(0))) : NULL;
gtm_string_t src, dst; unsigned fs, fd; strpack value; SV *ret;
txnstart(gt_env)
GtmEnv *gt_env
ALIAS:
txnabort = 1
txncommit = 2
PPCODE:
{
EXTEND(SP,1); switch(ix) {
case 0: gt_env->flags |= IN_TXN; break;
case 1: if(inTxn(gt_env)) {
gt_env->last_err = gtm_ci("tabort",gt_env->gtmEnvId);
}
void
lock(gt_env,...)
GtmEnv *gt_env
PPCODE:
{
strpack *args; unsigned i,n; gtm_string_t glvn;
gtm_long_t value, timeout = 0;
if(items>1) {
}
void
unlock(gt_env,...)
GtmEnv *gt_env
PPCODE:
{
strpack *args; unsigned i,n; gtm_string_t glvn;
if(items>1) {
args = (strpack *)calloc(items-1,sizeof(strpack));
}
void
getid(gt_env)
GtmEnv *gt_env
PPCODE:
{
XPUSHs(newSViv(gt_env->gtmEnvId));
}
void
getprefix(gt_env)
GtmEnv *gt_env
PPCODE:
{
strpack *x; unsigned i; EXTEND(SP,gt_env->pfx_elem);
if(gt_env->prefix) for(i=0;i<(gt_env->pfx_elem);i++) {
x=>_env->prefix[i]; PUSHs(newSVpvn(x->address, x->length));
}
view all matches for this distribution
view release on metacpan or search on metacpan
fallback/const-xs.inc view on Meta::CPAN
/* 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:
type = constant(aTHX_ s, len);
/* 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:
view all matches for this distribution
view release on metacpan or search on metacpan
void
deep_utf8_decode( SV *data )
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 0;
a_args.type = DEEP_CALL_INPLACE ;
a_args.str_pos = 1;
a_args.argc = 2;
deep_walk_imp( data, & a_args );
void
deep_utf8_encode( SV *data )
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 0;
a_args.type = DEEP_CALL_INPLACE ;
a_args.str_pos = 1;
deep_walk_imp( data, & a_args );
void
deep_from_to_00( SV *data, SV *from, SV* to )
PROTOTYPE: $$$
PPCODE:
struct pp_args a_args;
a_args.noskip = 0;
a_args.type = DEEP_FUNCTION;
a_args.callback = from_to_cb_00;
a_args.argv[0] = find_encoding( &a_args, from );
deep_walk_imp( data, & a_args );
void
deep_from_to( SV *data, SV *from, SV* to )
PROTOTYPE: $$$
PPCODE:
struct pp_args a_args;
a_args.noskip = 0;
a_args.type = DEEP_FUNCTION;
a_args.fastinit = 0;
a_args.callback = from_to_cb;
deep_walk_imp( data, & a_args );
void
deep_encode_00( SV *data, SV* encoding )
PROTOTYPE: $$
PPCODE:
struct pp_args a_args;
a_args.type = DEEP_METHOD_TEMP;
a_args.fastinit = -1;
a_args.method = "encode";
a_args.noskip = 0;
void
deep_decode_00( SV *data, SV* encoding )
PROTOTYPE: $$
PPCODE:
struct pp_args a_args;
a_args.type = DEEP_METHOD_TEMP;
a_args.fastinit = -1;
a_args.method = "decode";
a_args.noskip = 0;
void
deep_encode( SV *data, SV* encoding )
PROTOTYPE: $$
PPCODE:
struct pp_args a_args;
a_args.type = DEEP_METHOD_TEMP;
a_args.method = "encode";
a_args.noskip = 0;
a_args.str_pos = 1;
void
deep_decode( SV *data, SV* encoding )
PROTOTYPE: $$
PPCODE:
struct pp_args a_args;
a_args.type = DEEP_METHOD_TEMP;
a_args.method = "decode";
a_args.noskip = 0;
a_args.str_pos = 1;
deep_walk_imp( data, & a_args );
void
deep_utf8_off( SV *data)
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 1;
a_args.type = DEEP_FUNCTION;
a_args.callback = utf8_off_cb;
a_args.counter = 0;
mXPUSHi( a_args.counter );
void
deep_utf8_on( SV *data)
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 1;
a_args.type = DEEP_FUNCTION;
a_args.callback = utf8_on_cb;
a_args.counter = 0;
mXPUSHi( a_args.counter );
void
deep_utf8_downgrade( SV *data)
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 1;
a_args.type = DEEP_FUNCTION;
a_args.callback = utf8_downgrade_cb;
a_args.counter = 0;
mXPUSHi( a_args.counter );
void
deep_utf8_upgrade( SV *data)
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 1;
a_args.type = DEEP_FUNCTION;
a_args.callback = utf8_upgrade_cb;
a_args.counter = 0;
mXPUSHi( a_args.counter );
void
deep_utf8_check( SV *data)
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
a_args.noskip = 1;
a_args.type = DEEP_FUNCTION;
a_args.callback = utf8_check_encoding_cb;
a_args.counter = 1;
mXPUSHi( a_args.counter );
void
deep_str_clone( SV *data )
PROTOTYPE: $
PPCODE:
struct pp_args a_args;
SV * R;
a_args.noskip = 0;
R = deep_clone_imp( data, &a_args );
if ( R ){
view all matches for this distribution
view release on metacpan or search on metacpan
OUTPUT:
RETVAL
void
SDL_ListModes (int rgb, int alpha)
PPCODE:
{
SDL_Rect **m;
SDL_GL_SetAttribute (SDL_GL_RED_SIZE , rgb);
SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, rgb);
int
SDL_GetModState ()
void
poll_events ()
PPCODE:
{
SDL_Event ev;
SDL_PumpEvents ();
while (SDL_PeepEvents (&ev, 1, SDL_GETEVENT, SDL_ALLEVENTS) > 0)
Mix_HookMusicFinished (music_finished);
Mix_ChannelFinished (channel_finished);
void
Mix_QuerySpec ()
PPCODE:
{
int freq, channels;
Uint16 format;
if (Mix_QuerySpec (&freq, &format, &channels))
CODE:
setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&val, sizeof (val));
void
win32_proxy_info ()
PPCODE:
{
#ifdef _WIN32
char buffer[2048];
DWORD buflen;
void
load_image_inline (SV *image_)
ALIAS:
load_image_file = 1
PPCODE:
{
STRLEN image_len;
char *image = (char *)SvPVbyte (image_, image_len);
SDL_Surface *surface, *surface2;
SDL_PixelFormat fmt;
SDL_FreeSurface (surface2);
}
void
average (int x, int y, uint32_t *data)
PPCODE:
{
uint32_t r = 0, g = 0, b = 0, a = 0;
x = y = x * y;
pango_layout_set_attributes (self->pl, attrs);
}
void
get_shapes (DC::Layout self)
PPCODE:
{
PangoLayoutIter *iter = pango_layout_get_iter (self->pl);
do
{
CODE:
pango_layout_set_single_paragraph_mode (self->pl, !!spm);
void
size (DC::Layout self)
PPCODE:
{
int w, h;
layout_get_pixel_size (self, &w, &h);
OUTPUT:
RETVAL
void
cursor_pos (DC::Layout self, int index)
PPCODE:
{
PangoRectangle pos;
pango_layout_get_cursor_pos (self->pl, index, &pos, 0);
EXTEND (SP, 3);
PUSHs (sv_2mortal (newSViv (pos.height / PANGO_SCALE)));
}
void
index_to_line_x (DC::Layout self, int index, int trailing = 0)
PPCODE:
{
int line, x;
pango_layout_index_to_line_x (self->pl, index, trailing, &line, &x);
#if !PANGO_VERSION_CHECK (1, 17, 3)
PUSHs (sv_2mortal (newSViv (x / PANGO_SCALE)));
}
void
line_x_to_index (DC::Layout self, int line, int x)
PPCODE:
{
PangoLayoutLine *lp;
int index, trailing;
if (line < 0)
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
void
expire_textures (DC::Map self, int texid, int count)
PPCODE:
for (; texid < self->texs && count; ++texid, --count)
{
maptex *tex = self->tex + texid;
if (tex->name)
glDisable (GL_TEXTURE_2D);
}
void
fow_texture (DC::Map self, int mx, int my, int sw, int sh)
PPCODE:
{
int x, y;
int sw1 = sw + 2;
int sh1 = sh + 2;
int sh3 = sh * 3;
OUTPUT:
RETVAL
void
set_rect (DC::Map self, int x0, int y0, SV *data_sv)
PPCODE:
{
int x, y, z;
int w, h;
int x1, y1;
STRLEN len;
PROTOTYPES: DISABLE
void
decoders ()
PPCODE:
#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
int i, num = Mix_GetNumChunkDecoders ();
EXTEND (SP, num);
for (i = 0; i < num; ++i)
PUSHs (sv_2mortal (newSVpv (Mix_GetChunkDecoder (i), 0)));
MODULE = Deliantra::Client PACKAGE = DC::MixMusic
void
decoders ()
PPCODE:
#if SDL_MIXER_MAJOR_VERSION > 1 || SDL_MIXER_MINOR_VERSION > 2 || SDL_MIXER_PATCHLEVEL >= 10
int i, num = Mix_GetNumMusicDecoders ();
EXTEND (SP, num);
for (i = 0; i < num; ++i)
PUSHs (sv_2mortal (newSVpv (Mix_GetMusicDecoder (i), 0)));
PROTOTYPES: DISABLE
void
find_widget (SV *self, NV x, NV y)
PPCODE:
{
if (within_widget (self, x, y))
XPUSHs (self);
}
view all matches for this distribution
view release on metacpan or search on metacpan
fallback/const-xs.inc view on Meta::CPAN
/* 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:
type = constant(aTHX_ s, len);
/* 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:
view all matches for this distribution
view release on metacpan or search on metacpan
cv_set_call_checker(assert_cv, assert_checker, (SV*)assert_cv);
}
void
assert_on(...)
PPCODE:
{
if (items != 1) croak("Wrong number of arguments in assert() call");
if (SvTRUE(ST(0))) XSRETURN_UNDEF;
PUSHMARK(SP);
view all matches for this distribution
view release on metacpan or search on metacpan
int st_start, st_pos;
int pos = 0;
int state = 'r';
int line = 1;
int plevel = 0;
PPCODE:
base_str = SvPV(in_str, length);
if (length == 0) croak("cc_exprstr: length=0");
targ_str = SvPV(in_target, targlen);
relen = myrelen(targ_str, targlen);
while (pos < length) {
char *targ_str;
int st_start, st_pos;
int pos = 0;
int state = 'r';
int line = 1;
PPCODE:
base_str = SvPV(in_str, length);
if (length == 0) croak("cc_strstr: length=0");
targ_str = SvPV(in_target, targlen);
relen = myrelen(targ_str, targlen);
while (pos < length) {
int opens,closes;
int st_start;
int st_pos;
char state;
char paren2;
PPCODE:
/*warn("---BEGIN codeblock\n");/**/
if (!(paren1 == '(' || paren1 == '{'))
croak("extract_balanced: only works on () and {}");
paren2 = paren1 == '('? ')' : '}';
base_str = SvPV(in_str, length);
view all matches for this distribution
view release on metacpan or search on metacpan
Callsite.xs view on Meta::CPAN
callsite(level = 0)
I32 level
PREINIT:
const PERL_CONTEXT *cx, *dbcx;
int rv = 1;
PPCODE:
cx = caller_cx(level, &dbcx);
if (!cx) XSRETURN_EMPTY;
mXPUSHu(MY_RETOP(cx));
if (GIMME == G_ARRAY && CopSTASH_eq(PL_curcop, PL_debstash)) {
view all matches for this distribution
view release on metacpan or search on metacpan
void
set_criteria(flag)
unsigned flag
PREINIT:
dMY_CXT;
PPCODE:
MY_CXT.covering = flag;
/* fprintf(stderr, "Cover set to %d\n", flag); */
if (MY_CXT.replace_ops) return;
PL_runops = MY_CXT.covering ? runops_cover : runops_orig;
void
add_criteria(flag)
unsigned flag
PREINIT:
dMY_CXT;
PPCODE:
MY_CXT.covering |= flag;
if (MY_CXT.replace_ops) return;
PL_runops = MY_CXT.covering ? runops_cover : runops_orig;
void
remove_criteria(flag)
unsigned flag
PREINIT:
dMY_CXT;
PPCODE:
MY_CXT.covering &= ~flag;
if (MY_CXT.replace_ops) return;
PL_runops = MY_CXT.covering ? runops_cover : runops_orig;
unsigned
OUTPUT:
RETVAL
void
set_first_init_and_end()
PPCODE:
set_firsts_if_needed(aTHX);
void
collect_inits()
PREINIT:
dMY_CXT;
PPCODE:
int i;
if (!MY_CXT.ends) MY_CXT.ends = newAV();
NDEB(svdump(MY_CXT.ends));
if (PL_initav)
for (i = 0; i <= av_len(PL_initav); i++) {
void
set_last_end()
PREINIT:
dMY_CXT;
PPCODE:
int i;
SV *end = (SV *)get_cv("last_end", 0);
av_push(PL_endav, end);
NDEB(svdump(end));
if (!MY_CXT.ends) MY_CXT.ends = newAV();
view all matches for this distribution
view release on metacpan or search on metacpan
MODULE = Devel::DProf PACKAGE = DB
void
sub(...)
PPCODE:
{
dORIGMARK;
HV * const oldstash = PL_curstash;
SV * const Sub = GvSV(PL_DBsub); /* name of current sub */
/* SP -= items; added by xsubpp */
MODULE = Devel::DProf PACKAGE = Devel::DProf
void
END()
PPCODE:
{
if (PL_DBsub) {
/* maybe the process forked--we want only
* the parent's profile.
*/
view all matches for this distribution
view release on metacpan or search on metacpan
MODULE = Devel::DTrace PACKAGE = Devel::DTrace
PROTOTYPES: ENABLE
void
_dtrace_hook_runops()
PPCODE:
{
runops_hook();
}
view all matches for this distribution
view release on metacpan or search on metacpan
@_ is not set up, because the sub is an XS.
*/
I32 noargs = (PL_op->op_flags & OPf_STACKED) ? 0 : G_NOARGS;
bool in_debugger;
int retcount;
PPCODE:
/*
We're passing through our arguments unmodified, so we can
re-push them in place, or just restore the MARK declared by
the implicit dXSARGS, and get the non-adjusted stack pointer
from the interpreter global.
view all matches for this distribution
view release on metacpan or search on metacpan
FastProf.xs view on Meta::CPAN
MODULE = Devel::FastProf PACKAGE = DB
PROTOTYPES: DISABLE
void DB(...)
PPCODE:
{
IV ticks;
if (usecputime) {
struct tms buf;
times(&buf);
FastProf.xs view on Meta::CPAN
#endif
}
}
void _finish()
PPCODE:
{
if (out) {
if (canfork) {
flock_and_header(aTHX);
fflush(out);
FastProf.xs view on Meta::CPAN
}
}
void _init(char *_outname, int _usecputime, int _canfork)
PPCODE:
{
out = fopen(_outname, "wb");
if (!out) Perl_croak(aTHX_ "unable to open file %s for writing", _outname);
fwrite("D::FP-" XS_VERSION "\0\0\0\0\0\0\0", 1, 12, out);
putmark(3);
FastProf.xs view on Meta::CPAN
MODULE = Devel::FastProf PACKAGE = Devel::FastProf::Reader
void _read_file(char *infn)
PPCODE:
{
HV *ticks = get_hv("Devel::FastProf::Reader::TICKS", TRUE);
HV *count = get_hv("Devel::FastProf::Reader::COUNT", TRUE);
AV *fn = get_av("Devel::FastProf::Reader::FN", TRUE);
AV *src = get_av("Devel::FastProf::Reader::SRC", TRUE);
view all matches for this distribution
view release on metacpan or search on metacpan
FindBlessedRefs.xs view on Meta::CPAN
PREINIT:
SV* sva;
SV* svend;
SV* sv;
PPCODE:
// this stuff is mostly from perl-5.8.8/sv.c, but cleaned up to look like ordinary XS
for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) {
svend = &sva[SvREFCNT(sva)];
for (sv = sva + 1; sv < svend; ++sv) {
view all matches for this distribution