#include #include #include #include #include "export.h" #include "idl2f77.h" /* Check which system we are one */ #if defined(WIN32) //#include #endif extern float ANiceNum( float *x, int *up); /*+ * NAME: * F77_ANiceNum * CALLING SEQUENCE: * value = F77_ANiceNum(x, i) * MODIFICATION HISTORY: * FEB-2002, Paul Hick (UCSD/CASS; pphick@ucsd.edu) -*/ IDL_VPTR IDL_CDECL F77_ANiceNum(int argc, IDL_VPTR argv[], char *argk) { float f; int i; IDL_VPTR ret = IDL_Gettmp(); IDL_ENSURE_SCALAR(argv[0]); IDL_ENSURE_SCALAR(argv[1]) f = argv[0]->value.f; i = argv[1]->value.i; ret->type = IDL_TYP_FLOAT; ret->value.f = ANiceNum(&f, &i); return ret; } void IDL_CDECL F77_sub(int argc, IDL_VPTR argv[], char *argk) { float f; int i; IDL_ENSURE_SCALAR(argv[0]); IDL_ENSURE_SCALAR(argv[1]) f = argv[0]->value.f; i = argv[1]->value.i; return; } /* Define the functions */ static IDL_SYSFUN_DEF2 F77_functions[] = { {F77_ANiceNum,"F77_ANICENUM", 2, 2, 0, 0}, }; /* Define the subroutines */ static IDL_SYSFUN_DEF2 F77_subroutines[] = { {(IDL_FUN_RET) F77_sub, "F77_SUB", 2, 2, 0, 0}, }; /* called when IDL is shutdown */ void F77_exit(void) { /*nothing special to do in this case*/ } /* startup call when DLM is loaded */ int F77_start(void) { if (!IDL_SysRtnAdd(F77_functions , TRUE , ARRLEN(F77_functions ))) { return IDL_FALSE; } if (!IDL_SysRtnAdd(F77_subroutines, FALSE, ARRLEN(F77_subroutines))) { return IDL_FALSE; } IDL_ExitRegister(F77_exit); /*Register the exit handler*/ return(IDL_TRUE); }