view release on metacpan or search on metacpan
StarDict.xs view on Meta::CPAN
StarDict::DESTROY()
void
StarDict::dictionaries()
PPCODE:
dTARG;
// result array
AV* dicts = (AV *)sv_2mortal((SV *)newAV());
StarDict.xs view on Meta::CPAN
void
StarDict::search( str )
char * str
PPCODE:
LibCore::SearchResultsList res;
bool is_found=false;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/Stem/Snowball/Ca.xs view on Meta::CPAN
}
void
_derive_stemmer(self_hash)
HV *self_hash;
PPCODE:
{
SV **sv_ptr;
char *lang;
char *encoding;
int i;
lib/Lingua/Stem/Snowball/Ca.xs view on Meta::CPAN
void
stem_in_place(self_hash, words_av)
HV *self_hash;
AV *words_av;
PPCODE:
{
IV stemmer_id;
SV **sv_ptr;
Stemmifier *stemmifier;
SV *stemmifier_sv;
lib/Lingua/Stem/Snowball/Ca.xs view on Meta::CPAN
OUTPUT: RETVAL
void
DESTROY(self_sv)
SV *self_sv;
PPCODE:
{
int i;
IV temp = SvIV( SvRV(self_sv) );
Stemmifier *stemmifier = INT2PTR(Stemmifier*, temp);
for (i = 0; i < NUMSTEM; i++) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/Stem/Snowball/Lt.xs view on Meta::CPAN
}
void
_derive_stemmer(self_hash)
HV *self_hash;
PPCODE:
{
SV **sv_ptr;
char *lang;
char *encoding;
int i;
lib/Lingua/Stem/Snowball/Lt.xs view on Meta::CPAN
void
stem_in_place(self_hash, words_av)
HV *self_hash;
AV *words_av;
PPCODE:
{
IV stemmer_id;
SV **sv_ptr;
Stemmifier *stemmifier;
SV *stemmifier_sv;
lib/Lingua/Stem/Snowball/Lt.xs view on Meta::CPAN
OUTPUT: RETVAL
void
DESTROY(self_sv)
SV *self_sv;
PPCODE:
{
int i;
IV temp = SvIV( SvRV(self_sv) );
Stemmifier *stemmifier = INT2PTR(Stemmifier*, temp);
for (i = 0; i < NUMSTEM; i++) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lingua/Stem/Snowball.xs view on Meta::CPAN
}
void
_derive_stemmer(self_hash)
HV *self_hash;
PPCODE:
{
SV **sv_ptr;
char *lang;
char *encoding;
int i;
lib/Lingua/Stem/Snowball.xs view on Meta::CPAN
}
OUTPUT: RETVAL
void
stemmers(...)
PPCODE:
{
int i;
for (i = 0; i < NUMLANG; i++) {
XPUSHs( sv_2mortal(
newSVpvn( lang_encs[i].lang, strlen(lang_encs[i].lang) )
lib/Lingua/Stem/Snowball.xs view on Meta::CPAN
void
stem_in_place(self_hash, words_av)
HV *self_hash;
AV *words_av;
PPCODE:
{
IV stemmer_id;
SV **sv_ptr;
Stemmifier *stemmifier;
SV *stemmifier_sv;
lib/Lingua/Stem/Snowball.xs view on Meta::CPAN
OUTPUT: RETVAL
void
DESTROY(self_sv)
SV *self_sv;
PPCODE:
{
int i;
IV temp = SvIV( SvRV(self_sv) );
Stemmifier *stemmifier = INT2PTR(Stemmifier*, temp);
for (i = 0; i < NUMSTEM; i++) {
view all matches for this distribution
view release on metacpan or search on metacpan
Simplified.xs view on Meta::CPAN
STRLEN srclen, mblen;
U8 *s, *e, *p;
bool has_cv = 0;
bool has_pv = 0;
STDCHAR **lb, *tb;
PPCODE:
ref = NULL;
if (0 < items && SvROK(ST(0))) {
ref = SvRV(ST(0));
if (SvTYPE(ref) == SVt_PVCV)
has_cv = TRUE;
Simplified.xs view on Meta::CPAN
U16 mc, *t;
struct mbc_contra *p_contra, *cel_contra, **row_contra;
UV uv;
bool has_cv = 0;
bool has_pv = 0;
PPCODE:
ref = NULL;
if (0 < items && SvROK(ST(0))) {
ref = SvRV(ST(0));
if (SvTYPE(ref) == SVt_PVCV)
has_cv = TRUE;
view all matches for this distribution
view release on metacpan or search on metacpan
Traditional.xs view on Meta::CPAN
STRLEN srclen, mblen;
U8 *s, *e, *p;
bool has_cv = 0;
bool has_pv = 0;
STDCHAR **lb, *tb;
PPCODE:
ref = NULL;
if (0 < items && SvROK(ST(0))) {
ref = SvRV(ST(0));
if (SvTYPE(ref) == SVt_PVCV)
has_cv = TRUE;
Traditional.xs view on Meta::CPAN
U16 mc, *t;
struct mbc_contra *p_contra, *cel_contra, **row_contra;
UV uv;
bool has_cv = 0;
bool has_pv = 0;
PPCODE:
ref = NULL;
if (0 < items && SvROK(ST(0))) {
ref = SvRV(ST(0));
if (SvTYPE(ref) == SVt_PVCV)
has_cv = TRUE;
view all matches for this distribution
view release on metacpan or search on metacpan
void
chunk(chu, i=0, tmp=NULL)
Chu chu
unsigned long int i
SV* tmp
PPCODE:
if (chu->num_chunk <= 0) XSRETURN_EMPTY;
EXTEND(SP, chu->num_chunk);
for (; i < chu->num_chunk; i++) {
tmp = newSV(0);
sv_setref_pv(tmp, "Lingua::ZH::TaBE::Chunk", &(chu->chunk[i]));
void
tsi(chunk, i=0, tmp=NULL)
Chunk chunk
unsigned long int i
SV* tmp
PPCODE:
if (chunk->num_tsi <= 0) XSRETURN_EMPTY;
EXTEND(SP, chunk->num_tsi);
for (; i < chunk->num_tsi; i++) {
tmp = newSV(0);
sv_setref_pv(tmp, "Lingua::ZH::TaBE::Tsi", &(chunk->tsi[i]));
void
yindata(tsi, i=0, tmp=NULL)
Tsi tsi
unsigned long int i
SV* tmp
PPCODE:
if (tsi->yinnum <= 0) XSRETURN_EMPTY;
EXTEND(SP, tsi->yinnum);
for (; i < tsi->yinnum; i++) {
tmp = newSV(0);
sv_setref_uv(tmp, "Lingua::ZH::TaBE::Yin", tsi->yindata[i]);
tsidata(tsiyin, i=0, tmp=NULL, tsi=NULL)
TsiYin tsiyin
unsigned long int i
Tsi tsi
SV * tmp
PPCODE:
if (tsiyin->tsinum <= 0) XSRETURN_EMPTY;
EXTEND(SP, tsiyin->tsinum);
for (; i < tsiyin->tsinum; i++) {
New(0, tsi, 1, struct TsiInfo);
strncpy(
view all matches for this distribution
view release on metacpan or search on metacpan
MODULE = Linux::ACL PACKAGE = Linux::ACL
void
getfacl(filename)
SV * filename;
PPCODE:
HV *acl, *default_acl;
STRLEN filename_string_length;
char *filename_string = SvPV(filename, filename_string_length);
int count = getfacl_internal(filename_string, &acl, &default_acl);
void
setfacl(filename, acl_hashref, ...)
SV *filename;
SV *acl_hashref;
PPCODE:
STRLEN filename_string_length;
char* filename_string = SvPV(filename, filename_string_length);
HV *acl_hash = derefHV(acl_hashref);
HV *default_acl_hash = NULL;
if( items > 2 )
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:
/* 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 */
view all matches for this distribution
view release on metacpan or search on metacpan
xs/DVBT-ad-tie.c view on Meta::CPAN
ADA_METHOD(EXISTS);
HV *results ;
int frame ;
PPCODE:
ADA_CHECK_THIS ;
if (THIS->type == ADAV_ADATA)
{
if ((idx >= THIS->user_data->results_list_size) || (idx < 0))
view all matches for this distribution
view release on metacpan or search on metacpan
PROTOTYPES: DISABLE
void
_consts ()
PPCODE:
const struct consts *c;
for (c = consts;
c < consts + sizeof (consts) / sizeof (consts[0]);
c++)
{
view all matches for this distribution
view release on metacpan or search on metacpan
void
timer_heap_pop_expired(heap, now_ns)
SV *heap
IV now_ns
PPCODE:
le_timer_heap_t *h = le_timer_heap_from_sv(heap);
while (h->size) {
le_timer_drop_cancelled_roots(h);
if (!h->size) break;
if (h->heap[0].deadline_ns > now_ns) break;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/FD/Mem.xs view on Meta::CPAN
void
get_seals(file_handle)
SV* file_handle;
PREINIT:
int seals, fd, i;
PPCODE:
fd = get_fd(file_handle);
seals = fcntl(fd, F_GET_SEALS, 0);
for (i = 0; i < sizeof seal_flags / sizeof *seal_flags; ++i) {
if (seal_flags[i].value & seals)
mXPUSHp(seal_flags[i].key, seal_flags[i].length);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/FD.xs view on Meta::CPAN
RETVAL
void get_timeout(Fd timerfd)
PREINIT:
struct itimerspec value;
PPCODE:
if (timerfd_gettime(timerfd, &value) == -1)
die_sys("Couldn't get_timeout: %s");
mXPUSHn(timespec_to_nv(&value.it_value));
if (GIMME_V == G_ARRAY)
mXPUSHn(timespec_to_nv(&value.it_interval));
SV* set_timeout(Fd timerfd, struct timespec new_value, struct timespec new_interval = NEVER, bool abstime = FALSE)
PREINIT:
struct itimerspec new_itimer, old_itimer;
PPCODE:
new_itimer.it_value = new_value;
new_itimer.it_interval = new_interval;
if (timerfd_settime(timerfd, (abstime ? TIMER_ABSTIME : 0), &new_itimer, &old_itimer) == -1)
die_sys("Couldn't set_timeout: %s");
mXPUSHn(timespec_to_nv(&old_itimer.it_value));
lib/Linux/FD.xs view on Meta::CPAN
RETVAL
void clocks(SV* classname)
INIT:
int i;
PPCODE:
for (i = 0; i < sizeof clocks / sizeof *clocks; ++i)
mXPUSHp(clocks[i].key, clocks[i].length);
view all matches for this distribution
view release on metacpan or search on metacpan
Fanotify.xs view on Meta::CPAN
ssize_t len;
int size;
int fd;
SV *event;
SV *eventref;
PPCODE:
/*
* Check arguments and allocate read buffer
*/
if (max < 1) {
max = 170; // Results in a buffer slightly smaller than 4k
view all matches for this distribution
view release on metacpan or search on metacpan
Inotify2.xs view on Meta::CPAN
CODE:
fcntl (fd, F_SETFL, blocking ? 0 : O_NONBLOCK);
void
inotify_read (int fd, int size = 8192)
PPCODE:
{
char buf [size], *cur, *end;
int got = read (fd, buf, size);
if (got < 0)
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
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:
/* 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 */
view all matches for this distribution
view release on metacpan or search on metacpan
Linux::Proc::Cpuinfo
new(package, ...)
char *package
PREINIT:
char *filename = NULL;
PPCODE:
if (items > 1) {
filename = (char *)SvPV_nolen(ST(1));
proccpuinfo_set_filename(filename);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
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);
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
{
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
{
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
{
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
{
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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);;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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);;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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);;
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
lib/Linux/RTC/Ioctl.xs view on Meta::CPAN
#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)
{
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:
/* 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 */
view all matches for this distribution
view release on metacpan or search on metacpan
- Almost complete rewrite of the function!
- Changed the interface, to setns(). Now instead of file descriptor we directly give it path to a namespace file. This removes the need to convert Perl FD into C FD.
- Improved the error handling and now we catch all setns() errors
- Replaced __NR_setns with SYS_setns. In order for the change to work I also changed the included headers
- Simplified the setns() function in the XS code
- Replaced the PPCODE with CODE and now I properly return the RETVAL from the XS code
- Added new test for invalid path
0.05 Fri Jun 03 10:52:49 2016
- Replaced the Perl 5.18 requirement with Perl 5.10
view all matches for this distribution
view release on metacpan or search on metacpan
void
getspnam (name)
const char * name
INIT:
struct spwd *shadow;
PPCODE:
shadow = getspnam(name);
if (shadow) {
XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_namp)));
XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_pwdp)));
XPUSHs(sv_2mortal(newSViv(shadow->sp_lstchg)));
void
getspent ()
INIT:
struct spwd *shadow;
PPCODE:
shadow = getspent();
if (shadow) {
XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_namp)));
XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_pwdp)));
XPUSHs(sv_2mortal(newSViv(shadow->sp_lstchg)));
view all matches for this distribution
view release on metacpan or search on metacpan
MODULE = Linux::Smaps::Tiny PACKAGE = Linux::Smaps::Tiny
PROTOTYPES: DISABLE
SV*
get_smaps_summary(char* process = "self")
PPCODE:
struct smaps_sizes sizes;
memset(&sizes, 0, sizeof sizes);
char filename[100];
memset(&filename, 0, sizeof filename);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Socket/Accept4.xs view on Meta::CPAN
IO *gstio;
IO *nstio;
char namebuf[MAXPATHLEN];
Sock_size_t len = sizeof namebuf;
int fd;
PPCODE:
{
if (items !=3) {
croak("Usage: accept4(ngv, ggv, flags)");
}
switch (SvTYPE(ST(0))) {
view all matches for this distribution
view release on metacpan or search on metacpan
int xdim
int ydim
int cols
int xbytes
int bytespp
PPCODE:
IV newmode;
SV *retmode;
newmode = (IV)vga_addmode(xdim, ydim, cols, xbytes, bytespp);
int VDisplay
int VSyncStart
int VSyncEnd
int VTotal
int flags
PPCODE:
vga_addtiming(pixelClock,
HDisplay,
HSyncStart,
HSyncEnd,
HTotal,
int VDisplay
int VSyncStart
int VSyncEnd
int VTotal
int flags
PPCODE:
vga_changetiming(pixelClock,
HDisplay,
HSyncStart,
HSyncEnd,
HTotal,
void
clear(self)
SV *self
PPCODE:
vga_clear();
void
disabledriverreport(self)
SV *self
PPCODE:
vga_disabledriverreport();
void
drawline(self,x1, y1, x2, y2)
SV *self
int x1
int y1
int x2
int y2
PPCODE:
vga_drawline(x1,y1,x2,y2);
void
drawpixel(self,x, y)
SV *self
SV *x
SV *y
PPCODE:
int i_x;
int i_y;
i_x = (int)SvIV(x);
i_y = (int)SvIV(y);
void
drawscanline(self,line, colors)
SV *self
SV *line
SV *colors
PPCODE:
int _line;
char *_colors;
AV *av_colors;
if (SvROK(colors) && (SvTYPE(SvRV(colors)) == SVt_PVAV))
drawscansegment(self,colors, x, y)
SV *self
SV *colors
SV *x
SV *y
PPCODE:
int i_x;
int i_y;
int length;
char *_colors;
AV *av_colors;
}
SV *
getch(self)
SV *self
PPCODE:
UV c;
SV *ret;
c = (UV)vga_getch();
PUSHs(sv_2mortal(ret));
SV *
getcolors(self)
SV *self
PPCODE:
SV *num_colors;
num_colors = newSViv((IV)vga_getcolors());
EXTEND(SP,1);
PUSHs(sv_2mortal(num_colors));
SV *
getcurrentchipset(self)
SV *self
PPCODE:
IV chipset;
SV *ret;
chipset = (IV)vga_getcurrentchipset();
SV *
getcurrentmode(self)
SV *self
PPCODE:
IV mode;
SV *ret;
mode = (IV)vga_getcurrentmode();
PUSHs(sv_2mortal(ret));
void
getcurrenttiming(self)
SV *self
PPCODE:
int *pixelClock;
int *HDisplay;
int *HSyncStart;
int *HSyncEnd;
int *HTotal;
PUSHs(sv_2mortal(newSViv((IV) *flags)));
void
getdefaultmode(self)
SV *self
PPCODE:
SV *ret;
ret = newSViv(vga_getdefaultmode());
EXTEND(SP,1);
PUSHs(sv_2mortal(ret));
void
getkey(self)
SV *self
PPCODE:
int _key;
SV *key;
_key = vga_getkey();
void
getmodeinfo(self,mode)
SV *self
SV* mode
PPCODE:
vga_modeinfo *mi;
HV *mi_stash;
HV *mi_h;
SV *mi_ref;
SV *
getmodename(self,mode)
SV *self
SV *mode
PPCODE:
int i_mode;
SV *modename;
i_mode = SvIV(mode);
SV *
getmodenumber(self,name)
SV *self
SV *name
PPCODE:
SV *modenumber;
char *modename;
modename = SvPV_nolen(name);
PUSHs(modenumber);
void
getmonitortype(self)
SV *self
PPCODE:
EXTEND(SP,1);
PUSHs(sv_2mortal(newSViv(vga_getmonitortype())));
void
getpalette(self, index)
SV *self
int index
PPCODE:
int * red;
int * green;
int * blue;
vga_getpalette(index,red, green, blue);
void
getpixel(self,x, y)
SV *self
SV *x
SV *y
PPCODE:
IV pcol;
int i_x;
int i_y;
SV *ret;
getscansegment(self, x, y, length)
SV *self
SV *x
SV *y
SV *length
PPCODE:
char *_colors;
AV *av_colors;
SV *ret;
int i_x;
int i_y;
PUSHs(sv_2mortal(ret));
void
getxdim(self)
SV *self
PPCODE:
SV *xdim;
xdim = newSViv((IV)vga_getxdim());
EXTEND(SP,1);
PUSHs(sv_2mortal(xdim));
void
getydim(self)
SV *self
PPCODE:
SV *ydim;
ydim = newSViv((IV)vga_getydim());
EXTEND(SP,1);
PUSHs(sv_2mortal(ydim));
SV *
hasmode(self,mode)
SV *self
SV *mode
PPCODE:
IV ret;
SV *rc;
int _mode;
_mode = (int)SvIV(mode);
PUSHs(sv_2mortal(rc));
SV *
init(self)
SV * self
PPCODE:
SV *ret;
if (vga_init() != 0 )
{
ret = &PL_sv_no;
PUSHs(sv_2mortal(ret));
SV *
lastmodenumber(self)
SV *self
PPCODE:
SV *mode;
mode = newSViv(vga_lastmodenumber());
EXTEND(SP,1);
PUSHs(sv_2mortal(mode));
void
lockvc(self)
SV *self
PPCODE:
vga_lockvc();
SV *
oktowrite(self)
SV *self
PPCODE:
SV *ret;
EXTEND(SP,1);
if ( vga_oktowrite() == 0 )
{
ret = &PL_sv_yes;
void
screenoff(self)
SV *self
PPCODE:
vga_screenoff();
void
screenon(self)
SV *self
PPCODE:
vga_screenon();
void
setcolor(self,color)
SV *self
SV *color
PPCODE:
IV _color;
_color = SvIV(color);
vga_setcolor(_color);
SV *
setmode(self,mode)
SV *self
SV *mode
PPCODE:
IV _mode;
IV ret;
SV *rc;
_mode = SvIV(mode);
SV *self
SV *index
SV *red
SV *green
SV *blue
PPCODE:
int _index, _red, _green, _blue;
_index = SvIV(index);
_red = SvIV(red);
_green = SvIV(green);
setrgbcolor(self,red, green, blue)
SV *self
SV *red
SV *green
SV *blue
PPCODE:
int _red, _green, _blue;
_red = SvIV(red);
_green = SvIV(green);
_blue = SvIV(blue);
void
unlockvc(self)
SV *self
PPCODE:
vga_unlockvc();
void
white(self)
SV *self
PPCODE:
SV *white;
white = newSViv((IV)vga_white());
EXTEND(SP,1);
view all matches for this distribution
view release on metacpan or search on metacpan
Affinity.xs view on Meta::CPAN
IV cpu_isset (cpuset, cpu)
Linux_Sys_CPU_Affinity *cpuset
UV cpu
PPCODE:
int res = CPU_ISSET_S((uint32_t) cpu, cpuset->size, cpuset->set);
mXPUSHu( res );
XSRETURN(1);
void cpu_set (cpuset, cpu)
Linux_Sys_CPU_Affinity *cpuset
UV cpu
PPCODE:
CPU_SET_S((uint32_t) cpu, cpuset->size, cpuset->set);
XSRETURN_EMPTY;
void cpu_clr (cpuset, cpu)
Linux_Sys_CPU_Affinity *cpuset
UV cpu
PPCODE:
CPU_CLR_S((uint32_t) cpu, cpuset->size, cpuset->set);
XSRETURN_EMPTY;
UV cpu_count(cpuset)
Linux_Sys_CPU_Affinity *cpuset
PPCODE:
int cpu_count = CPU_COUNT_S(cpuset->size, cpuset->set);
mXPUSHu( cpu_count ); // PUSHs(sv_2mortal(newSVuv(cpu_count)));
XSRETURN(1);
IV cpu_equal (cpusetA, cpusetB)
Linux_Sys_CPU_Affinity *cpusetA
Linux_Sys_CPU_Affinity *cpusetB
PPCODE:
int res = 0;
if (cpusetA->size == cpusetB->size)
res = CPU_EQUAL_S(cpusetA->size, cpusetA->set, cpusetB->set);
mXPUSHu( res );
XSRETURN(1);
Affinity.xs view on Meta::CPAN
IV set_affinity(cpuset, pid)
Linux_Sys_CPU_Affinity *cpuset
UV pid
PPCODE:
int res = sched_setaffinity((pid_t) pid, cpuset->size, cpuset->set);
if (res == -1) {
SV *error = get_sched_error_text(errno, 0);
croak((char *) SvPV_nolen(error));
}
mXPUSHi( res );
XSRETURN(1);
void DESTROY (cpuset)
PPCODE:
Linux_Sys_CPU_Affinity *self = (Linux_Sys_CPU_Affinity *) SvUV(SvRV(ST(0)));
if (PL_dirty)
return;
CPU_FREE(self->set);
safefree(self);
XSRETURN_EMPTY;
IV get_nprocs ()
PPCODE:
int nprocs = get_available_nprocs();
mXPUSHi( nprocs );
XSRETURN(1);
view all matches for this distribution
view release on metacpan or search on metacpan
get_devices(bus)
struct sysfs_bus* bus
PREINIT:
struct dlist* dev_list = NULL;
struct sysfs_device* dev = NULL;
PPCODE:
dev_list = sysfs_get_bus_devices(bus);
if (dev_list == NULL)
XSRETURN_EMPTY;
get_drivers(bus)
struct sysfs_bus* bus
PREINIT:
struct dlist* drv_list = NULL;
struct sysfs_driver* drv = NULL;
PPCODE:
drv_list = sysfs_get_bus_drivers(bus);
if (drv_list == NULL)
XSRETURN_EMPTY;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Linux/Termios2.xs view on Meta::CPAN
void
getattr(self, fd)
Linux::Termios2 self
int fd
PPCODE:
if(ioctl(fd, TCGETS2, self))
XSRETURN_UNDEF;
ST(0) = &PL_sv_yes;
XSRETURN(1);
lib/Linux/Termios2.xs view on Meta::CPAN
void
setattr(self, fd, act)
Linux::Termios2 self
int fd
int act
PPCODE:
{
int ctl;
switch(act) {
case TCSANOW: ctl = TCSETS2; break;
case TCSADRAIN: ctl = TCSETSW2; break;
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:
/* 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 */
view all matches for this distribution