/* FTGKYS supported the long string convention but FFGKYS does not, so redirect to FFGKLS. To handle the pointer to a pointer, manually expand the FCALLSC macro and modify function call. */ CFextern VOID_cfF(FTGKYS,ftgkys) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)); CFextern VOID_cfF(FTGKYS,ftgkys) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),FITSUNIT,STRING,PSTRING,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)) { QCF(FITSUNIT,1) QCF(STRING,2) QCF(PSTRING,3) /* Defines a character pointer */ QCF(PSTRING,4) QCF(PINT,5) ffgkls( TCF(ftgkys,FITSUNIT,1,0) TCF(ftgkys,STRING,2,1) , &B3 /* Pass address of pointer */ TCF(ftgkys,PSTRING,4,1) TCF(ftgkys,PINT,5,1) ); RCF(FITSUNIT,1) RCF(STRING,2) RCF(PSTRING,3) /* Copies as much of pointer as will fit */ RCF(PSTRING,4) /* into fortran string and frees space */ RCF(PINT,5) } /* This is the *real* wrapper to FFGKLS, although it is exactly the same as the one for FFGKYS. To handle the pointer to a pointer, manually expand the FCALLSC macro and modify function call. */
/*------------------- Conversion Utilities -----------------*/ /* (prototyped in fitsio2.h) */ /*----------------------------------------------------------*/ CFextern VOID_cfF(FTI2C,fti2c) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)); CFextern VOID_cfF(FTI2C,fti2c) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LONG,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)) { QCF(LONG,1) QCF(PSTRING,2) QCF(PINT,3) char str[21]; ffi2c( TCF(fti2c,LONG,1,0) TCF(fti2c,PSTRING,2,1) TCF(fti2c,PINT,3,1) ); sprintf(str,"%20s",B2); strcpy(B2,str); RCF(LONG,1) RCF(PSTRING,2) RCF(PINT,3) } CFextern VOID_cfF(FTL2C,ftl2c) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)); CFextern VOID_cfF(FTL2C,ftl2c) CFARGT14(NCF,DCF,ABSOFT_cf2(VOID),LOGICAL,PSTRING,PINT,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0))
QCF(LONG,3) QCF(LONG,4) QCF(LONG,5) QCF(STRING,6) QCF(PSTRINGV,7) QCF(PLOGICAL,8) QCF(PINT,9) fitsfile *fptr; int colnum, *anynul, *status, velem, type; long firstrow, firstelem, nelem; long repeat; unsigned long gMinStrLen=80L; /* gMin = width */ char *nulval, **array; fptr = TCF(ftgcvs,FITSUNIT,1,0); colnum = TCF(ftgcvs,INT,2,0); firstrow = TCF(ftgcvs,LONG,3,0); firstelem = TCF(ftgcvs,LONG,4,0); nelem = TCF(ftgcvs,LONG,5,0); nulval = TCF(ftgcvs,STRING,6,0); /* put off variable 7 (array) until column type is learned */ anynul = TCF(ftgcvs,PLOGICAL,8,0); status = TCF(ftgcvs,PINT,9,0); ffgtcl( fptr, colnum, &type, &repeat, (long *)&gMinStrLen, status ); if( type<0 ) velem = 1; /* Variable length column */ else velem = nelem; array = TCF(ftgcvs,PSTRINGV,7,0);