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
INCLUDE: const-xs.inc
void
VERSION_STRING()
PPCODE:
mXPUSHp(GD_VERSION_STRING,sizeof(GD_VERSION_STRING)-1);
void
LIBGD_VERSION()
PPCODE:
mXPUSHn(GD_VERSION/10000.0);
#if GD_VERSION >= 20101
bool
void
gdgetBounds(image)
GD::Image image
PROTOTYPE: $
PPCODE:
mXPUSHi(gdImageSX(image));
mXPUSHi(gdImageSY(image));
int
gdisTrueColor(image)
void
gdrgb(image,color)
GD::Image image
int color
PROTOTYPE: $$
PPCODE:
mXPUSHi(gdImageRed(image,color));
mXPUSHi(gdImageGreen(image,color));
mXPUSHi(gdImageBlue(image,color));
void
gdalpha(image,color)
GD::Image image
int color
PROTOTYPE: $$
PPCODE:
mXPUSHi(gdImageAlpha(image,color));
int
gdboundsSafe(image,x,y)
GD::Image image
SV** value;
int i;
int hdpi;
int vdpi;
gdFTStringExtra strex;
PPCODE:
{
#ifndef HAVE_FT
errormsg = perl_get_sv("@",0);
sv_setpv(errormsg,"libgd was not built with FreeType font support\n");
XSRETURN_EMPTY;
GD::Image image
PROTOTYPE: $;$$$$
PREINIT:
int coords[4];
int i;
PPCODE:
if (items == 5) {
for (i=0; i<4; i++)
coords[i] = (int)SvIV(ST(i+1));
gdImageSetClip(image,coords[0],coords[1],coords[2],coords[3]);
}
view all matches for this distribution
view release on metacpan or search on metacpan
GH/Align/Align.xs view on Meta::CPAN
void
globalMinDifferences(s1, s2)
char *s1
char *s2
PPCODE:
SV *rv = NULL;
rv = globalMinDifferences_helper(s1, s2);
if (rv) {
XPUSHs(sv_2mortal(rv));
GH/Align/Align.xs view on Meta::CPAN
void
boundedGlobalMinDifferences(s1, s2, bound)
char *s1
char *s2
int bound
PPCODE:
SV *rv = NULL;
rv = boundedGlobalMinDifferences_helper(s1, s2, bound);
if (rv) {
XPUSHs(sv_2mortal(rv));
GH/Align/Align.xs view on Meta::CPAN
void
boundedHirschbergGlobalMinDiffs(s1, s2, bound)
char *s1
char *s2
int bound
PPCODE:
SV *rv = NULL;
rv = boundedHirschbergGlobalMinDiffs_helper(s1, s2, bound);
if (rv) {
XPUSHs(sv_2mortal(rv));
view all matches for this distribution
view release on metacpan or search on metacpan
Magellan.xs view on Meta::CPAN
magellan_get_linked_list(List)
MWpt *List
PREINIT:
MWpt *Cur;
SV *sv_coord;
PPCODE:
if(List == NULL){
croak("magellan_get_linked_list(): got NULL.\n");
XSRETURN_UNDEF;
}
view all matches for this distribution
view release on metacpan or search on metacpan
void
revision()
PROTOTYPE:
PREINIT:
gsapi_revision_t rev;
PPCODE:
gsapi_revision(&rev, sizeof(rev));
EXTEND(SP, 4);
PUSHs(sv_2mortal(newSVpv(rev.product,0)));
PUSHs(sv_2mortal(newSVpv(rev.copyright, 0)));
PUSHs(sv_2mortal(newSViv(rev.revision)));
view all matches for this distribution
view release on metacpan or search on metacpan
void
_Initialize (self)
HV *self;
PPCODE:
opt_v = SvIV (*hv_fetch (self, "verbose", 7, 0));
if (opt_v) warn ("initialize ({ ... })\n");
unless (gn_lib_init () == GN_ERR_NONE)
void
_Connect (self)
HV *self;
PPCODE:
gn_error err;
if (opt_v) warn ("connect ()\n");
err = gn_lib_phoneprofile_load_from_file (configfile, configmodel, &state);
void
disconnect (self)
HvObject *self;
PPCODE:
if (opt_v) warn ("disconnect ()\n");
if (hv_exists (self, "connected", 9)) {
(void)hv_del (self, "connected");
busterminate ();
HvObject *self;
char *memtype;
int start;
int end;
PPCODE:
gn_phonebook_entry entry;
int mt, i, j;
AV *pb;
if (opt_v) warn ("GetPhonebook (%s, %d, %d)\n", memtype, start, end);
void
WritePhonebookEntry (self, pbh)
HvObject *self;
HV *pbh;
PPCODE:
gn_error err;
gn_phonebook_entry entry;
int mt, i;
SV **value;
char *str;
void
GetSpeedDial (self, location)
HvObject *self;
int location;
PPCODE:
gn_speed_dial *speeddial;
if (opt_v) warn ("Get Speed Dial %d\n", location);
if (location < 0)
HvObject *self;
char *memtype;
int location;
int number;
PPCODE:
/* TODO: This funtion is untested */
gn_error err;
gn_speed_dial entry;
clear_data ();
void
GetDateTime (self)
HvObject *self;
PPCODE:
gn_timestamp date_time;
if (opt_v) warn ("GetDateTime ()\n");
clear_data ();
void
SetDateTime (self, timestamp)
HvObject *self;
time_t timestamp;
PPCODE:
gn_error err;
gn_timestamp date;
/* TODO: This funtion is untested */
if (opt_v) warn ("SetDateTime (%ld)\n", (long)timestamp);
void
GetAlarm (self)
HvObject *self;
PPCODE:
gn_calnote_alarm alrm;
if (opt_v) warn ("GetAlarm ()\n");
clear_data ();
SetAlarm (self, hour, minute)
HvObject *self;
int hour;
int minute;
PPCODE:
gn_calnote_alarm at;
int err;
clear_data ();
if (hour < 0 || hour > 23) {
GetCalendarNotes (self, start, end)
HvObject *self;
int start;
int end;
PPCODE:
gn_calnote_list calendarnoteslist;
gn_calnote calendarnote;
int i, err;
AV *cnl = newAV ();
void
WriteCalendarNote (self, calhash)
HvObject *self;
HV *calhash;
PPCODE:
gn_calnote calnote;
char *buf;
time_t t1, *t2;
gn_timestamp *timestamp;
int err;
GetTodo (self, start, end)
HvObject *self;
int start;
int end;
PPCODE:
gn_todo_list todolist;
gn_todo todo;
int i, err;
AV *tdl = newAV ();
void
WriteTodo (self, todohash)
HvObject *self;
HV *todohash;
PPCODE:
gn_todo todo;
char *buf;
int err;
clear_data ();
void
DeleteAllTodos (self)
HvObject *self;
PPCODE:
int err;
clear_data ();
err = gn_sm_functions (GN_OP_DeleteAllToDos, data, state);
set_errori (err);
void
Ping (self)
HvObject *self;
PPCODE:
gn_error err;
if (opt_v) warn ("Ping ()\n");
unless (can_ping)
void
GetDisplayStatus (self)
HvObject *self;
PPCODE:
int status = 0;
if (opt_v) warn ("GetDisplayStatus ()\n");
clear_data ();
void
GetIMEI (self)
HvObject *self;
PPCODE:
char imei[64], model[64], rev[64], manufacturer[64];
if (opt_v) warn ("GetIMEI ()\n");
clear_data ();
void
GetPowerStatus (self)
HvObject *self;
PPCODE:
gn_power_source powersource = -1;
float batterylevel = -1;
gn_battery_unit batt_units = GN_BU_Arbitrary;
HV *ps = newHV ();
void
GetMemoryStatus (self)
HvObject *self;
PPCODE:
HV *ms = newHV ();
if (opt_v) warn ("GetMemoryStatus ()\n");
clear_data ();
GetProfiles (self, start, end)
HvObject *self;
int start;
int end;
PPCODE:
gn_profile profile;
gn_ringtone_list rtl;
char model[64] = "";
int i, max_profiles = 7;
HV *p;
void
GetSecurity (self)
HvObject *self;
PPCODE:
gn_security_code sc;
if (opt_v) warn ("GetSecurity ()\n");
clear_data ();
void
GetLogo (self, logodata)
HvObject *self;
HV *logodata;
PPCODE:
gn_bmp bitmap;
char *type;
if (opt_v) warn ("GetLogo ({ type => ... })\n");
void
GetRingtoneList (self)
HV *self;
PPCODE:
gn_ringtone_list ringtone_list;
if (opt_v) warn ("GetRingtoneList ()\n");
clear_data ();
void
GetRingtone (self, location)
HvObject *self;
int location;
PPCODE:
gn_ringtone ringtone;
gn_raw_data rawdata;
unsigned char buff[512];
if (opt_v) warn ("GetRingtone (%d)\n", location);
GetDirTree (self, memorytype, depth)
HvObject *self;
char *memorytype;
int depth;
PPCODE:
char *mt;
gn_file_list fl;
HV *dt;
if (opt_v) warn ("GetDirTree (%s, %d)\n", memorytype, depth);
HvObject *self;
char *memorytype;
char *path;
int depth;
PPCODE:
char *mt;
gn_file_list fl;
HV *dt;
if (opt_v) warn ("GetDir (%s, %s, %d)\n", memorytype, path, depth);
void
GetFile (self, path)
HvObject *self;
char *path;
PPCODE:
gn_file fi;
HV *dt;
if (opt_v) warn ("GetFile (%s)\n", path);
GetSMSCenter (self, start, end)
HvObject *self;
int start;
int end;
PPCODE:
gn_sms_message_center messagecenter;
int i, err;
AV *scl = newAV ();
if (opt_v) warn ("GetSMSCenter (%d, %d)\n", start, end);
void
GetSMSFolderList (self)
HvObject *self;
PPCODE:
gn_sms_folder_list folderlist;
AV *fl;
int i;
if (opt_v) warn ("GetSMSFolderList ()\n");
void
CreateSMSFolder (self, name)
HvObject *self;
char *name;
PPCODE:
gn_sms_folder folder;
int err;
if (strlen (name) >= GN_SMS_FOLDER_NAME_MAX_LENGTH) {
set_errors ("Folder name too long");
void
DeleteSMSFolder (self, location)
HvObject *self;
int location;
PPCODE:
gn_sms_folder folder;
int err;
if (location <= 0 || location > GN_SMS_FOLDER_MAX_NUMBER) {
set_errori (GN_ERR_INVALIDLOCATION);
void
GetSMSStatus (self)
HvObject *self;
PPCODE:
gn_sms_status SMSStatus;
if (opt_v) warn ("GetSMSStatus ()\n");
clear_data ();
GetSMS (self, memtype, location)
HvObject *self;
char *memtype;
int location;
PPCODE:
gn_sms message;
gn_sms_folder folder;
gn_sms_folder_list folderlist;
int i;
DeleteSMS (self, memtype, location)
HvObject *self;
char *memtype;
int location;
PPCODE:
gn_error err;
gn_sms message;
gn_sms_folder folder;
gn_sms_folder_list folderlist;
void
SendSMS (self, smshash)
HvObject *self;
HV *smshash;
PPCODE:
gn_sms sms;
SV **value;
char *str;
STRLEN l;
int err = GN_ERR_NONE;
void
GetRF (self)
HvObject *self;
PPCODE:
float rflevel = -1;
gn_rf_unit rfunit = GN_RF_Arbitrary;
HV *rf = newHV ();;
if (opt_v) warn ("GetRF ()\n");
void
GetNetworkInfo (self)
HvObject *self;
PPCODE:
gn_network_info NetworkInfo;
char buffer[10];
if (opt_v) warn ("GetNetworkInfo ()\n");
void
GetWapSettings (self, location)
HvObject *self;
int location;
PPCODE:
gn_wap_setting entry;
HV *ws;
if (opt_v) warn ("GetWapSettings (%d)\n", location);
void
WriteWapSetting (self, wh)
HvObject *self;
HV *wh;
PPCODE:
gn_error err;
gn_wap_setting entry;
char *buf;
STRLEN l;
void
ActivateWapSetting (self, location)
HvObject *self;
int location;
PPCODE:
gn_error err;
gn_wap_setting entry;
clear_data ();
Zero (&entry, 1, entry);
void
GetWapBookmark (self, location)
HvObject *self;
int location;
PPCODE:
gn_wap_bookmark entry;
if (opt_v) warn ("GetWapBookmark (%d)\n", location);
clear_data ();
void
WriteWapBookmark (self, wh)
HvObject *self;
HV *wh;
PPCODE:
gn_wap_bookmark entry;
clear_data ();
Zero (&entry, 1, entry);
hv_geti (wh, "location", entry.location);
void
DeleteWapBookmark (self, location)
HvObject *self;
int location;
PPCODE:
gn_error err;
gn_wap_bookmark entry;
clear_data ();
Zero (&entry, 1, entry);
view all matches for this distribution
view release on metacpan or search on metacpan
void
DESTROY(oid)
GSSAPI::OID oid
PREINIT:
OM_uint32 minor;
PPCODE:
#if !defined(HEIMDAL)
if (oid != NULL &&
oid != __KRB5_MECHTYPE_OID &&
oid != __KRB5_OLD_MECHTYPE_OID &&
oid != __GSS_KRB5_NT_USER_NAME &&
view all matches for this distribution
view release on metacpan or search on metacpan
xs/GstPropertyProbe.xs view on Meta::CPAN
void
gst_property_probe_get_probe_properties (probe)
GstPropertyProbe *probe
PREINIT:
const GList *result, *i;
PPCODE:
result = gst_property_probe_get_properties (probe);
for (i = result; i; i = i->next)
XPUSHs (sv_2mortal (newSVGParamSpec (i->data)));
# const GParamSpec * gst_property_probe_get_property (GstPropertyProbe *probe, const gchar *name);
xs/GstPropertyProbe.xs view on Meta::CPAN
ALIAS:
GStreamer::PropertyProbe::probe_and_get_probe_values = 1
PREINIT:
GValueArray *array;
int i;
PPCODE:
switch (ix) {
case 0:
array = gst_property_probe_get_values (probe, (const GParamSpec *) pspec);
break;
case 1:
xs/GstPropertyProbe.xs view on Meta::CPAN
ALIAS:
GStreamer::PropertyProbe::probe_and_get_probe_values_name = 1
PREINIT:
GValueArray *array;
int i;
PPCODE:
switch (ix) {
case 0:
array = gst_property_probe_get_values_name (probe, name);
break;
case 1:
view all matches for this distribution
view release on metacpan or search on metacpan
=for apidoc __hide__
=cut
void
GET_VERSION_INFO (class)
PPCODE:
EXTEND (SP, 3);
/* 0.10.17 provides these macros, but with a different name. */
#if GST_CHECK_VERSION (0, 10, 17)
PUSHs (sv_2mortal (newSViv (GST_VERSION_MAJOR)));
PUSHs (sv_2mortal (newSViv (GST_VERSION_MINOR)));
# void gst_version (guint *major, guint *minor, guint *micro, guint *nano);
void
gst_version (class)
PREINIT:
guint major, minor, micro, nano;
PPCODE:
PERL_UNUSED_VAR (ax);
gst_version (&major, &minor, µ, &nano);
EXTEND (sp, 3);
PUSHs (sv_2mortal (newSVuv (major)));
PUSHs (sv_2mortal (newSVuv (minor)));
view all matches for this distribution
view release on metacpan or search on metacpan
PREINIT:
GTop__Mountlist RETVAL;
GTop__Mountentry entry;
SV *svl, *sve;
PPCODE:
RETVAL = (glibtop_mountlist *)safemalloc(sizeof(*RETVAL));
trace_malloc(RETVAL);
entry = glibtop_get_mountlist(RETVAL, all_fs);
svl = sv_newmortal();
GTop__Proclist RETVAL;
unsigned *ptr;
SV *svl;
AV *av;
PPCODE:
RETVAL = (glibtop_proclist *)safemalloc(sizeof(*RETVAL));
trace_malloc(RETVAL);
ptr = glibtop_get_proclist(RETVAL, which, arg);
svl = sv_newmortal();
PREINIT:
GTop__ProcArgs RETVAL;
char *pargs;
SV *svl;
PPCODE:
RETVAL = (glibtop_proc_args *)safemalloc(sizeof(*RETVAL));
trace_malloc(RETVAL);
pargs = glibtop_get_proc_args(RETVAL, pid, arg);
svl = sv_newmortal();
PREINIT:
GTop__ProcMap RETVAL;
GTop__MapEntry entry;
SV *svl, *sve;
PPCODE:
RETVAL = (glibtop_proc_map *)safemalloc(sizeof(*RETVAL));
trace_malloc(RETVAL);
entry = glibtop_get_proc_map(RETVAL, pid);
svl = sv_newmortal();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Game/RaycastFOV.xs view on Meta::CPAN
SV *callback;
PREINIT:
int answer, i;
SV *x, *y;
PROTOTYPE: &@
PPCODE:
if (!(items & 1)) croak("uneven number of arguments");
dSP;
for (i = 1; i < items; i += 2) {
x = ST(i);
y = ST(i + 1);
lib/Game/RaycastFOV.xs view on Meta::CPAN
SV *callback;
PREINIT:
int i;
SV *x, *y;
PROTOTYPE: &@
PPCODE:
if (!(items & 1)) croak("uneven number of arguments");
dSP;
for (i = 1; i < items; i += 2) {
x = ST(i);
y = ST(i + 1);
lib/Game/RaycastFOV.xs view on Meta::CPAN
char *key;
int f, ddF_x, ddF_y, x, y;
HV* seen;
STRLEN len;
PROTOTYPE: &$$$
PPCODE:
dSP;
ENTER;
SAVETMPS;
sv_2mortal((SV *)(seen = newHV()));
f = 1 - radius;
lib/Game/RaycastFOV.xs view on Meta::CPAN
line (callback, int x0, int y0, int x1, int y1)
SV *callback;
PREINIT:
int answer, dx, dy, err, e2, sx, sy;
PROTOTYPE: &$$$$
PPCODE:
dSP;
dx = abs(x1 - x0);
dy = abs(y1 - y0);
sx = x0 < x1 ? 1 : -1;
sy = y0 < y1 ? 1 : -1;
lib/Game/RaycastFOV.xs view on Meta::CPAN
char *key;
long newx, newy;
HV* seen;
STRLEN len;
PROTOTYPE: &$$$$$$
PPCODE:
dSP;
sv_2mortal((SV *)(seen = newHV()));
while (angle < max_angle) {
newx = x0 + lrint(radius * cos(angle));
newy = y0 + lrint(radius * sin(angle));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Game/Xomb.xs view on Meta::CPAN
bypair (callback, ...)
SV *callback;
PREINIT:
int i;
SV *x, *y;
PPCODE:
if (!(items & 1)) croak("uneven number of arguments");
dSP;
for (i = 1; i < items; i += 2) {
x = ST(i);
y = ST(i + 1);
lib/Game/Xomb.xs view on Meta::CPAN
# init_jsf - setup the RNG (see src/jsf.*)
void
init_jsf (seed)
UV seed
PPCODE:
raninit(seed);
UV
irand (uint32_t max)
CODE:
lib/Game/Xomb.xs view on Meta::CPAN
void
linecb (callback, int x0, int y0, int x1, int y1)
SV *callback;
PREINIT:
int answer, dx, dy, err, e2, sx, sy, online, iters;
PPCODE:
dSP;
dx = abs(x1 - x0);
dy = abs(y1 - y0);
sx = x0 < x1 ? 1 : -1;
sy = y0 < y1 ? 1 : -1;
lib/Game/Xomb.xs view on Meta::CPAN
void
walkcb (callback, int x0, int y0, int x1, int y1)
SV *callback;
PREINIT:
int answer, dx, dy, err, e2, sx, sy, online, iters;
PPCODE:
dSP;
dx = abs(x1 - x0);
dy = abs(y1 - y0);
sx = x0 < x1 ? 1 : -1;
sy = y0 < y1 ? 1 : -1;
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
lib/Plack/Handler/Gazelle.xs view on Meta::CPAN
HV * env;
int flag = 1;
ssize_t rv = 0;
ssize_t buf_len;
ssize_t reqlen;
PPCODE:
{
/* if ( my ($conn, $buf, $env) = accept_buffer(fileno($server),timeout,tcp,host,port) */
len = sizeof(cliaddr);
fd = _accept(fileno, (struct sockaddr *)&cliaddr, len);
view all matches for this distribution
view release on metacpan or search on metacpan
gearman_return_t ret;
const char *w;
size_t w_size;
void *result;
size_t result_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= SvPV(workload, w_size);
result= gearman_client_do(self->client, function_name, unique, w, w_size,
&result_size, &ret);
gearman_return_t ret;
const char *w;
size_t w_size;
void *result;
size_t result_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= SvPV(workload, w_size);
result= gearman_client_do_high(self->client, function_name, unique, w,
w_size, &result_size, &ret);
gearman_return_t ret;
const char *w;
size_t w_size;
void *result;
size_t result_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= SvPV(workload, w_size);
result= gearman_client_do_low(self->client, function_name, unique, w,
w_size, &result_size, &ret);
char *job_handle;
char *unique= NULL;
const char *w;
size_t w_size;
gearman_return_t ret;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
Newxz(job_handle, GEARMAN_JOB_HANDLE_SIZE, char);
w= SvPV(workload, w_size);
ret= gearman_client_do_background(self->client, function_name, unique, w,
char *job_handle;
char *unique= NULL;
const char *w;
size_t w_size;
gearman_return_t ret;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
Newxz(job_handle, GEARMAN_JOB_HANDLE_SIZE, char);
w= SvPV(workload, w_size);
ret= gearman_client_do_high_background(self->client, function_name, unique,
char *job_handle;
char *unique= NULL;
const char *w;
size_t w_size;
gearman_return_t ret;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
Newxz(job_handle, GEARMAN_JOB_HANDLE_SIZE, char);
w= SvPV(workload, w_size);
ret= gearman_client_do_low_background(self->client, function_name, unique,
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
char *unique= NULL;
gearman_return_t ret;
gearman_task_context_st *context;
const void *w;
size_t w_size;
PPCODE:
if (items > 3)
unique= SvPV_nolen(ST(3));
w= _get_string(workload, &w_size);
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
do_status(self)
gearman_xs_client *self
PREINIT:
uint32_t numerator;
uint32_t denominator;
PPCODE:
gearman_client_do_status(self->client, &numerator, &denominator);
XPUSHs(sv_2mortal(newSVuv(numerator)));
XPUSHs(sv_2mortal(newSVuv(denominator)));
void
gearman_return_t ret;
bool is_known;
bool is_running;
uint32_t numerator;
uint32_t denominator;
PPCODE:
ret= gearman_client_job_status(self->client, job_handle, &is_known, &is_running,
&numerator, &denominator);
XPUSHs(sv_2mortal(newSViv(ret)));
XPUSHs(sv_2mortal(newSViv(is_known)));
XPUSHs(sv_2mortal(newSViv(is_running)));
const char *job_handle
PREINIT:
gearman_task_st *task;
gearman_return_t ret;
gearman_task_context_st *context;
PPCODE:
Newxz(context, 1, gearman_task_context_st);
context->client= self->client;
task= gearman_client_add_task_status(self->client, NULL, context, job_handle, &ret);
XPUSHs(sv_2mortal(newSViv(ret)));
XPUSHs(sv_2mortal(_bless("Gearman::XS::Task", task)));
view all matches for this distribution
view release on metacpan or search on metacpan
#define newSVpvn_nolen_undef(s) newSVpvn(s, s ? strlen(s) : 0)
MODULE = Geo::Address::Mail::Standardizer::USPS::AMS PACKAGE = Geo::Address::Mail::Standardizer::USPS::AMS PREFIX = ams_
void ams_init(SV * self)
PPCODE:
Z4OPEN_PARM z4cfg;
int status;
char * statedir;
char * datadir;
char * path_comm;
view all matches for this distribution
view release on metacpan or search on metacpan
PROTOTYPES: DISABLE
void new ( char *klass, ... )
PREINIT:
int add_count = items - 1;
PPCODE:
{
SV *pv = NEWSV ( 0, sizeof( GCX ) );
HV *options = newHV();
int i = 0;
SvPOK_only( pv );
view all matches for this distribution
view release on metacpan or search on metacpan
MODULE = Geo::Coordinates::MGRS::XS PACKAGE = Geo::Coordinates::MGRS::XS
void mgrs_to_utm(mgrs)
char *mgrs;
PPCODE:
long zone;
char hemisphere;
double easting;
double northing;
croak("Unable to convert MGRS coordinates %ld (%s)", err, mgrs);
}
void mgrs_to_latlon(mgrs)
char *mgrs;
PPCODE:
double latitude;
double longitude;
long err = Convert_MGRS_To_Geodetic(mgrs, &latitude, &longitude);
if(!err) {
view all matches for this distribution
view release on metacpan or search on metacpan
PROTOTYPE: $$$
PREINIT:
int zone = 0;
char zone_letter = 0;
double easting, northing;
PPCODE:
_latlon_to_utm(aTHX_ ename, latitude_deg, longitude_deg,
&zone, &zone_letter, &easting, &northing);
XPUSHs(sv_2mortal(newSVpvf("%d%c", zone, zone_letter)));
XPUSHs(sv_2mortal(newSVnv(easting)));
XPUSHs(sv_2mortal(newSVnv(northing)));
PROTOTYPE: $$$$
PREINIT:
int zone_number;
char zone_letter;
double easting, northing;
PPCODE:
zone_letter = 0;
_zonesv_to_number_letter(aTHX_ zone, &zone_number, &zone_letter);
if (zone_number < 0 || zone_number > 60)
Perl_croak(aTHX_ "Zone value (%d) invalid.", zone_number);
_latlon_to_utm(aTHX_ ename, latitude_deg, longitude_deg,
SV *ename
SV *zone
double easting
double northing
PROTOTYPE: $$$$
PPCODE:
{
int index;
double radius, inv_radius, eccentricity_2, eccentricity_4, eccentricity_6, eccentricity_prime_2;
double x, y;
double longitude_origin_deg;
view all matches for this distribution
view release on metacpan or search on metacpan
toVH (lat, lon)
double lat
double lon
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
toVH(lat, lon);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
toLatLon (v, h)
double v
double h
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
toLatLon(v, h);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
view all matches for this distribution
view release on metacpan or search on metacpan
xs/geohash.xs view on Meta::CPAN
PREINIT:
NV lat_min = 0, lat_max = 0, lon_min = 0, lon_max = 0;
STRLEN len = strlen(hash);
AV *lat_range = (AV *)sv_2mortal((SV *)newAV());
AV *lon_range = (AV *)sv_2mortal((SV *)newAV());
PPCODE:
PERL_UNUSED_VAR(self);
decode_to_interval(hash, len, &lat_min, &lat_max, &lon_min, &lon_max);
av_push(lat_range, newSVnv(lat_max));
av_push(lat_range, newSVnv(lat_min));
xs/geohash.xs view on Meta::CPAN
SV *self;
char *hash;
PREINIT:
NV lat = 0, lon = 0;
STRLEN len = strlen(hash);
PPCODE:
PERL_UNUSED_VAR(self);
decode(hash, len, &lat, &lon);
mXPUSHn(lat);
mXPUSHn(lon);
xs/geohash.xs view on Meta::CPAN
int offset;
PREINIT:
int i;
int nsize;
char **list;
PPCODE:
PERL_UNUSED_VAR(self);
neighbors(hash, strlen(hash), around, offset, &list, &nsize);
for( i = 0; i < nsize; i++ ) {
mXPUSHp( list[i], strlen(list[i]) );
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
PROTOTYPES: DISABLE
void
_new_with_code(...)
PPCODE:
{
if (items != 2) {
croak("Invalid argument count: %d", items);
}
const char *class = SvPV_nolen(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
}
}
void
_new_with_latlng(...)
PPCODE:
{
if (items != 4) {
croak("Invalid argument count: %d", items);
}
const char *class = SvPV_nolen(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
XSRETURN(1);
}
void
_new_with_xy(...)
PPCODE:
{
if (items != 4) {
croak("Invalid argument count: %d", items);
}
const char *class = SvPV_nolen(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
XSRETURN(1);
}
void
encode_geohex(...)
PPCODE:
{
if (items != 3) {
croak("Invalid argument count: %d", items);
}
const NV lat = SvNV(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
XSRETURN(1);
}
void
decode_geohex(...)
PPCODE:
{
if (items != 1) {
croak("Invalid argument count: %d", items);
}
const char *code = SvPV_nolen(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
}
}
void
geohex_hexsize(...)
PPCODE:
{
if (items != 1) {
croak("Invalid argument count: %d", items);
}
const UV level = SvUV(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
Geo::Hex::V3::XS::code = 4
Geo::Hex::V3::XS::level = 5
Geo::Hex::V3::XS::size = 6
PREINIT:
static const char *key[7] = {"lat", "lng", "x", "y", "code", "level", "size"};
PPCODE:
{
if (items != 1) {
croak("Invalid argument count: %d", items);
}
HV* state = (HV*)SvRV(ST(0));
lib/Geo/Hex/V3/XS.xs view on Meta::CPAN
XSRETURN(1);
}
void
polygon(...)
PPCODE:
{
if (items != 1) {
croak("Invalid argument count: %d", items);
}
HV* state = (HV*)SvRV(ST(0));
view all matches for this distribution
view release on metacpan or search on metacpan
name_by_ipnum_v6(gi, ptr)
GeoIP *gi
char * ptr
PREINIT:
char * n;
PPCODE:
ST(0) = sv_newmortal();
n = GeoIP_name_by_ipnum_v6(gi,*(geoipv6_t*)ptr);
if ( n != NULL ) {
ST(0) = newSVpv(n, strlen(n));
free(n);
name_by_addr_v6(gi, addr)
GeoIP *gi
char * addr
PREINIT:
char * n;
PPCODE:
ST(0) = sv_newmortal();
n = GeoIP_name_by_addr_v6(gi,addr);
if ( n != NULL ) {
ST(0) = newSVpv(n, strlen(n));
free(n);
name_by_name_v6(gi, name)
GeoIP *gi
char * name
PREINIT:
char * n;
PPCODE:
ST(0) = sv_newmortal();
n = GeoIP_name_by_name_v6(gi,name);
if ( n != NULL ) {
ST(0) = newSVpv(n, strlen(n));
free(n);
org_by_addr(gi, addr)
GeoIP *gi
char * addr
PREINIT:
char * n;
PPCODE:
ST(0) = sv_newmortal();
n = GeoIP_org_by_addr(gi,addr);
if ( n != NULL ) {
ST(0) = newSVpv(n, strlen(n));
free(n);
org_by_name(gi, name)
GeoIP *gi
char * name
PREINIT:
char * n;
PPCODE:
ST(0) = sv_newmortal();
n = GeoIP_org_by_name(gi,name);
if ( n != NULL ) {
ST(0) = newSVpv(n, strlen(n));
free(n);
range_by_ip(gi, addr)
GeoIP *gi
const char * addr
PREINIT:
char ** r;
PPCODE:
r = GeoIP_range_by_ip(gi,addr);
if (r != NULL){
EXTEND(SP,2);
PUSHs( sv_2mortal( newSVpv(r[0], 0) ) );
PUSHs( sv_2mortal( newSVpv(r[1], 0) ) );
region_by_addr(gi, addr)
GeoIP *gi
char * addr
PREINIT:
GeoIPRegion * gir;
PPCODE:
gir = GeoIP_region_by_addr(gi,addr);
if (gir){
EXTEND(SP,2);
( gir->country_code[0] == '\0' && gir->country_code[1] == '\0' )
region_by_name(gi, name)
GeoIP *gi
char * name
PREINIT:
GeoIPRegion * gir;
PPCODE:
gir = GeoIP_region_by_name(gi,name);
if (gir){
EXTEND(SP,2);
( gir->country_code[0] == '\0' && gir->country_code[1] == '\0' )
void
city(gir)
GeoIPRecord *gir
PREINIT:
SV * n;
PPCODE:
n = newSVpv( gir->city ? gir->city : "", 0);
#if defined(sv_utf8_decode)
if ( gir->charset == GEOIP_CHARSET_UTF8 )
SvUTF8_on(n);
#endif
view all matches for this distribution
view release on metacpan or search on metacpan
float p_lon
float polar_circumference
float search_radius
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
ComputeAreaExtrema_float(tile_adjust, max_size, max_level, p_lat, p_lat_rad, p_lon, polar_circumference, search_radius);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
double p_lon
double polar_circumference
double search_radius
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
ComputeAreaExtrema_double(tile_adjust, max_size, max_level, p_lat, p_lat_rad, p_lon, polar_circumference, search_radius);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
float new_diameter
float new_lat_1
float new_lon_1
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
SetUpDistance_float(new_diameter, new_lat_1, new_lon_1);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
double new_diameter
double new_lat_1
double new_lon_1
PREINIT:
I32* temp;
PPCODE:
temp = PL_markstack_ptr++;
SetUpDistance_double(new_diameter, new_lat_1, new_lon_1);
if (PL_markstack_ptr != temp) {
/* truly void, because dXSARGS not invoked */
PL_markstack_ptr = temp;
view all matches for this distribution
view release on metacpan or search on metacpan
TimeZoneFinder.xs view on Meta::CPAN
shp_point_t location;
AV *time_zones;
SSize_t tz_count, tz_num;
SV **svp;
U8 gimme = GIMME_V;
PPCODE:
if ((items - 1) % 2 != 0) {
warn("Odd-length list passed to %s method",
(ix == 1) ? "time_zone_at" : "time_zones_at");
}
view all matches for this distribution
view release on metacpan or search on metacpan
PREINIT:
double lat = 0.0f;
double lon = 0.0f;
PPCODE:
if (median_center(opts, &lat, &lon))
XSRETURN_EMPTY;
mXPUSHs(newSVnv( lat ));
mXPUSHs(newSVnv( lon ));
view all matches for this distribution
view release on metacpan or search on metacpan
void
new_proj4(defn)
char * defn
INIT:
projPJ rawstruct;
PPCODE:
rawstruct = pj_init_plus(defn);
if(rawstruct==NULL)
{ EXTEND(SP, 3);
PUSHs(&PL_sv_undef);
double lat
double lon
PROTOTYPE: $$$
PREINIT:
projUV in, out;
PPCODE:
in.u = lon * DEG_TO_RAD;
in.v = lat * DEG_TO_RAD;
out = pj_fwd(in, proj);
if(out.u == HUGE_VAL && out.v == HUGE_VAL)
XSRETURN_UNDEF;
double lon
PROTOTYPE: $$$
PREINIT:
projUV in, out;
projPJ toProj;
PPCODE:
in.u = lon;
in.v = lat;
out = pj_fwd(in, proj);
if (out.u == HUGE_VAL && out.v == HUGE_VAL)
XSRETURN_UNDEF;
double x
double y
PROTOTYPE: $$$
PREINIT:
projUV in, out;
PPCODE:
if(pj_is_latlong(proj))
{ in.u = x * DEG_TO_RAD;
in.v = y * DEG_TO_RAD;
}
else
double x
double y
PROTOTYPE: $$$
PREINIT:
projUV in, out;
PPCODE:
in.u = x;
in.v = y;
out = pj_inv(in, proj);
if (out.u == HUGE_VAL && out.v == HUGE_VAL)
)
{ XSRETURN_UNDEF;
}
nrpoints += 1; /* XS returns last index, not size */
PPCODE:
New(0, x, nrpoints, double);
New(0, y, nrpoints, double);
New(0, z, nrpoints, double);
/* fprintf(stderr, "%d points\n", nrpoints); */
SV *
def_types_proj4(void)
PREINIT:
struct PJ_LIST *type;
PPCODE:
#if PJ_VERSION >= 449
for(type = pj_get_list_ref(); type->id; type++)
{ /* same as "proj -l" does */
if( strcmp(type->id,"latlong")==0
|| strcmp(type->id,"longlat")==0
SV *
type_proj4(id)
char * id
PREINIT:
struct PJ_LIST *type;
PPCODE:
#if PJ_VERSION >= 449
for(type = pj_get_list_ref(); type->id; type++)
{ if(strcmp(id, type->id)!=0)
continue;
SV *
def_ellps_proj4(void)
PREINIT:
struct PJ_ELLPS *ellps;
PPCODE:
#if PJ_VERSION >= 449
for(ellps = pj_get_ellps_ref(); ellps->id; ellps++)
{ XPUSHs(sv_2mortal(newSVpv(ellps->id, 0)));
}
#endif
SV *
ellps_proj4(id)
char * id
PREINIT:
struct PJ_ELLPS *ellps;
PPCODE:
#if PJ_VERSION >= 449
for(ellps = pj_get_ellps_ref(); ellps->id; ellps++)
{ if(strcmp(id, ellps->id)!=0)
continue;
SV *
def_units_proj4(void)
PREINIT:
struct PJ_UNITS *unit;
PPCODE:
#if PJ_VERSION >= 449
for(unit = pj_get_units_ref(); unit->id; unit++)
{ XPUSHs(sv_2mortal(newSVpv(unit->id, 0)));
}
#endif
SV *
unit_proj4(id)
char * id
PREINIT:
struct PJ_UNITS *units;
PPCODE:
#if PJ_VERSION >= 449
for(units = pj_get_units_ref(); units->id; units++)
{ if(strcmp(id, units->id)!=0)
continue;
SV *
def_datums_proj4(void)
PREINIT:
struct PJ_DATUMS *datum;
PPCODE:
#if PJ_VERSION >= 449
for(datum = pj_get_datums_ref(); datum->id; datum++)
{ XPUSHs(sv_2mortal(newSVpv(datum->id, 0)));
}
#endif
SV *
datum_proj4(id)
char * id
PREINIT:
struct PJ_DATUMS *datum;
PPCODE:
#if PJ_VERSION >= 449
for(datum = pj_get_datums_ref(); datum->id; datum++)
{ if(strcmp(id, datum->id)!=0)
continue;
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
libpostal.xs view on Meta::CPAN
MODULE = Geo::libpostal PACKAGE = Geo::libpostal PREFIX = lp_
PROTOTYPES: ENABLED
void
lp__teardown()
PPCODE:
if (LP_SETUP) {
libpostal_teardown();
LP_SETUP = 0;
}
if (LP_SETUP_LANGCLASS) {
libpostal.xs view on Meta::CPAN
char *src, *option_name;
size_t src_len, option_len, i, j, num_expansions, num_langs, exp_len, lang_len, components;
AV *languages_av;
SV **lang;
char **languages = NULL;
PPCODE:
/* lazy load libpostal */
if (!LP_SETUP) {
if (!libpostal_setup()) {
croak("libpostal_setup() failed");
}
libpostal.xs view on Meta::CPAN
lp_parse_address(address, ...)
SV *address
PREINIT:
char *src, *option_name;
size_t src_len, option_len, i, label_len, component_len;
PPCODE:
/* lazy load libpostal */
if (!LP_SETUP) {
if (!libpostal_setup()) {
croak("libpostal_setup() failed");
}
view all matches for this distribution
view release on metacpan or search on metacpan
gfsmStateId qid;
guint lo_i;
guint hi_i;
gfsmWeight w_last;
guint nitems = 1;
PPCODE:
{
qid = gfsm_trie_find_prefix(trie, lo,hi, &lo_i,&hi_i,&w_last, NULL);
//
//
//-- return stack
AV *qpath_av;
guint lo_i;
guint hi_i;
gfsmWeight w_last;
guint nitems = 1;
PPCODE:
{
qpath = g_ptr_array_sized_new(lo->len + hi->len);
gfsm_trie_find_prefix(trie, lo,hi, &lo_i,&hi_i,&w_last, qpath);
//
//
view all matches for this distribution