Astro-WCS-LibWCS

 view release on metacpan or  search on metacpan

LibWCS.xs  view on Meta::CPAN

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "fitsfile.h"
#include "wcs.h"
#include "wcscat.h"
#include "util.h"

typedef struct WorldCoor WCS;
typedef struct StarCat   StarCat;
typedef struct Star   Star;
typedef struct TabTable   TabTable;
typedef struct Range Range;
typedef struct Keyword Keyword;
typedef struct Tokens Tokens;

/* declarations which are not in libwcs headers */
#include "wcsdecl.h"

static int
not_here(char *s)
{
    croak("%s not implemented on this architecture", s);
    return -1;
}

static double
constant(char *name, int arg)
{
    errno = 0;
    switch (*name) {
    case 'A':
	break;
    case 'B':
	break;
    case 'C':
	break;
    case 'D':
	break;
    case 'E':
	break;
    case 'F':
	break;
    case 'G':
	break;
    case 'H':
	break;
    case 'I':
	break;
    case 'J':
	break;
    case 'K':
	break;
    case 'L':
	break;
    case 'M':
	break;
    case 'N':
	break;
    case 'O':
	break;
    case 'P':
	if (strEQ(name, "PI"))
#ifdef PI
	    return PI;
#else
	    goto not_there;
#endif
	break;
    case 'Q':
	break;
    case 'R':
	break;
    case 'S':
	break;
    case 'T':
	if (strEQ(name, "TNX_CHEBYSHEV"))
#ifdef TNX_CHEBYSHEV
	    return TNX_CHEBYSHEV;
#else
	    goto not_there;
#endif
	if (strEQ(name, "TNX_LEGENDRE"))
#ifdef TNX_LEGENDRE
	    return TNX_LEGENDRE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "TNX_POLYNOMIAL"))
#ifdef TNX_POLYNOMIAL
	    return TNX_POLYNOMIAL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "TNX_XFULL"))
#ifdef TNX_XFULL
	    return TNX_XFULL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "TNX_XHALF"))
#ifdef TNX_XHALF
	    return TNX_XHALF;
#else
	    goto not_there;
#endif
	if (strEQ(name, "TNX_XNONE"))
#ifdef TNX_XNONE
	    return TNX_XNONE;
#else
	    goto not_there;
#endif
	break;
    case 'U':
	break;
    case 'V':
	break;
    case 'W':
	if (strEQ(name, "WCS_AIR"))
#ifdef WCS_AIR
	    return WCS_AIR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_AIT"))
#ifdef WCS_AIT
	    return WCS_AIT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_ALTAZ"))
#ifdef WCS_ALTAZ
	    return WCS_ALTAZ;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_ARC"))
#ifdef WCS_ARC
	    return WCS_ARC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_AZP"))
#ifdef WCS_AZP
	    return WCS_AZP;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_B1950"))
#ifdef WCS_B1950
	    return WCS_B1950;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_BON"))
#ifdef WCS_BON
	    return WCS_BON;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_CAR"))
#ifdef WCS_CAR
	    return WCS_CAR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_CEA"))
#ifdef WCS_CEA
	    return WCS_CEA;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_COD"))
#ifdef WCS_COD
	    return WCS_COD;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_COE"))
#ifdef WCS_COE
	    return WCS_COE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_COO"))
#ifdef WCS_COO
	    return WCS_COO;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_CPS"))
#ifdef WCS_CPS
	    return WCS_CPS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_CSC"))
#ifdef WCS_CSC
	    return WCS_CSC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_CYP"))
#ifdef WCS_CYP
	    return WCS_CYP;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_DSS"))
#ifdef WCS_DSS
	    return WCS_DSS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_ECLIPTIC"))
#ifdef WCS_ECLIPTIC
	    return WCS_ECLIPTIC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_GALACTIC"))
#ifdef WCS_GALACTIC
	    return WCS_GALACTIC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_GLS"))
#ifdef WCS_GLS
	    return WCS_GLS;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_J2000"))
#ifdef WCS_J2000
	    return WCS_J2000;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_LIN"))
#ifdef WCS_LIN
	    return WCS_LIN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_LINEAR"))
#ifdef WCS_LINEAR
	    return WCS_LINEAR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_MER"))
#ifdef WCS_MER
	    return WCS_MER;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_MOL"))
#ifdef WCS_MOL
	    return WCS_MOL;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_NCP"))
#ifdef WCS_NCP
	    return WCS_NCP;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_NPOLE"))
#ifdef WCS_NPOLE
	    return WCS_NPOLE;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_PAR"))
#ifdef WCS_PAR
	    return WCS_PAR;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_PCO"))
#ifdef WCS_PCO
	    return WCS_PCO;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_PIX"))
#ifdef WCS_PIX
	    return WCS_PIX;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_PLANET"))
#ifdef WCS_PLANET
	    return WCS_PLANET;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_PLT"))
#ifdef WCS_PLT
	    return WCS_PLT;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_QSC"))
#ifdef WCS_QSC
	    return WCS_QSC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_SIN"))
#ifdef WCS_SIN
	    return WCS_SIN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_SPA"))
#ifdef WCS_SPA
	    return WCS_SPA;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_STG"))
#ifdef WCS_STG
	    return WCS_STG;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_TAN"))
#ifdef WCS_TAN
	    return WCS_TAN;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_TNX"))
#ifdef WCS_TNX
	    return WCS_TNX;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_TSC"))
#ifdef WCS_TSC
	    return WCS_TSC;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_ZEA"))
#ifdef WCS_ZEA
	    return WCS_ZEA;
#else
	    goto not_there;
#endif
	if (strEQ(name, "WCS_ZPN"))
#ifdef WCS_ZPN
	    return WCS_ZPN;
#else
	    goto not_there;
#endif
	break;
    case 'X':
	break;
    case 'Y':
	break;
    case 'Z':
	break;
    }
    errno = EINVAL;
    return 0;

not_there:
    errno = ENOENT;
    return 0;
}


MODULE = Astro::WCS::LibWCS		PACKAGE = Astro::WCS::LibWCS
PROTOTYPES: DISABLE

double
constant(name,arg)
	char *		name
	int		arg

##
##
## wcsinit.c
##
##

WCS *
wcsninit(hstring,len)
	char * hstring
	int len

WCS *
wcsinit(hstring)
	char * hstring

WCS *
wcsninitn(hstring, len, wcsname)
	char * hstring
	int len
	char * wcsname

WCS *
wcsinitn(hstring, wcsname)
	char * hstring
	char * wcsname

WCS *
wcsninitc(hstring, len, wcschar)
	char * hstring
	int len
	char &wcschar

WCS *
wcsinitc(hstring, wcschar)
	char * hstring
	char &wcschar

##
##
## wcs.c
##
##

void
wcsfree(wcs)
	WCS * wcs
	ALIAS:



( run in 2.084 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )