Astro-SkyCat
view release on metacpan or search on metacpan
AstroCatalog::numCols()
# This is the same as AstroQuery::colNames
void
AstroCatalog::colNames()
PREINIT:
int i;
int len;
char ** names;
PPCODE:
names = THIS->colNames();
for (i = 0; i < THIS->numCols(); i++) {
len = strlen( *names );
XPUSHs(sv_2mortal(newSVpv( *names++, len)));
}
const char *
AstroCatalog::colName( col )
AstroQuery::new()
# Can be used to set or return
# A pain since we cant use typemaps
# ID is tricky since when it is used as an accessor
# it returns a char and when it is used to set the ID
# it returns an int
# Can either break the interface and have setid, getid
# or we have to use PPCODE to handle with the return value
# Essentially means we are doing everything by hand
void
AstroQuery::id( ... )
PREINIT:
int retint;
const char * retchar;
const char * inchar;
PPCODE:
if (items == 2) {
/* Setting the attribute */
inchar = (const char *)SvPV(ST(1),PL_na);
retint = THIS->id( inchar );
PUSHs(sv_2mortal( newSViv( retint )));
} else {
/* returning the attribute */
retchar = THIS->id();
PUSHs(sv_2mortal( newSVpv(retchar, strlen(retchar))));
# a typemap
void
AstroQuery::pos( ... )
PREINIT:
int retint;
WorldOrImageCoords retwc;
const WorldOrImageCoords * inwc;
const WorldOrImageCoords * inwc2;
SV * retsv;
PPCODE:
if (items >= 2) {
/* Setting the attribute - unfortunately it has to be an object */
inwc = SvToWorldOrImageCoords( ST(1) );
if (items == 2) {
/* We might need to inc ref count here in case we free the WCS
object before this command completes. Problem is how to dec
the ref count when this object disappears */
retint = THIS->pos( *inwc );
const char * name
# Push each column name onto the stack
void
QueryResult::colNames()
PREINIT:
int i;
int len;
char ** names;
PPCODE:
names = THIS->colNames();
for (i = 0; i < THIS->numCols(); i++) {
len = strlen( *names );
XPUSHs(sv_2mortal(newSVpv( *names++, len)));
}
void
QueryResult::DESTROY()
( run in 0.675 second using v1.01-cache-2.11-cpan-71847e10f99 )