"Fossies" - the Fresh Open Source Software Archive

Member "cfitsio-4.0.0/fitsio2.h" (20 May 2021, 63131 Bytes) of package /linux/misc/cfitsio-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "fitsio2.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 3440_vs_3450.

    1 #ifndef _FITSIO2_H
    2 #define _FITSIO2_H
    3  
    4 #include "fitsio.h"
    5 
    6 /* 
    7     Threading support using POSIX threads programming interface
    8     (supplied by Bruce O'Neel) 
    9 
   10     All threaded programs MUST have the 
   11 
   12     -D_REENTRANT
   13 
   14     on the compile line and must link with -lpthread.  This means that
   15     when one builds cfitsio for threads you must have -D_REENTRANT on the
   16     gcc or cc command line.
   17 */
   18 
   19 #ifdef _REENTRANT
   20 #include <pthread.h>
   21 /*  #include <assert.h>  not needed any more */
   22 extern pthread_mutex_t Fitsio_Lock;
   23 extern int Fitsio_Pthread_Status;
   24 
   25 #define FFLOCK1(lockname)   (Fitsio_Pthread_Status = pthread_mutex_lock(&lockname))
   26 #define FFUNLOCK1(lockname) (Fitsio_Pthread_Status = pthread_mutex_unlock(&lockname))
   27 #define FFLOCK   FFLOCK1(Fitsio_Lock)
   28 #define FFUNLOCK FFUNLOCK1(Fitsio_Lock)
   29 #define ffstrtok(str, tok, save) strtok_r(str, tok, save)
   30 
   31 #else
   32 #define FFLOCK
   33 #define FFUNLOCK
   34 #define ffstrtok(str, tok, save) strtok(str, tok)
   35 #endif
   36 
   37 /*
   38   If REPLACE_LINKS is defined, then whenever CFITSIO fails to open
   39   a file with write access because it is a soft link to a file that
   40   only has read access, then CFITSIO will attempt to replace
   41   the link with a local copy of the file, with write access.  This
   42   feature was originally added to support the ftools in the Hera
   43   environment, where many of the user's data file are soft links.
   44 */
   45 #if defined(BUILD_HERA)
   46 #define REPLACE_LINKS 1
   47 #endif
   48 
   49 #define USE_LARGE_VALUE -99  /* flag used when writing images */
   50 
   51 #define DBUFFSIZE 28800 /* size of data buffer in bytes */
   52 
   53 #define NMAXFILES  10000   /* maximum number of FITS files that can be opened */
   54         /* CFITSIO will allocate (NMAXFILES * 80) bytes of memory */
   55     /* plus each file that is opened will use NIOBUF * 2880 bytes of memeory */
   56     /* where NIOBUF is defined in fitio.h and has a default value of 40 */
   57 
   58 #define MINDIRECT 8640   /* minimum size for direct reads and writes */
   59                          /* MINDIRECT must have a value >= 8640 */
   60 
   61 /*   it is useful to identify certain specific types of machines   */
   62 #define NATIVE             0 /* machine that uses non-byteswapped IEEE formats */
   63 #define OTHERTYPE          1  /* any other type of machine */
   64 #define VAXVMS             3  /* uses an odd floating point format */
   65 #define ALPHAVMS           4  /* uses an odd floating point format */
   66 #define IBMPC              5  /* used in drvrfile.c to work around a bug on PCs */
   67 #define CRAY               6  /* requires a special NaN test algorithm */
   68 
   69 #define GFLOAT             1  /* used for VMS */
   70 #define IEEEFLOAT          2  /* used for VMS */
   71 
   72 /* ======================================================================= */
   73 /* The following logic is used to determine the type machine,              */
   74 /*  whether the bytes are swapped, and the number of bits in a long value  */
   75 /* ======================================================================= */
   76 
   77 /*   The following platforms have sizeof(long) == 8               */
   78 /*   This block of code should match a similar block in fitsio.h  */
   79 /*   and the block of code at the beginning of f77_wrap.h         */
   80 
   81 #if defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )
   82                                   /* old Dec Alpha platforms running OSF */
   83 #define BYTESWAPPED TRUE
   84 #define LONGSIZE 64
   85 
   86 #elif defined(__sparcv9) || (defined(__sparc__) && defined(__arch64__))
   87                                /*  SUN Solaris7 in 64-bit mode */
   88 #define BYTESWAPPED FALSE
   89 #define MACHINE NATIVE
   90 #define LONGSIZE 64   
   91 
   92                             /* IBM System z mainframe support */ 
   93 #elif defined(__s390x__)
   94 #define BYTESWAPPED FALSE
   95 #define LONGSIZE 64
   96 
   97 #elif defined(__s390__)
   98 #define BYTESWAPPED FALSE
   99 #define LONGSIZE 32
  100 
  101 #elif defined(__ia64__)  || defined(__x86_64__) || defined(__AARCH64EL__)
  102                   /*  Intel itanium 64-bit PC, or AMD opteron 64-bit PC */
  103 #define BYTESWAPPED TRUE
  104 #define LONGSIZE 64   
  105 
  106 #elif defined(_SX)             /* Nec SuperUx */
  107 
  108 #define BYTESWAPPED FALSE
  109 #define MACHINE NATIVE
  110 #define LONGSIZE 64
  111 
  112 #elif defined(__powerpc64__) || defined(__64BIT__) || defined(__AARCH64EB__)  /* IBM 64-bit AIX powerpc*/
  113                               /* could also test for __ppc64__ or __PPC64 */
  114 
  115 #  if defined(__LITTLE_ENDIAN__)
  116 #   define BYTESWAPPED TRUE
  117 #  else
  118 #   define BYTESWAPPED FALSE
  119 #   define MACHINE NATIVE
  120 #  endif
  121 #  define LONGSIZE 64
  122 
  123 #elif defined(_MIPS_SZLONG)
  124 
  125 #  if defined(MIPSEL)
  126 #    define BYTESWAPPED TRUE
  127 #  else
  128 #    define BYTESWAPPED FALSE
  129 #    define MACHINE NATIVE
  130 #  endif
  131 
  132 #  if _MIPS_SZLONG == 32
  133 #    define LONGSIZE 32
  134 #  elif _MIPS_SZLONG == 64
  135 #    define LONGSIZE 64
  136 #  else
  137 #    error "can't handle long size given by _MIPS_SZLONG"
  138 #  endif
  139 
  140 #elif defined(__riscv)
  141 
  142 /* RISC-V is always little endian */
  143 
  144 #define BYTESWAPPED TRUE
  145 
  146 #  if __riscv_xlen == 32
  147 #    define LONGSIZE 32
  148 #  elif __riscv_xlen == 64
  149 #    define LONGSIZE 64
  150 #  else
  151 #    error "can't handle long size given by __riscv_xlen"
  152 #  endif
  153 
  154 /* ============================================================== */
  155 /*  the following are all 32-bit byteswapped platforms            */
  156 
  157 #elif defined(vax) && defined(VMS)
  158  
  159 #define MACHINE VAXVMS
  160 #define BYTESWAPPED TRUE
  161  
  162 #elif defined(__alpha) && defined(__VMS)
  163 
  164 #if (__D_FLOAT == TRUE)
  165 
  166 /* this float option is the same as for VAX/VMS machines. */
  167 #define MACHINE VAXVMS
  168 #define BYTESWAPPED TRUE
  169  
  170 #elif  (__G_FLOAT == TRUE)
  171  
  172 /*  G_FLOAT is the default for ALPHA VMS systems */
  173 #define MACHINE ALPHAVMS
  174 #define BYTESWAPPED TRUE
  175 #define FLOATTYPE GFLOAT
  176  
  177 #elif  (__IEEE_FLOAT == TRUE)
  178  
  179 #define MACHINE ALPHAVMS
  180 #define BYTESWAPPED TRUE
  181 #define FLOATTYPE IEEEFLOAT
  182 
  183 #endif  /* end of alpha VMS case */
  184 
  185 #elif defined(ultrix) && defined(unix)
  186  /* old Dec ultrix machines */
  187 #define BYTESWAPPED TRUE
  188  
  189 #elif defined(__i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) \
  190   || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__TURBOC__) \
  191   || defined(_NI_mswin_) || defined(__EMX__)
  192 
  193 /*  generic 32-bit IBM PC */
  194 #define MACHINE IBMPC
  195 #define BYTESWAPPED TRUE
  196 
  197 #elif defined(__arm__)
  198 
  199 /* This assumes all ARM are little endian.  In the future, it might be  */
  200 /* necessary to use  "if defined(__ARMEL__)"  to distinguish little from big. */
  201 /* (__ARMEL__ would be defined on little-endian, but not on big-endian). */
  202 
  203 #define BYTESWAPPED TRUE
  204  
  205 #elif defined(__tile__)
  206 
  207 /*  64-core 8x8-architecture Tile64 platform */
  208 
  209 #define BYTESWAPPED TRUE
  210 
  211 #elif defined(__sh__)
  212 
  213 /* SuperH CPU can be used in both little and big endian modes */
  214 
  215 #if defined(__LITTLE_ENDIAN__)
  216 #define BYTESWAPPED TRUE
  217 #else
  218 #define BYTESWAPPED FALSE
  219 #endif
  220 
  221 #else
  222 
  223 /*  assume all other machine uses the same IEEE formats as used in FITS files */
  224 /*  e.g., Macs fall into this category  */
  225 
  226 #define MACHINE NATIVE
  227 #define BYTESWAPPED FALSE
  228  
  229 #endif
  230 
  231 #ifndef MACHINE
  232 #define MACHINE  OTHERTYPE
  233 #endif
  234 
  235 /*  assume longs are 4 bytes long, unless previously set otherwise */
  236 #ifndef LONGSIZE
  237 #define LONGSIZE 32
  238 #endif
  239 
  240 /*       end of block that determine long size and byte swapping        */ 
  241 /* ==================================================================== */
  242  
  243 #define IGNORE_EOF 1
  244 #define REPORT_EOF 0
  245 #define DATA_UNDEFINED -1
  246 #define NULL_UNDEFINED 1234554321
  247 #define ASCII_NULL_UNDEFINED 1   /* indicate no defined null value */
  248  
  249 #define maxvalue(A,B) ((A) > (B) ? (A) : (B))
  250 #define minvalue(A,B) ((A) < (B) ? (A) : (B))
  251 
  252 /* faster string comparison macros */
  253 #define FSTRCMP(a,b)     ((a)[0]<(b)[0]? -1:(a)[0]>(b)[0]?1:strcmp((a),(b)))
  254 #define FSTRNCMP(a,b,n)  ((a)[0]<(b)[0]?-1:(a)[0]>(b)[0]?1:strncmp((a),(b),(n)))
  255 
  256 #if defined(__VMS) || defined(VMS)
  257  
  258 #define FNANMASK   0xFFFF /* mask all bits  */
  259 #define DNANMASK   0xFFFF /* mask all bits  */
  260  
  261 #else
  262  
  263 #define FNANMASK   0x7F80 /* mask bits 1 - 8; all set on NaNs */
  264                                      /* all 0 on underflow  or 0. */
  265  
  266 #define DNANMASK   0x7FF0 /* mask bits 1 - 11; all set on NaNs */
  267                                      /* all 0 on underflow  or 0. */
  268  
  269 #endif
  270  
  271 #if MACHINE == CRAY
  272     /*
  273       Cray machines:   the large negative integer corresponds
  274       to the 3 most sig digits set to 1.   If these
  275       3 bits are set in a floating point number (64 bits), then it represents
  276       a reserved value (i.e., a NaN)
  277     */
  278 #define fnan(L) ( (L) >= 0xE000000000000000 ? 1 : 0) )
  279  
  280 #else
  281     /* these functions work for both big and little endian machines */
  282     /* that use the IEEE floating point format for internal numbers */
  283  
  284    /* These functions tests whether the float value is a reserved IEEE     */
  285    /* value such as a Not-a-Number (NaN), or underflow, overflow, or       */
  286    /* infinity.   The functions returns 1 if the value is a NaN, overflow  */
  287    /* or infinity; it returns 2 if the value is an denormalized underflow  */
  288    /* value; otherwise it returns 0. fnan tests floats, dnan tests doubles */
  289  
  290 #define fnan(L) \
  291       ( (L & FNANMASK) == FNANMASK ?  1 : (L & FNANMASK) == 0 ? 2 : 0)
  292  
  293 #define dnan(L) \
  294       ( (L & DNANMASK) == DNANMASK ?  1 : (L & DNANMASK) == 0 ? 2 : 0)
  295  
  296 #endif
  297 
  298 #define DSCHAR_MAX  127.49 /* max double value that fits in an signed char */
  299 #define DSCHAR_MIN -128.49 /* min double value that fits in an signed char */
  300 #define DUCHAR_MAX  255.49 /* max double value that fits in an unsigned char */
  301 #define DUCHAR_MIN -0.49   /* min double value that fits in an unsigned char */
  302 #define DUSHRT_MAX  65535.49 /* max double value that fits in a unsigned short*/
  303 #define DUSHRT_MIN -0.49   /* min double value that fits in an unsigned short */
  304 #define DSHRT_MAX  32767.49 /* max double value that fits in a short */
  305 #define DSHRT_MIN -32768.49 /* min double value that fits in a short */
  306 
  307 #if LONGSIZE == 32
  308 #  define DLONG_MAX  2147483647.49 /* max double value that fits in a long */
  309 #  define DLONG_MIN -2147483648.49 /* min double value that fits in a long */
  310 #  define DULONG_MAX 4294967295.49 /* max double that fits in a unsigned long */
  311 #else
  312 #  define DLONG_MAX   9.2233720368547752E18 /* max double value  long */
  313 #  define DLONG_MIN  -9.2233720368547752E18 /* min double value  long */
  314 #  define DULONG_MAX 1.84467440737095504E19 /* max double value  ulong */
  315 #endif
  316 
  317 #define DULONG_MIN -0.49   /* min double value that fits in an unsigned long */
  318 #define DULONGLONG_MAX 18446744073709551615. /* max unsigned  longlong */
  319 #define DULONGLONG_MIN -0.49
  320 #define DLONGLONG_MAX  9.2233720368547755807E18 /* max double value  longlong */
  321 #define DLONGLONG_MIN -9.2233720368547755808E18 /* min double value  longlong */
  322 #define DUINT_MAX 4294967295.49 /* max dbl that fits in a unsigned 4-byte int */
  323 #define DUINT_MIN -0.49   /* min dbl that fits in an unsigned 4-byte int */
  324 #define DINT_MAX  2147483647.49 /* max double value that fits in a 4-byte int */
  325 #define DINT_MIN -2147483648.49 /* min double value that fits in a 4-byte int */
  326 
  327 #ifndef UINT64_MAX
  328 #define UINT64_MAX 18446744073709551615U /* max unsigned 64-bit integer */
  329 #endif
  330 #ifndef UINT32_MAX
  331 #define UINT32_MAX 4294967295U /* max unsigned 32-bit integer */
  332 #endif
  333 #ifndef INT32_MAX
  334 #define INT32_MAX  2147483647 /* max 32-bit integer */
  335 #endif
  336 #ifndef INT32_MIN
  337 #define INT32_MIN (-INT32_MAX -1) /* min 32-bit integer */
  338 #endif
  339 
  340 
  341 #define COMPRESS_NULL_VALUE -2147483647
  342 #define N_RANDOM 10000  /* DO NOT CHANGE THIS;  used when quantizing real numbers */
  343 
  344 int ffgnky(fitsfile *fptr, char *card, int *status);
  345 void ffcfmt(char *tform, char *cform);
  346 void ffcdsp(char *tform, char *cform);
  347 void ffswap2(short *values, long nvalues);
  348 void ffswap4(INT32BIT *values, long nvalues);
  349 void ffswap8(double *values, long nvalues);
  350 int ffi2c(LONGLONG ival, char *cval, int *status);
  351 int ffu2c(ULONGLONG ival, char *cval, int *status);
  352 int ffl2c(int lval, char *cval, int *status);
  353 int ffs2c(const char *instr, char *outstr, int *status);
  354 int ffr2f(float fval, int decim, char *cval, int *status);
  355 int ffr2e(float fval, int decim, char *cval, int *status);
  356 int ffd2f(double dval, int decim, char *cval, int *status);
  357 int ffd2e(double dval, int decim, char *cval, int *status);
  358 int ffc2ii(const char *cval, long *ival, int *status);
  359 int ffc2jj(const char *cval, LONGLONG *ival, int *status);
  360 int ffc2ujj(const char *cval, ULONGLONG *ival, int *status);
  361 int ffc2ll(const char *cval, int *lval, int *status);
  362 int ffc2rr(const char *cval, float *fval, int *status);
  363 int ffc2dd(const char *cval, double *dval, int *status);
  364 int ffc2x(const char *cval, char *dtype, long *ival, int *lval, char *sval,
  365           double *dval, int *status);
  366 int ffc2xx(const char *cval, char *dtype, LONGLONG *ival, int *lval, char *sval,
  367           double *dval, int *status);
  368 int ffc2uxx(const char *cval, char *dtype, ULONGLONG *ival, int *lval, char *sval,
  369           double *dval, int *status);
  370 int ffc2s(const char *instr, char *outstr, int *status);
  371 int ffc2i(const char *cval, long *ival, int *status);
  372 int ffc2j(const char *cval, LONGLONG *ival, int *status);
  373 int ffc2uj(const char *cval, ULONGLONG *ival, int *status);
  374 int ffc2r(const char *cval, float *fval, int *status);
  375 int ffc2d(const char *cval, double *dval, int *status);
  376 int ffc2l(const char *cval, int *lval, int *status);
  377 void ffxmsg(int action, char *err_message);
  378 int ffgcnt(fitsfile *fptr, char *value, char *comm, int *status);
  379 int ffgtkn(fitsfile *fptr, int numkey, char *keyname, long *value, int *status);
  380 int ffgtknjj(fitsfile *fptr, int numkey, char *keyname, LONGLONG *value, int *status);
  381 int fftkyn(fitsfile *fptr, int numkey, char *keyname, char *value, int *status);
  382 int ffgphd(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
  383         LONGLONG naxes[], long *pcount, long *gcount, int *extend, double *bscale,
  384           double *bzero, LONGLONG *blank, int *nspace, int *status);
  385 int ffgttb(fitsfile *fptr, LONGLONG *rowlen, LONGLONG *nrows, LONGLONG *pcount,
  386           long *tfield, int *status);
  387  
  388 int ffmkey(fitsfile *fptr, const char *card, int *status);
  389  
  390 /*  ffmbyt has been moved to fitsio.h */
  391 int ffgbyt(fitsfile *fptr, LONGLONG nbytes, void *buffer, int *status);
  392 int ffpbyt(fitsfile *fptr, LONGLONG nbytes, void *buffer, int *status);
  393 int ffgbytoff(fitsfile *fptr, long gsize, long ngroups, long offset, 
  394            void *buffer, int *status);
  395 int ffpbytoff(fitsfile *fptr, long gsize, long ngroups, long offset,
  396            void *buffer, int *status);
  397 int ffldrc(fitsfile *fptr, long record, int err_mode, int *status);
  398 int ffwhbf(fitsfile *fptr, int *nbuff);
  399 int ffbfeof(fitsfile *fptr, int *status);
  400 int ffbfwt(FITSfile *Fptr, int nbuff, int *status);
  401 int ffpxsz(int datatype);
  402 
  403 int ffourl(char *url, char *urltype, char *outfile, char *tmplfile,
  404             char *compspec, int *status);
  405 int ffparsecompspec(fitsfile *fptr, char *compspec, int *status);
  406 int ffoptplt(fitsfile *fptr, const char *tempname, int *status);
  407 int fits_is_this_a_copy(char *urltype);
  408 int fits_store_Fptr(FITSfile *Fptr, int *status);
  409 int fits_clear_Fptr(FITSfile *Fptr, int *status);
  410 int fits_already_open(fitsfile **fptr, char *url, 
  411     char *urltype, char *infile, char *extspec, char *rowfilter,
  412     char *binspec, char *colspec, int  mode, int noextsyn,
  413     int  *isopen, int  *status);
  414 int ffedit_columns(fitsfile **fptr, char *outfile, char *expr, int *status);
  415 int fits_get_col_minmax(fitsfile *fptr, int colnum, double *datamin, 
  416                      double *datamax, int *status);
  417 int ffwritehisto(long totaln, long offset, long firstn, long nvalues,
  418              int narrays, iteratorCol *imagepars, void *userPointer);
  419 int ffcalchist(long totalrows, long offset, long firstrow, long nrows,
  420              int ncols, iteratorCol *colpars, void *userPointer);
  421 int ffpinit(fitsfile *fptr, int *status);
  422 int ffainit(fitsfile *fptr, int *status);
  423 int ffbinit(fitsfile *fptr, int *status);
  424 int ffchdu(fitsfile *fptr, int *status);
  425 int ffwend(fitsfile *fptr, int *status);
  426 int ffpdfl(fitsfile *fptr, int *status);
  427 int ffuptf(fitsfile *fptr, int *status);
  428 
  429 int ffdblk(fitsfile *fptr, long nblocks, int *status);
  430 int ffgext(fitsfile *fptr, int moveto, int *exttype, int *status);
  431 int ffgtbc(fitsfile *fptr, LONGLONG *totalwidth, int *status);
  432 int ffgtbp(fitsfile *fptr, char *name, char *value, int *status);
  433 int ffiblk(fitsfile *fptr, long nblock, int headdata, int *status);
  434 int ffshft(fitsfile *fptr, LONGLONG firstbyte, LONGLONG nbytes, LONGLONG nshift,
  435     int *status);
  436  
  437  int ffgcprll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  438            LONGLONG nelem, int writemode, double *scale, double *zero, char *tform,
  439            long *twidth, int *tcode, int *maxelem, LONGLONG *startpos,
  440            LONGLONG *elemnum, long *incre, LONGLONG *repeat, LONGLONG *rowlen,
  441            int *hdutype, LONGLONG *tnull, char *snull, int *status);
  442        
  443 int ffflushx(FITSfile *fptr);
  444 int ffseek(FITSfile *fptr, LONGLONG position);
  445 int ffread(FITSfile *fptr, long nbytes, void *buffer,
  446             int *status);
  447 int ffwrite(FITSfile *fptr, long nbytes, void *buffer,
  448             int *status);
  449 int fftrun(fitsfile *fptr, LONGLONG filesize, int *status);
  450 
  451 int ffpcluc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  452            LONGLONG nelem, int *status);
  453        
  454 int ffgcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  455            LONGLONG nelem, int nultyp, char nulval, char *array, char *nularray,
  456            int *anynul, int *status);
  457 int ffgcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  458            LONGLONG nelem, int nultyp, char *nulval,
  459            char **array, char *nularray, int *anynul, int  *status);
  460 int ffgcls2(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  461            LONGLONG nelem, int nultyp, char *nulval,
  462            char **array, char *nularray, int *anynul, int  *status);
  463 int ffgclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  464            LONGLONG nelem, long  elemincre, int nultyp, unsigned char nulval,
  465            unsigned char *array, char *nularray, int *anynul, int  *status);
  466 int ffgclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  467            LONGLONG nelem, long  elemincre, int nultyp, signed char nulval,
  468            signed char *array, char *nularray, int *anynul, int  *status);
  469 int ffgclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  470            LONGLONG nelem, long  elemincre, int nultyp, unsigned short nulval,
  471            unsigned short *array, char *nularray, int *anynul, int  *status);
  472 int ffgcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  473            LONGLONG nelem, long  elemincre, int nultyp, short nulval,
  474            short *array, char *nularray, int *anynul, int  *status);
  475 int ffgcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  476            LONGLONG nelem, long elemincre, int nultyp, unsigned long nulval,
  477            unsigned long *array, char *nularray, int *anynul, int  *status);
  478 int ffgclujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  479            LONGLONG nelem, long elemincre, int nultyp, ULONGLONG nulval, 
  480            ULONGLONG *array, char *nularray, int *anynul, int  *status);
  481 int ffgcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  482            LONGLONG nelem, long elemincre, int nultyp, LONGLONG nulval, 
  483            LONGLONG *array, char *nularray, int *anynul, int  *status);
  484 int ffgclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  485            LONGLONG nelem, long elemincre, int nultyp, long nulval, long *array,
  486            char *nularray, int *anynul, int  *status);
  487 int ffgcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  488            LONGLONG nelem, long elemincre, int nultyp, unsigned int nulval,
  489            unsigned int *array, char *nularray, int *anynul, int  *status);
  490 int ffgclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  491            LONGLONG nelem, long elemincre, int nultyp, int nulval, int *array,
  492            char *nularray, int *anynul, int  *status);
  493 int ffgcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  494            LONGLONG nelem, long elemincre, int nultyp,  float nulval, float *array,
  495            char *nularray, int *anynul, int  *status);
  496 int ffgcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
  497            LONGLONG nelem, long elemincre, int nultyp, double nulval,
  498            double *array, char *nularray, int *anynul, int  *status);
  499  
  500 int ffpi1b(fitsfile *fptr, long nelem, long incre, unsigned char *buffer,
  501            int *status);
  502 int ffpi2b(fitsfile *fptr, long nelem, long incre, short *buffer, int *status);
  503 int ffpi4b(fitsfile *fptr, long nelem, long incre, INT32BIT *buffer,
  504            int *status);
  505 int ffpi8b(fitsfile *fptr, long nelem, long incre, long *buffer, int *status);
  506 int ffpr4b(fitsfile *fptr, long nelem, long incre, float *buffer, int *status);
  507 int ffpr8b(fitsfile *fptr, long nelem, long incre, double *buffer, int *status);
  508  
  509 int ffgi1b(fitsfile *fptr, LONGLONG pos, long nelem, long incre,
  510           unsigned char *buffer, int *status);
  511 int ffgi2b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, short *buffer,
  512           int *status);
  513 int ffgi4b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, INT32BIT *buffer,
  514           int *status);
  515 int ffgi8b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, long *buffer,
  516           int *status);
  517 int ffgr4b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, float *buffer,
  518           int *status);
  519 int ffgr8b(fitsfile *fptr, LONGLONG pos, long nelem, long incre, double *buffer,
  520           int *status);
  521  
  522 int ffcins(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, LONGLONG nbytes,
  523            LONGLONG bytepos, int *status);
  524 int ffcdel(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, LONGLONG nbytes,
  525            LONGLONG bytepos, int *status);
  526 int ffkshf(fitsfile *fptr, int firstcol, int tfields, int nshift, int *status);
  527 int fffvcl(fitsfile *fptr, int *nvarcols, int *colnums, int *status);
  528  
  529 int fffi1i1(unsigned char *input, long ntodo, double scale, double zero,
  530             int nullcheck, unsigned char tnull, unsigned char nullval, char
  531              *nullarray, int *anynull, unsigned char *output, int *status);
  532 int fffi2i1(short *input, long ntodo, double scale, double zero,
  533             int nullcheck, short tnull, unsigned char nullval, char *nullarray,
  534             int *anynull, unsigned char *output, int *status);
  535 int fffi4i1(INT32BIT *input, long ntodo, double scale, double zero,
  536             int nullcheck, INT32BIT tnull, unsigned char nullval, char *nullarray,
  537             int *anynull, unsigned char *output, int *status);
  538 int fffi8i1(LONGLONG *input, long ntodo, double scale, double zero,
  539             int nullcheck, LONGLONG tnull, unsigned char nullval, char *nullarray,
  540             int *anynull, unsigned char *output, int *status);
  541 int fffr4i1(float *input, long ntodo, double scale, double zero,
  542             int nullcheck, unsigned char nullval, char *nullarray,
  543             int *anynull, unsigned char *output, int *status);
  544 int fffr8i1(double *input, long ntodo, double scale, double zero,
  545             int nullcheck, unsigned char nullval, char *nullarray,
  546             int *anynull, unsigned char *output, int *status);
  547 int fffstri1(char *input, long ntodo, double scale, double zero,
  548             long twidth, double power, int nullcheck, char *snull,
  549             unsigned char nullval, char *nullarray, int *anynull,
  550             unsigned char *output, int *status);
  551  
  552 int fffi1s1(unsigned char *input, long ntodo, double scale, double zero,
  553             int nullcheck, unsigned char tnull, signed char nullval, char
  554              *nullarray, int *anynull, signed char *output, int *status);
  555 int fffi2s1(short *input, long ntodo, double scale, double zero,
  556             int nullcheck, short tnull, signed char nullval, char *nullarray,
  557             int *anynull, signed char *output, int *status);
  558 int fffi4s1(INT32BIT *input, long ntodo, double scale, double zero,
  559             int nullcheck, INT32BIT tnull, signed char nullval, char *nullarray,
  560             int *anynull, signed char *output, int *status);
  561 int fffi8s1(LONGLONG *input, long ntodo, double scale, double zero,
  562             int nullcheck, LONGLONG tnull, signed char nullval, char *nullarray,
  563             int *anynull, signed char *output, int *status);
  564 int fffr4s1(float *input, long ntodo, double scale, double zero,
  565             int nullcheck, signed char nullval, char *nullarray,
  566             int *anynull, signed char *output, int *status);
  567 int fffr8s1(double *input, long ntodo, double scale, double zero,
  568             int nullcheck, signed char nullval, char *nullarray,
  569             int *anynull, signed char *output, int *status);
  570 int fffstrs1(char *input, long ntodo, double scale, double zero,
  571             long twidth, double power, int nullcheck, char *snull,
  572             signed char nullval, char *nullarray, int *anynull,
  573             signed char *output, int *status);
  574 
  575 int fffi1u2(unsigned char *input, long ntodo, double scale, double zero,
  576             int nullcheck, unsigned char tnull, unsigned short nullval, 
  577             char *nullarray,
  578             int *anynull, unsigned short *output, int *status);
  579 int fffi2u2(short *input, long ntodo, double scale, double zero,
  580             int nullcheck, short tnull, unsigned short nullval, char *nullarray,
  581             int *anynull, unsigned short *output, int *status);
  582 int fffi4u2(INT32BIT *input, long ntodo, double scale, double zero,
  583             int nullcheck, INT32BIT tnull, unsigned short nullval, char *nullarray,
  584             int *anynull, unsigned short *output, int *status);
  585 int fffi8u2(LONGLONG *input, long ntodo, double scale, double zero,
  586             int nullcheck, LONGLONG tnull, unsigned short nullval, char *nullarray,
  587             int *anynull, unsigned short *output, int *status);
  588 int fffr4u2(float *input, long ntodo, double scale, double zero,
  589             int nullcheck, unsigned short nullval, char *nullarray,
  590             int *anynull, unsigned short *output, int *status);
  591 int fffr8u2(double *input, long ntodo, double scale, double zero,
  592             int nullcheck, unsigned short nullval, char *nullarray,
  593             int *anynull, unsigned short *output, int *status);
  594 int fffstru2(char *input, long ntodo, double scale, double zero,
  595             long twidth, double power, int nullcheck, char *snull,
  596             unsigned short nullval, char *nullarray, int  *anynull, 
  597             unsigned short *output, int *status);
  598 
  599 int fffi1i2(unsigned char *input, long ntodo, double scale, double zero,
  600             int nullcheck, unsigned char tnull, short nullval, char *nullarray,
  601             int *anynull, short *output, int *status);
  602 int fffi2i2(short *input, long ntodo, double scale, double zero,
  603             int nullcheck, short tnull, short nullval, char *nullarray,
  604             int *anynull, short *output, int *status);
  605 int fffi4i2(INT32BIT *input, long ntodo, double scale, double zero,
  606             int nullcheck, INT32BIT tnull, short nullval, char *nullarray,
  607             int *anynull, short *output, int *status);
  608 int fffi8i2(LONGLONG *input, long ntodo, double scale, double zero,
  609             int nullcheck, LONGLONG tnull, short nullval, char *nullarray,
  610             int *anynull, short *output, int *status);
  611 int fffr4i2(float *input, long ntodo, double scale, double zero,
  612             int nullcheck, short nullval, char *nullarray,
  613             int *anynull, short *output, int *status);
  614 int fffr8i2(double *input, long ntodo, double scale, double zero,
  615             int nullcheck, short nullval, char *nullarray,
  616             int *anynull, short *output, int *status);
  617 int fffstri2(char *input, long ntodo, double scale, double zero,
  618             long twidth, double power, int nullcheck, char *snull,
  619             short nullval, char *nullarray, int  *anynull, short *output,
  620             int *status);
  621 
  622 int fffi1u4(unsigned char *input, long ntodo, double scale, double zero,
  623             int nullcheck, unsigned char tnull, unsigned long nullval,
  624             char *nullarray,
  625             int *anynull, unsigned long *output, int *status);
  626 int fffi2u4(short *input, long ntodo, double scale, double zero,
  627             int nullcheck, short tnull, unsigned long nullval, char *nullarray,
  628             int *anynull, unsigned long *output, int *status);
  629 int fffi4u4(INT32BIT *input, long ntodo, double scale, double zero,
  630             int nullcheck, INT32BIT tnull, unsigned long nullval, char *nullarray,
  631             int *anynull, unsigned long *output, int *status);
  632 int fffi8u4(LONGLONG *input, long ntodo, double scale, double zero,
  633             int nullcheck, LONGLONG tnull, unsigned long nullval, char *nullarray,
  634             int *anynull, unsigned long *output, int *status);
  635 int fffr4u4(float *input, long ntodo, double scale, double zero,
  636             int nullcheck, unsigned long nullval, char *nullarray,
  637             int *anynull, unsigned long *output, int *status);
  638 int fffr8u4(double *input, long ntodo, double scale, double zero,
  639             int nullcheck, unsigned long nullval, char *nullarray,
  640             int *anynull, unsigned long *output, int *status);
  641 int fffstru4(char *input, long ntodo, double scale, double zero,
  642             long twidth, double power, int nullcheck, char *snull,
  643             unsigned long nullval, char *nullarray, int *anynull,
  644             unsigned long *output, int *status);
  645  
  646 int fffi1i4(unsigned char *input, long ntodo, double scale, double zero,
  647             int nullcheck, unsigned char tnull, long nullval, char *nullarray,
  648             int *anynull, long *output, int *status);
  649 int fffi2i4(short *input, long ntodo, double scale, double zero,
  650             int nullcheck, short tnull, long nullval, char *nullarray,
  651             int *anynull, long *output, int *status);
  652 int fffi4i4(INT32BIT *input, long ntodo, double scale, double zero,
  653             int nullcheck, INT32BIT tnull, long nullval, char *nullarray,
  654             int *anynull, long *output, int *status);
  655 int fffi8i4(LONGLONG *input, long ntodo, double scale, double zero,
  656             int nullcheck, LONGLONG tnull, long nullval, char *nullarray,
  657             int *anynull, long *output, int *status);
  658 int fffr4i4(float *input, long ntodo, double scale, double zero,
  659             int nullcheck, long nullval, char *nullarray,
  660             int *anynull, long *output, int *status);
  661 int fffr8i4(double *input, long ntodo, double scale, double zero,
  662             int nullcheck, long nullval, char *nullarray,
  663             int *anynull, long *output, int *status);
  664 int fffstri4(char *input, long ntodo, double scale, double zero,
  665             long twidth, double power, int nullcheck, char *snull,
  666             long nullval, char *nullarray, int *anynull, long *output,
  667             int *status);
  668  
  669 int fffi1int(unsigned char *input, long ntodo, double scale, double zero,
  670             int nullcheck, unsigned char tnull, int nullval, char *nullarray,
  671             int *anynull, int *output, int *status);
  672 int fffi2int(short *input, long ntodo, double scale, double zero,
  673             int nullcheck, short tnull, int nullval, char *nullarray,
  674             int *anynull, int *output, int *status);
  675 int fffi4int(INT32BIT *input, long ntodo, double scale, double zero,
  676             int nullcheck, INT32BIT tnull, int nullval, char *nullarray,
  677             int *anynull, int *output, int *status);
  678 int fffi8int(LONGLONG *input, long ntodo, double scale, double zero,
  679             int nullcheck, LONGLONG tnull, int nullval, char *nullarray,
  680             int *anynull, int *output, int *status);
  681 int fffr4int(float *input, long ntodo, double scale, double zero,
  682             int nullcheck, int nullval, char *nullarray,
  683             int *anynull, int *output, int *status);
  684 int fffr8int(double *input, long ntodo, double scale, double zero,
  685             int nullcheck, int nullval, char *nullarray,
  686             int *anynull, int *output, int *status);
  687 int fffstrint(char *input, long ntodo, double scale, double zero,
  688             long twidth, double power, int nullcheck, char *snull,
  689             int nullval, char *nullarray, int *anynull, int *output,
  690             int *status);
  691  
  692 int fffi1uint(unsigned char *input, long ntodo, double scale, double zero,
  693             int nullcheck, unsigned char tnull, unsigned int nullval,
  694             char *nullarray, int *anynull, unsigned int *output, int *status);
  695 int fffi2uint(short *input, long ntodo, double scale, double zero,
  696             int nullcheck, short tnull, unsigned int nullval, char *nullarray,
  697             int *anynull, unsigned int *output, int *status);
  698 int fffi4uint(INT32BIT *input, long ntodo, double scale, double zero,
  699             int nullcheck, INT32BIT tnull, unsigned int nullval, char *nullarray,
  700             int *anynull, unsigned int *output, int *status);
  701 int fffi8uint(LONGLONG *input, long ntodo, double scale, double zero,
  702             int nullcheck, LONGLONG tnull, unsigned int nullval, char *nullarray,
  703             int *anynull, unsigned int *output, int *status);
  704 int fffr4uint(float *input, long ntodo, double scale, double zero,
  705             int nullcheck, unsigned int nullval, char *nullarray,
  706             int *anynull, unsigned int *output, int *status);
  707 int fffr8uint(double *input, long ntodo, double scale, double zero,
  708             int nullcheck, unsigned int nullval, char *nullarray,
  709             int *anynull, unsigned int *output, int *status);
  710 int fffstruint(char *input, long ntodo, double scale, double zero,
  711             long twidth, double power, int nullcheck, char *snull,
  712             unsigned int nullval, char *nullarray, int *anynull,
  713             unsigned int *output, int *status);
  714  
  715 int fffi1i8(unsigned char *input, long ntodo, double scale, double zero,
  716             int nullcheck, unsigned char tnull, LONGLONG nullval, 
  717             char *nullarray, int *anynull, LONGLONG *output, int *status);
  718 int fffi2i8(short *input, long ntodo, double scale, double zero,
  719             int nullcheck, short tnull, LONGLONG nullval, char *nullarray,
  720             int *anynull, LONGLONG *output, int *status);
  721 int fffi4i8(INT32BIT *input, long ntodo, double scale, double zero,
  722             int nullcheck, INT32BIT tnull, LONGLONG nullval, char *nullarray,
  723             int *anynull, LONGLONG *output, int *status);
  724 int fffi8i8(LONGLONG *input, long ntodo, double scale, double zero,
  725             int nullcheck, LONGLONG tnull, LONGLONG nullval, char *nullarray,
  726             int *anynull, LONGLONG *output, int *status);
  727 int fffr4i8(float *input, long ntodo, double scale, double zero,
  728             int nullcheck, LONGLONG nullval, char *nullarray,
  729             int *anynull, LONGLONG *output, int *status);
  730 int fffr8i8(double *input, long ntodo, double scale, double zero,
  731             int nullcheck, LONGLONG nullval, char *nullarray,
  732             int *anynull, LONGLONG *output, int *status);
  733 int fffstri8(char *input, long ntodo, double scale, double zero,
  734             long twidth, double power, int nullcheck, char *snull,
  735             LONGLONG nullval, char *nullarray, int *anynull, LONGLONG *output,
  736             int *status);
  737 
  738 int fffi1u8(unsigned char *input, long ntodo, double scale, double zero,
  739             int nullcheck, unsigned char tnull, ULONGLONG nullval, 
  740             char *nullarray, int *anynull, ULONGLONG *output, int *status);
  741 int fffi2u8(short *input, long ntodo, double scale, double zero,
  742             int nullcheck, short tnull, ULONGLONG nullval, char *nullarray,
  743             int *anynull, ULONGLONG *output, int *status);
  744 int fffi4u8(INT32BIT *input, long ntodo, double scale, double zero,
  745             int nullcheck, INT32BIT tnull, ULONGLONG nullval, char *nullarray,
  746             int *anynull, ULONGLONG *output, int *status);
  747 int fffi8u8(LONGLONG *input, long ntodo, double scale, double zero,
  748             int nullcheck, LONGLONG tnull, ULONGLONG nullval, char *nullarray,
  749             int *anynull, ULONGLONG *output, int *status);
  750 int fffr4u8(float *input, long ntodo, double scale, double zero,
  751             int nullcheck, ULONGLONG nullval, char *nullarray,
  752             int *anynull, ULONGLONG *output, int *status);
  753 int fffr8u8(double *input, long ntodo, double scale, double zero,
  754             int nullcheck, ULONGLONG nullval, char *nullarray,
  755             int *anynull, ULONGLONG *output, int *status);
  756 int fffstru8(char *input, long ntodo, double scale, double zero,
  757             long twidth, double power, int nullcheck, char *snull,
  758             ULONGLONG nullval, char *nullarray, int *anynull, ULONGLONG *output,
  759             int *status);
  760 
  761 
  762 int fffi1r4(unsigned char *input, long ntodo, double scale, double zero,
  763             int nullcheck, unsigned char tnull, float nullval, char *nullarray,
  764             int *anynull, float *output, int *status);
  765 int fffi2r4(short *input, long ntodo, double scale, double zero,
  766             int nullcheck, short tnull, float nullval, char *nullarray,
  767             int *anynull, float *output, int *status);
  768 int fffi4r4(INT32BIT *input, long ntodo, double scale, double zero,
  769             int nullcheck, INT32BIT tnull, float nullval, char *nullarray,
  770             int *anynull, float *output, int *status);
  771 int fffi8r4(LONGLONG *input, long ntodo, double scale, double zero,
  772             int nullcheck, LONGLONG tnull, float nullval, char *nullarray,
  773             int *anynull, float *output, int *status);
  774 int fffr4r4(float *input, long ntodo, double scale, double zero,
  775             int nullcheck, float nullval, char *nullarray,
  776             int *anynull, float *output, int *status);
  777 int fffr8r4(double *input, long ntodo, double scale, double zero,
  778             int nullcheck, float nullval, char *nullarray,
  779             int *anynull, float *output, int *status);
  780 int fffstrr4(char *input, long ntodo, double scale, double zero,
  781             long twidth, double power, int nullcheck, char *snull,
  782             float nullval, char *nullarray, int *anynull, float *output,
  783             int *status);
  784  
  785 int fffi1r8(unsigned char *input, long ntodo, double scale, double zero,
  786             int nullcheck, unsigned char tnull, double nullval, char *nullarray,
  787             int *anynull, double *output, int *status);
  788 int fffi2r8(short *input, long ntodo, double scale, double zero,
  789             int nullcheck, short tnull, double nullval, char *nullarray,
  790             int *anynull, double *output, int *status);
  791 int fffi4r8(INT32BIT *input, long ntodo, double scale, double zero,
  792             int nullcheck, INT32BIT tnull, double nullval, char *nullarray,
  793             int *anynull, double *output, int *status);
  794 int fffi8r8(LONGLONG *input, long ntodo, double scale, double zero,
  795             int nullcheck, LONGLONG tnull, double nullval, char *nullarray,
  796             int *anynull, double *output, int *status);
  797 int fffr4r8(float *input, long ntodo, double scale, double zero,
  798             int nullcheck, double nullval, char *nullarray,
  799             int *anynull, double *output, int *status);
  800 int fffr8r8(double *input, long ntodo, double scale, double zero,
  801             int nullcheck, double nullval, char *nullarray,
  802             int *anynull, double *output, int *status);
  803 int fffstrr8(char *input, long ntodo, double scale, double zero,
  804             long twidth, double power, int nullcheck, char *snull,
  805             double nullval, char *nullarray, int *anynull, double *output,
  806             int *status);
  807  
  808 int ffi1fi1(unsigned char *array, long ntodo, double scale, double zero,
  809             unsigned char *buffer, int *status);
  810 int ffs1fi1(signed char *array, long ntodo, double scale, double zero,
  811             unsigned char *buffer, int *status);
  812 int ffu2fi1(unsigned short *array, long ntodo, double scale, double zero,
  813             unsigned char *buffer, int *status);
  814 int ffi2fi1(short *array, long ntodo, double scale, double zero,
  815             unsigned char *buffer, int *status);
  816 int ffu4fi1(unsigned long *array, long ntodo, double scale, double zero,
  817             unsigned char *buffer, int *status);
  818 int ffi4fi1(long *array, long ntodo, double scale, double zero,
  819             unsigned char *buffer, int *status);
  820 int ffu8fi1(ULONGLONG *array, long ntodo, double scale, double zero,
  821             unsigned char *buffer, int *status);
  822 int ffi8fi1(LONGLONG *array, long ntodo, double scale, double zero,
  823             unsigned char *buffer, int *status);
  824 int ffuintfi1(unsigned int *array, long ntodo, double scale, double zero,
  825             unsigned char *buffer, int *status);
  826 int ffintfi1(int *array, long ntodo, double scale, double zero,
  827             unsigned char *buffer, int *status);
  828 int ffr4fi1(float *array, long ntodo, double scale, double zero,
  829             unsigned char *buffer, int *status);
  830 int ffr8fi1(double *array, long ntodo, double scale, double zero,
  831             unsigned char *buffer, int *status);
  832  
  833 int ffi1fi2(unsigned char *array, long ntodo, double scale, double zero,
  834             short *buffer, int *status);
  835 int ffs1fi2(signed char *array, long ntodo, double scale, double zero,
  836             short *buffer, int *status);
  837 int ffu2fi2(unsigned short *array, long ntodo, double scale, double zero,
  838             short *buffer, int *status);
  839 int ffi2fi2(short *array, long ntodo, double scale, double zero,
  840             short *buffer, int *status);
  841 int ffu4fi2(unsigned long *array, long ntodo, double scale, double zero,
  842             short *buffer, int *status);
  843 int ffi4fi2(long *array, long ntodo, double scale, double zero,
  844             short *buffer, int *status);
  845 int ffu8fi2(ULONGLONG *array, long ntodo, double scale, double zero,
  846             short *buffer, int *status);
  847 int ffi8fi2(LONGLONG *array, long ntodo, double scale, double zero,
  848             short *buffer, int *status);
  849 int ffuintfi2(unsigned int *array, long ntodo, double scale, double zero,
  850             short *buffer, int *status);
  851 int ffintfi2(int *array, long ntodo, double scale, double zero,
  852             short *buffer, int *status);
  853 int ffr4fi2(float *array, long ntodo, double scale, double zero,
  854             short *buffer, int *status);
  855 int ffr8fi2(double *array, long ntodo, double scale, double zero,
  856             short *buffer, int *status);
  857  
  858 int ffi1fi4(unsigned char *array, long ntodo, double scale, double zero,
  859             INT32BIT *buffer, int *status);
  860 int ffs1fi4(signed char *array, long ntodo, double scale, double zero,
  861             INT32BIT *buffer, int *status);
  862 int ffu2fi4(unsigned short *array, long ntodo, double scale, double zero,
  863             INT32BIT *buffer, int *status);
  864 int ffi2fi4(short *array, long ntodo, double scale, double zero,
  865             INT32BIT *buffer, int *status);
  866 int ffu4fi4(unsigned long *array, long ntodo, double scale, double zero,
  867             INT32BIT *buffer, int *status);
  868 int ffu8fi4(ULONGLONG *array, long ntodo, double scale, double zero,
  869             INT32BIT *buffer, int *status);
  870 int ffi4fi4(long *array, long ntodo, double scale, double zero,
  871             INT32BIT *buffer, int *status);
  872 int ffi8fi4(LONGLONG *array, long ntodo, double scale, double zero,
  873             INT32BIT *buffer, int *status);
  874 int ffuintfi4(unsigned int *array, long ntodo, double scale, double zero,
  875             INT32BIT *buffer, int *status);
  876 int ffintfi4(int *array, long ntodo, double scale, double zero,
  877             INT32BIT *buffer, int *status);
  878 int ffr4fi4(float *array, long ntodo, double scale, double zero,
  879             INT32BIT *buffer, int *status);
  880 int ffr8fi4(double *array, long ntodo, double scale, double zero,
  881             INT32BIT *buffer, int *status);
  882 
  883 int ffi4fi8(long *array, long ntodo, double scale, double zero,
  884             LONGLONG *buffer, int *status);
  885 int ffi8fi8(LONGLONG *array, long ntodo, double scale, double zero,
  886             LONGLONG *buffer, int *status);
  887 int ffi2fi8(short *array, long ntodo, double scale, double zero,
  888             LONGLONG *buffer, int *status);
  889 int ffi1fi8(unsigned char *array, long ntodo, double scale, double zero,
  890             LONGLONG *buffer, int *status);
  891 int ffs1fi8(signed char *array, long ntodo, double scale, double zero,
  892             LONGLONG *buffer, int *status);
  893 int ffr4fi8(float *array, long ntodo, double scale, double zero,
  894             LONGLONG *buffer, int *status);
  895 int ffr8fi8(double *array, long ntodo, double scale, double zero,
  896             LONGLONG *buffer, int *status);
  897 int ffintfi8(int *array, long ntodo, double scale, double zero,
  898             LONGLONG *buffer, int *status);
  899 int ffu2fi8(unsigned short *array, long ntodo, double scale, double zero,
  900             LONGLONG *buffer, int *status);
  901 int ffu4fi8(unsigned long *array, long ntodo, double scale, double zero,
  902             LONGLONG *buffer, int *status);
  903 int ffu8fi8(ULONGLONG *array, long ntodo, double scale, double zero,
  904             LONGLONG *buffer, int *status);
  905 int ffuintfi8(unsigned int *array, long ntodo, double scale, double zero,
  906             LONGLONG *buffer, int *status);
  907 
  908 int ffi1fr4(unsigned char *array, long ntodo, double scale, double zero,
  909             float *buffer, int *status);
  910 int ffs1fr4(signed char *array, long ntodo, double scale, double zero,
  911             float *buffer, int *status);
  912 int ffu2fr4(unsigned short *array, long ntodo, double scale, double zero,
  913             float *buffer, int *status);
  914 int ffi2fr4(short *array, long ntodo, double scale, double zero,
  915             float *buffer, int *status);
  916 int ffu4fr4(unsigned long *array, long ntodo, double scale, double zero,
  917             float *buffer, int *status);
  918 int ffi4fr4(long *array, long ntodo, double scale, double zero,
  919             float *buffer, int *status);
  920 int ffu8fr4(ULONGLONG *array, long ntodo, double scale, double zero,
  921             float *buffer, int *status);
  922 int ffi8fr4(LONGLONG *array, long ntodo, double scale, double zero,
  923             float *buffer, int *status);
  924 int ffuintfr4(unsigned int *array, long ntodo, double scale, double zero,
  925             float *buffer, int *status);
  926 int ffintfr4(int *array, long ntodo, double scale, double zero,
  927             float *buffer, int *status);
  928 int ffr4fr4(float *array, long ntodo, double scale, double zero,
  929             float *buffer, int *status);
  930 int ffr8fr4(double *array, long ntodo, double scale, double zero,
  931             float *buffer, int *status);
  932  
  933 int ffi1fr8(unsigned char *array, long ntodo, double scale, double zero,
  934             double *buffer, int *status);
  935 int ffs1fr8(signed char *array, long ntodo, double scale, double zero,
  936             double *buffer, int *status);
  937 int ffu2fr8(unsigned short *array, long ntodo, double scale, double zero,
  938             double *buffer, int *status);
  939 int ffi2fr8(short *array, long ntodo, double scale, double zero,
  940             double *buffer, int *status);
  941 int ffu4fr8(unsigned long *array, long ntodo, double scale, double zero,
  942             double *buffer, int *status);
  943 int ffi4fr8(long *array, long ntodo, double scale, double zero,
  944             double *buffer, int *status);
  945 int ffu8fr8(ULONGLONG *array, long ntodo, double scale, double zero,
  946             double *buffer, int *status);
  947 int ffi8fr8(LONGLONG *array, long ntodo, double scale, double zero,
  948             double *buffer, int *status);
  949 int ffuintfr8(unsigned int *array, long ntodo, double scale, double zero,
  950             double *buffer, int *status);
  951 int ffintfr8(int *array, long ntodo, double scale, double zero,
  952             double *buffer, int *status);
  953 int ffr4fr8(float *array, long ntodo, double scale, double zero,
  954             double *buffer, int *status);
  955 int ffr8fr8(double *array, long ntodo, double scale, double zero,
  956             double *buffer, int *status);
  957 
  958 int ffi1fstr(unsigned char *input, long ntodo, double scale, double zero,
  959             char *cform, long twidth, char *output, int *status);
  960 int ffs1fstr(signed char *input, long ntodo, double scale, double zero,
  961             char *cform, long twidth, char *output, int *status);
  962 int ffu2fstr(unsigned short *input, long ntodo, double scale, double zero,
  963             char *cform, long twidth, char *output, int *status);
  964 int ffi2fstr(short *input, long ntodo, double scale, double zero,
  965             char *cform, long twidth, char *output, int *status);
  966 int ffu4fstr(unsigned long *input, long ntodo, double scale, double zero,
  967             char *cform, long twidth, char *output, int *status);
  968 int ffi4fstr(long *input, long ntodo, double scale, double zero,
  969             char *cform, long twidth, char *output, int *status);
  970 int ffu8fstr(ULONGLONG *input, long ntodo, double scale, double zero,
  971             char *cform, long twidth, char *output, int *status);
  972 int ffi8fstr(LONGLONG *input, long ntodo, double scale, double zero,
  973             char *cform, long twidth, char *output, int *status);
  974 int ffintfstr(int *input, long ntodo, double scale, double zero,
  975             char *cform, long twidth, char *output, int *status);
  976 int ffuintfstr(unsigned int *input, long ntodo, double scale, double zero,
  977             char *cform, long twidth, char *output, int *status);
  978 int ffr4fstr(float *input, long ntodo, double scale, double zero,
  979             char *cform, long twidth, char *output, int *status);
  980 int ffr8fstr(double *input, long ntodo, double scale, double zero,
  981             char *cform, long twidth, char *output, int *status);
  982 
  983 /*  the following 4 routines are VMS macros used on VAX or Alpha VMS */
  984 void ieevpd(double *inarray, double *outarray, long *nvals);
  985 void ieevud(double *inarray, double *outarray, long *nvals);
  986 void ieevpr(float *inarray, float *outarray, long *nvals);
  987 void ieevur(float *inarray, float *outarray, long *nvals);
  988 
  989 /*  routines related to the lexical parser  */
  990 int  ffselect_table(fitsfile **fptr, char *outfile, char *expr,  int *status);
  991 int  ffiprs( fitsfile *fptr, int compressed, char *expr, int maxdim,
  992          int *datatype, long *nelem, int *naxis, long *naxes,
  993          int *status );
  994 void ffcprs( void );
  995 int  ffcvtn( int inputType, void *input, char *undef, long ntodo,
  996          int outputType, void *nulval, void *output,
  997          int *anynull, int *status );
  998 int  parse_data( long totalrows, long offset, long firstrow,
  999                  long nrows, int nCols, iteratorCol *colData,
 1000                  void *userPtr );
 1001 int  uncompress_hkdata( fitsfile *fptr, long ntimes, 
 1002                         double *times, int *status );
 1003 int  ffffrw_work( long totalrows, long offset, long firstrow,
 1004                   long nrows, int nCols, iteratorCol *colData,
 1005                   void *userPtr );
 1006 
 1007 int fits_translate_pixkeyword(char *inrec, char *outrec,char *patterns[][2],
 1008     int npat, int naxis, int *colnum, int *pat_num, int *i,
 1009       int *j, int *n, int *m, int *l, int *status);
 1010 
 1011 /*  image compression routines */
 1012 int fits_write_compressed_img(fitsfile *fptr, 
 1013             int  datatype, long  *fpixel, long *lpixel,   
 1014             int nullcheck, void *array,  void *nulval,
 1015             int  *status);
 1016 int fits_write_compressed_pixels(fitsfile *fptr, 
 1017             int  datatype, LONGLONG  fpixel, LONGLONG npixels,   
 1018             int nullcheck,  void *array, void *nulval,
 1019             int  *status);
 1020 int fits_write_compressed_img_plane(fitsfile *fptr, int  datatype, 
 1021       int  bytesperpixel,  long   nplane, long *firstcoord, long *lastcoord, 
 1022       long *naxes,  int  nullcheck, 
 1023       void *array,  void *nullval, long *nread, int  *status);
 1024 
 1025 int imcomp_init_table(fitsfile *outfptr,
 1026         int bitpix, int naxis,long *naxes, int writebitpix, int *status);
 1027 int imcomp_calc_max_elem (int comptype, int nx, int zbitpix, int blocksize);
 1028 int imcomp_copy_imheader(fitsfile *infptr, fitsfile *outfptr,
 1029                 int *status);
 1030 int imcomp_copy_img2comp(fitsfile *infptr, fitsfile *outfptr, int *status);
 1031 int imcomp_copy_comp2img(fitsfile *infptr, fitsfile *outfptr, 
 1032                           int norec, int *status);
 1033 int imcomp_copy_prime2img(fitsfile *infptr, fitsfile *outfptr, int *status);
 1034 int imcomp_compress_image (fitsfile *infptr, fitsfile *outfptr,
 1035                  int *status);
 1036 int imcomp_compress_tile (fitsfile *outfptr, long row, 
 1037     int datatype,  void *tiledata, long tilelen, long nx, long ny,
 1038     int nullcheck, void *nullval, int *status);
 1039 int imcomp_nullscale(int *idata, long tilelen, int nullflagval, int nullval,
 1040      double scale, double zero, int * status);
 1041 int imcomp_nullvalues(int *idata, long tilelen, int nullflagval, int nullval,
 1042      int * status);
 1043 int imcomp_scalevalues(int *idata, long tilelen, double scale, double zero,
 1044      int * status);
 1045 int imcomp_nullscalefloats(float *fdata, long tilelen, int *idata, 
 1046     double scale, double zero, int nullcheck, float nullflagval, int nullval,
 1047     int *status);
 1048 int imcomp_nullfloats(float *fdata, long tilelen, int *idata, int nullcheck,
 1049     float nullflagval, int nullval, int *status);
 1050 int imcomp_nullscaledoubles(double *fdata, long tilelen, int *idata, 
 1051     double scale, double zero, int nullcheck, double nullflagval, int nullval,
 1052     int *status);
 1053 int imcomp_nulldoubles(double *fdata, long tilelen, int *idata, int nullcheck,
 1054     double nullflagval, int nullval, int *status);
 1055     
 1056  
 1057 /*  image decompression routines */
 1058 int fits_read_compressed_img(fitsfile *fptr, 
 1059             int  datatype, LONGLONG  *fpixel,LONGLONG  *lpixel,long *inc,   
 1060             int nullcheck, void *nulval,  void *array, char *nullarray,
 1061             int  *anynul, int  *status);
 1062 int fits_read_compressed_pixels(fitsfile *fptr, 
 1063             int  datatype, LONGLONG  fpixel, LONGLONG npixels,   
 1064             int nullcheck, void *nulval,  void *array, char *nullarray,
 1065             int  *anynul, int  *status);
 1066 int fits_read_compressed_img_plane(fitsfile *fptr, int  datatype, 
 1067       int  bytesperpixel,  long   nplane, LONGLONG *firstcoord, LONGLONG *lastcoord, 
 1068       long *inc,  long *naxes,  int  nullcheck,  void *nullval, 
 1069       void *array, char *nullarray, int  *anynul, long *nread, int  *status);
 1070 
 1071 int imcomp_get_compressed_image_par(fitsfile *infptr, int *status);
 1072 int imcomp_decompress_tile (fitsfile *infptr,
 1073           int nrow, int tilesize, int datatype, int nullcheck,
 1074           void *nulval, void *buffer, char *bnullarray, int *anynul,
 1075           int *status);
 1076 int imcomp_copy_overlap (char *tile, int pixlen, int ndim,
 1077          long *tfpixel, long *tlpixel, char *bnullarray, char *image,
 1078          long *fpixel, long *lpixel, long *inc, int nullcheck, char *nullarray,
 1079          int *status);
 1080 int imcomp_test_overlap (int ndim, long *tfpixel, long *tlpixel, 
 1081          long *fpixel, long *lpixel, long *inc, int *status);
 1082 int imcomp_merge_overlap (char *tile, int pixlen, int ndim,
 1083          long *tfpixel, long *tlpixel, char *bnullarray, char *image,
 1084          long *fpixel, long *lpixel, int nullcheck, int *status);
 1085 int imcomp_decompress_img(fitsfile *infptr, fitsfile *outfptr, int datatype,
 1086          int  *status);
 1087 int fits_quantize_float (long row, float fdata[], long nx, long ny, int nullcheck,
 1088          float in_null_value, float quantize_level, 
 1089            int dither_method, int idata[], double *bscale, double *bzero,
 1090            int *iminval, int *imaxval);
 1091 int fits_quantize_double (long row, double fdata[], long nx, long ny, int nullcheck,
 1092          double in_null_value, float quantize_level,
 1093            int dither_method, int idata[], double *bscale, double *bzero,
 1094            int *iminval, int *imaxval);
 1095 int fits_rcomp(int a[], int nx, unsigned char *c, int clen,int nblock);
 1096 int fits_rcomp_short(short a[], int nx, unsigned char *c, int clen,int nblock);
 1097 int fits_rcomp_byte(signed char a[], int nx, unsigned char *c, int clen,int nblock);
 1098 int fits_rdecomp (unsigned char *c, int clen, unsigned int array[], int nx,
 1099              int nblock);
 1100 int fits_rdecomp_short (unsigned char *c, int clen, unsigned short array[], int nx,
 1101              int nblock);
 1102 int fits_rdecomp_byte (unsigned char *c, int clen, unsigned char array[], int nx,
 1103              int nblock);
 1104 int pl_p2li (int *pxsrc, int xs, short *lldst, int npix);
 1105 int pl_l2pi (short *ll_src, int xs, int *px_dst, int npix);
 1106 int fits_init_randoms(void);
 1107 int fits_unset_compression_param( fitsfile *fptr, int *status);
 1108 int fits_unset_compression_request( fitsfile *fptr, int *status);
 1109 int fitsio_init_lock(void);
 1110 
 1111 /* general driver routines */
 1112 
 1113 int urltype2driver(char *urltype, int *driver);
 1114 
 1115 void fits_dwnld_prog_bar(int flag);
 1116 int fits_net_timeout(int sec);
 1117 
 1118 int fits_register_driver( char *prefix,
 1119     int (*init)(void),
 1120     int (*fitsshutdown)(void),
 1121     int (*setoptions)(int option),
 1122     int (*getoptions)(int *options),
 1123     int (*getversion)(int *version),
 1124     int (*checkfile) (char *urltype, char *infile, char *outfile),
 1125     int (*fitsopen)(char *filename, int rwmode, int *driverhandle),
 1126     int (*fitscreate)(char *filename, int *driverhandle),
 1127     int (*fitstruncate)(int driverhandle, LONGLONG filesize),
 1128     int (*fitsclose)(int driverhandle),
 1129     int (*fremove)(char *filename),
 1130         int (*size)(int driverhandle, LONGLONG *sizex),
 1131     int (*flush)(int driverhandle),
 1132     int (*seek)(int driverhandle, LONGLONG offset),
 1133     int (*fitsread) (int driverhandle, void *buffer, long nbytes),
 1134     int (*fitswrite)(int driverhandle, void *buffer, long nbytes));
 1135 
 1136 /* file driver I/O routines */
 1137 
 1138 int file_init(void);
 1139 int file_setoptions(int options);
 1140 int file_getoptions(int *options);
 1141 int file_getversion(int *version);
 1142 int file_shutdown(void);
 1143 int file_checkfile(char *urltype, char *infile, char *outfile);
 1144 int file_open(char *filename, int rwmode, int *driverhandle);
 1145 int file_compress_open(char *filename, int rwmode, int *hdl);
 1146 int file_openfile(char *filename, int rwmode, FILE **diskfile);
 1147 int file_create(char *filename, int *driverhandle);
 1148 int file_truncate(int driverhandle, LONGLONG filesize);
 1149 int file_size(int driverhandle, LONGLONG *filesize);
 1150 int file_close(int driverhandle);
 1151 int file_remove(char *filename);
 1152 int file_flush(int driverhandle);
 1153 int file_seek(int driverhandle, LONGLONG offset);
 1154 int file_read (int driverhandle, void *buffer, long nbytes);
 1155 int file_write(int driverhandle, void *buffer, long nbytes);
 1156 int file_is_compressed(char *filename);
 1157 
 1158 /* stream driver I/O routines */
 1159 
 1160 int stream_open(char *filename, int rwmode, int *driverhandle);
 1161 int stream_create(char *filename, int *driverhandle);
 1162 int stream_size(int driverhandle, LONGLONG *filesize);
 1163 int stream_close(int driverhandle);
 1164 int stream_flush(int driverhandle);
 1165 int stream_seek(int driverhandle, LONGLONG offset);
 1166 int stream_read (int driverhandle, void *buffer, long nbytes);
 1167 int stream_write(int driverhandle, void *buffer, long nbytes);
 1168 
 1169 /* memory driver I/O routines */
 1170 
 1171 int mem_init(void);
 1172 int mem_setoptions(int options);
 1173 int mem_getoptions(int *options);
 1174 int mem_getversion(int *version);
 1175 int mem_shutdown(void);
 1176 int mem_create(char *filename, int *handle);
 1177 int mem_create_comp(char *filename, int *handle);
 1178 int mem_openmem(void **buffptr, size_t *buffsize, size_t deltasize,
 1179                 void *(*memrealloc)(void *p, size_t newsize), int *handle);
 1180 int mem_createmem(size_t memsize, int *handle);
 1181 int stdin_checkfile(char *urltype, char *infile, char *outfile);
 1182 int stdin_open(char *filename, int rwmode, int *handle);
 1183 int stdin2mem(int hd);
 1184 int stdin2file(int hd);
 1185 int stdout_close(int handle);
 1186 int mem_compress_openrw(char *filename, int rwmode, int *hdl);
 1187 int mem_compress_open(char *filename, int rwmode, int *hdl);
 1188 int mem_compress_stdin_open(char *filename, int rwmode, int *hdl);
 1189 int mem_iraf_open(char *filename, int rwmode, int *hdl);
 1190 int mem_rawfile_open(char *filename, int rwmode, int *hdl);
 1191 int mem_size(int handle, LONGLONG *filesize);
 1192 int mem_truncate(int handle, LONGLONG filesize);
 1193 int mem_close_free(int handle);
 1194 int mem_close_keep(int handle);
 1195 int mem_close_comp(int handle);
 1196 int mem_seek(int handle, LONGLONG offset);
 1197 int mem_read(int hdl, void *buffer, long nbytes);
 1198 int mem_write(int hdl, void *buffer, long nbytes);
 1199 int mem_uncompress2mem(char *filename, FILE *diskfile, int hdl);
 1200 
 1201 int iraf2mem(char *filename, char **buffptr, size_t *buffsize, 
 1202       size_t *filesize, int *status);
 1203 
 1204 /* root driver I/O routines */
 1205 
 1206 int root_init(void);
 1207 int root_setoptions(int options);
 1208 int root_getoptions(int *options);
 1209 int root_getversion(int *version);
 1210 int root_shutdown(void);
 1211 int root_open(char *filename, int rwmode, int *driverhandle);
 1212 int root_create(char *filename, int *driverhandle);
 1213 int root_close(int driverhandle);
 1214 int root_flush(int driverhandle);
 1215 int root_seek(int driverhandle, LONGLONG offset);
 1216 int root_read (int driverhandle, void *buffer, long nbytes);
 1217 int root_write(int driverhandle, void *buffer, long nbytes);
 1218 int root_size(int handle, LONGLONG *filesize);
 1219 
 1220 /* http driver I/O routines */
 1221 
 1222 int http_checkfile(char *urltype, char *infile, char *outfile);
 1223 int http_open(char *filename, int rwmode, int *driverhandle);
 1224 int http_file_open(char *filename, int rwmode, int *driverhandle);
 1225 int http_compress_open(char *filename, int rwmode, int *driverhandle);
 1226 
 1227 /* https driver I/O routines */
 1228 int https_checkfile(char* urltype, char *infile, char *outfile);
 1229 int https_open(char *filename, int rwmode, int *driverhandle);
 1230 int https_file_open(char *filename, int rwmode, int *driverhandle);
 1231 void https_set_verbose(int flag);
 1232 
 1233 /* ftps driver I/O routines */
 1234 int ftps_checkfile(char* urltype, char *infile, char *outfile);
 1235 int ftps_open(char *filename, int rwmode, int *handle);
 1236 int ftps_file_open(char *filename, int rwmode, int *handle);
 1237 int ftps_compress_open(char *filename, int rwmode, int *driverhandle);
 1238 
 1239 /* ftp driver I/O routines */
 1240 
 1241 int ftp_checkfile(char *urltype, char *infile, char *outfile);
 1242 int ftp_open(char *filename, int rwmode, int *driverhandle);
 1243 int ftp_file_open(char *filename, int rwmode, int *driverhandle);
 1244 int ftp_compress_open(char *filename, int rwmode, int *driverhandle);
 1245 
 1246 int uncompress2mem(char *filename, FILE *diskfile,
 1247              char **buffptr, size_t *buffsize,
 1248              void *(*mem_realloc)(void *p, size_t newsize),
 1249              size_t *filesize, int *status);
 1250 
 1251 int uncompress2mem_from_mem(                                                
 1252              char *inmemptr,     
 1253              size_t inmemsize, 
 1254              char **buffptr,  
 1255              size_t *buffsize,  
 1256              void *(*mem_realloc)(void *p, size_t newsize), 
 1257              size_t *filesize,  
 1258              int *status);
 1259 
 1260 int uncompress2file(char *filename, 
 1261              FILE *indiskfile, 
 1262              FILE *outdiskfile, 
 1263              int *status);
 1264 
 1265 int compress2mem_from_mem(                                                
 1266              char *inmemptr,     
 1267              size_t inmemsize, 
 1268              char **buffptr,  
 1269              size_t *buffsize,  
 1270              void *(*mem_realloc)(void *p, size_t newsize), 
 1271              size_t *filesize,  
 1272              int *status);
 1273 
 1274 int compress2file_from_mem(                                                
 1275              char *inmemptr,     
 1276              size_t inmemsize, 
 1277              FILE *outdiskfile, 
 1278              size_t *filesize,   /* O - size of file, in bytes              */
 1279              int *status);
 1280 
 1281 
 1282 #ifdef HAVE_GSIFTP
 1283 /* prototypes for gsiftp driver I/O routines */
 1284 #include "drvrgsiftp.h"
 1285 #endif
 1286 
 1287 #ifdef HAVE_SHMEM_SERVICES
 1288 /* prototypes for shared memory driver I/O routines  */
 1289 #include "drvrsmem.h"
 1290 #endif
 1291 
 1292 /* A hack for nonunix machines, which lack strcasecmp and strncasecmp */
 1293 /* these functions are in fitscore.c */
 1294 int fits_strcasecmp (const char *s1, const char *s2       );
 1295 int fits_strncasecmp(const char *s1, const char *s2, size_t n);
 1296 
 1297 /* end of the entire "ifndef _FITSIO2_H" block */
 1298 #endif