1 /*  The FITSIO software was written by William Pence at the High Energy    */
2 /*  Astrophysic Science Archive Research Center (HEASARC) at the NASA      */
3 /*  Goddard Space Flight Center.                                           */
4 /*
5 
6 Copyright (Unpublished--all rights reserved under the copyright laws of
7 the United States), U.S. Government as represented by the Administrator
8 of the National Aeronautics and Space Administration.  No copyright is
9 claimed in the United States under Title 17, U.S. Code.
10 
11 Permission to freely use, copy, modify, and distribute this software
12 and its documentation without fee is hereby granted, provided that this
13 copyright notice and disclaimer of warranty appears in all copies.
14 
15 DISCLAIMER:
16 
17 THE SOFTWARE IS PROVIDED 'AS IS' WITHOUT ANY WARRANTY OF ANY KIND,
18 EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO,
19 ANY WARRANTY THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS, ANY
20 IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
21 PURPOSE, AND FREEDOM FROM INFRINGEMENT, AND ANY WARRANTY THAT THE
22 DOCUMENTATION WILL CONFORM TO THE SOFTWARE, OR ANY WARRANTY THAT THE
23 SOFTWARE WILL BE ERROR FREE.  IN NO EVENT SHALL NASA BE LIABLE FOR ANY
24 DAMAGES, INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL OR
25 CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN ANY WAY
26 CONNECTED WITH THIS SOFTWARE, WHETHER OR NOT BASED UPON WARRANTY,
27 CONTRACT, TORT , OR OTHERWISE, WHETHER OR NOT INJURY WAS SUSTAINED BY
28 PERSONS OR PROPERTY OR OTHERWISE, AND WHETHER OR NOT LOSS WAS SUSTAINED
29 FROM, OR AROSE OUT OF THE RESULTS OF, OR USE OF, THE SOFTWARE OR
30 SERVICES PROVIDED HEREUNDER."
31 
32 */
33 
34 #ifndef _FITSIO_H
35 #define _FITSIO_H
36 
37 #define CFITSIO_VERSION 3.47
38 #define CFITSIO_MINOR 47
39 #define CFITSIO_MAJOR 3
40 #define CFITSIO_SONAME 8
41 
42 /* the SONAME is incremented in a new release if the binary shared */
43 /* library (on linux and Mac systems) is not backward compatible */
44 /* with the previous release of CFITSIO */
45 
46 
47 /* CFITS_API is defined below for use on Windows systems.  */
48 /* It is used to identify the public functions which should be exported. */
49 /* This has no effect on non-windows platforms where "WIN32" is not defined */
50 
51 #if defined (WIN32)
52   #if defined(cfitsio_EXPORTS)
53     #define CFITS_API __declspec(dllexport)
54   #else
55     #define CFITS_API  /* __declspec(dllimport) */
56   #endif /* CFITS_API */
57 #else /* defined (WIN32) */
58  #define CFITS_API
59 #endif
60 
61 #include <stdio.h>
62 
63 /* the following was provided by Michael Greason (GSFC) to fix a */
64 /*  C/Fortran compatibility problem on an SGI Altix system running */
65 /*  SGI ProPack 4 [this is a Novell SuSE Enterprise 9 derivative]  */
66 /*  and using the Intel C++ and Fortran compilers (version 9.1)  */
67 #if defined(__INTEL_COMPILER) && defined(__itanium__)
68 #  define mipsFortran 1
69 #  define _MIPS_SZLONG 64
70 #endif
71 
72 #if defined(linux) || defined(__APPLE__) || defined(__sgi)
73 #  include <sys/types.h>  /* apparently needed on debian linux systems */
74 #endif                    /* to define off_t                           */
75 
76 #include <stdlib.h>  /* apparently needed to define size_t with gcc 2.8.1 */
77 #include <limits.h>  /* needed for LLONG_MAX and INT64_MAX definitions */
78 
79 /* Define the datatype for variables which store file offset values. */
80 /* The newer 'off_t' datatype should be used for this purpose, but some */
81 /* older compilers do not recognize this type, in which case we use 'long' */
82 /* instead.  Note that _OFF_T is defined (or not) in stdio.h depending */
83 /* on whether _LARGEFILE_SOURCE is defined in sys/feature_tests.h  */
84 /* (at least on Solaris platforms using cc)  */
85 
86 /*  Debian systems require: "(defined(linux) && defined(__off_t_defined))" */
87 /*  the mingw-w64 compiler requires: "(defined(__MINGW32__) && defined(_OFF_T_DEFINED))" */
88 #if defined(_OFF_T) \
89     || (defined(linux) && defined(__off_t_defined)) \
90     || (defined(__MINGW32__) && defined(_OFF_T_DEFINED)) \
91     || defined(_MIPS_SZLONG) || defined(__APPLE__) || defined(_AIX)
92 #    define OFF_T off_t
93 #elif defined(__BORLANDC__) || (defined(_MSC_VER) && (_MSC_VER>= 1400))
94 #    define OFF_T long long
95 #else
96 #    define OFF_T long
97 #endif
98 
99 /* this block determines if the the string function name is
100     strtol or strtoll, and whether to use %ld or %lld in printf statements */
101 
102 /*
103    The following 2 cases for that Athon64 were removed on 4 Jan 2006;
104    they appear to be incorrect now that LONGLONG is always typedef'ed
105    to 'long long'
106     ||  defined(__ia64__)   \
107     ||  defined(__x86_64__) \
108 */
109 #if (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \
110     ||  defined(__sparcv9) || (defined(__sparc__) && defined(__arch64__))  \
111     ||  defined(__powerpc64__) || defined(__64BIT__) \
112     ||  (defined(_MIPS_SZLONG) &&  _MIPS_SZLONG == 64) \
113     ||  defined( _MSC_VER)|| defined(__BORLANDC__)
114 
115 #   define USE_LL_SUFFIX 0
116 #else
117 #   define USE_LL_SUFFIX 1
118 #endif
119 
120 /*
121    Determine what 8-byte integer data type is available.
122   'long long' is now supported by most compilers, but
123   older MS Visual C++ compilers before V7.0 use '__int64' instead.
124 */
125 
126 #ifndef LONGLONG_TYPE   /* this may have been previously defined */
127 #if defined(_MSC_VER)   /* Microsoft Visual C++ */
128 
129 #if (_MSC_VER < 1300)   /* versions earlier than V7.0 do not have 'long long' */
130     typedef __int64 LONGLONG;
131     typedef unsigned __int64 ULONGLONG;
132 
133 #else                   /* newer versions do support 'long long' */
134     typedef long long LONGLONG;
135     typedef unsigned long long ULONGLONG;
136 
137 #endif
138 
139 #elif defined( __BORLANDC__)  /* for the Borland 5.5 compiler, in particular */
140     typedef __int64 LONGLONG;
141     typedef unsigned __int64 ULONGLONG;
142 #else
143     typedef long long LONGLONG;
144     typedef unsigned long long ULONGLONG;
145 #endif
146 
147 #define LONGLONG_TYPE
148 #endif
149 
150 #ifndef LONGLONG_MAX
151 
152 #ifdef LLONG_MAX
153 /* Linux and Solaris definition */
154 #define LONGLONG_MAX LLONG_MAX
155 #define LONGLONG_MIN LLONG_MIN
156 
157 #elif defined(LONG_LONG_MAX)
158 #define LONGLONG_MAX LONG_LONG_MAX
159 #define LONGLONG_MIN LONG_LONG_MIN
160 
161 #elif defined(__LONG_LONG_MAX__)
162 /* Mac OS X & CYGWIN defintion */
163 #define LONGLONG_MAX __LONG_LONG_MAX__
164 #define LONGLONG_MIN (-LONGLONG_MAX -1LL)
165 
166 #elif defined(INT64_MAX)
167 /* windows definition */
168 #define LONGLONG_MAX INT64_MAX
169 #define LONGLONG_MIN INT64_MIN
170 
171 #elif defined(_I64_MAX)
172 /* windows definition */
173 #define LONGLONG_MAX _I64_MAX
174 #define LONGLONG_MIN _I64_MIN
175 
176 #elif (defined(__alpha) && ( defined(__unix__) || defined(__NetBSD__) )) \
177     ||  defined(__sparcv9)  \
178     ||  defined(__ia64__)   \
179     ||  defined(__x86_64__) \
180     ||  defined(_SX)        \
181     ||  defined(__powerpc64__) || defined(__64BIT__) \
182     ||  (defined(_MIPS_SZLONG) &&  _MIPS_SZLONG == 64)
183 /* sizeof(long) = 64 */
184 #define LONGLONG_MAX  9223372036854775807L /* max 64-bit integer */
185 #define LONGLONG_MIN (-LONGLONG_MAX -1L)   /* min 64-bit integer */
186 
187 #else
188 /*  define a default value, even if it is never used */
189 #define LONGLONG_MAX  9223372036854775807LL /* max 64-bit integer */
190 #define LONGLONG_MIN (-LONGLONG_MAX -1LL)   /* min 64-bit integer */
191 
192 #endif
193 #endif  /* end of ndef LONGLONG_MAX section */
194 
195 
196 /* ================================================================= */
197 
198 
199 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
200 #ifndef __CINT__
201 #include "longnam.h"
202 #endif
203 
204 #define NIOBUF  40  /* number of IO buffers to create (default = 40) */
205           /* !! Significantly increasing NIOBUF may degrade performance !! */
206 
207 #define IOBUFLEN 2880    /* size in bytes of each IO buffer (DONT CHANGE!) */
208 
209 /* global variables */
210 
211 #define FLEN_FILENAME 1025 /* max length of a filename  */
212 #define FLEN_KEYWORD   75  /* max length of a keyword (HIERARCH convention) */
213 #define FLEN_CARD      81  /* length of a FITS header card */
214 #define FLEN_VALUE     71  /* max length of a keyword value string */
215 #define FLEN_COMMENT   73  /* max length of a keyword comment string */
216 #define FLEN_ERRMSG    81  /* max length of a FITSIO error message */
217 #define FLEN_STATUS    31  /* max length of a FITSIO status text string */
218 
219 #define TBIT          1  /* codes for FITS table data types */
220 #define TBYTE        11
221 #define TSBYTE       12
222 #define TLOGICAL     14
223 #define TSTRING      16
224 #define TUSHORT      20
225 #define TSHORT       21
226 #define TUINT        30
227 #define TINT         31
228 #define TULONG       40
229 #define TLONG        41
230 #define TINT32BIT    41  /* used when returning datatype of a column */
231 #define TFLOAT       42
232 #define TULONGLONG   80
233 #define TLONGLONG    81
234 #define TDOUBLE      82
235 #define TCOMPLEX     83
236 #define TDBLCOMPLEX 163
237 
238 #define TYP_STRUC_KEY 10
239 #define TYP_CMPRS_KEY 20
240 #define TYP_SCAL_KEY  30
241 #define TYP_NULL_KEY  40
242 #define TYP_DIM_KEY   50
243 #define TYP_RANG_KEY  60
244 #define TYP_UNIT_KEY  70
245 #define TYP_DISP_KEY  80
246 #define TYP_HDUID_KEY 90
247 #define TYP_CKSUM_KEY 100
248 #define TYP_WCS_KEY   110
249 #define TYP_REFSYS_KEY 120
250 #define TYP_COMM_KEY  130
251 #define TYP_CONT_KEY  140
252 #define TYP_USER_KEY  150
253 
254 
255 #define INT32BIT int  /* 32-bit integer datatype.  Currently this       */
256                       /* datatype is an 'int' on all useful platforms   */
257                       /* however, it is possible that that are cases    */
258                       /* where 'int' is a 2-byte integer, in which case */
259                       /* INT32BIT would need to be defined as 'long'.   */
260 
261 #define BYTE_IMG      8  /* BITPIX code values for FITS image types */
262 #define SHORT_IMG    16
263 #define LONG_IMG     32
264 #define LONGLONG_IMG 64
265 #define FLOAT_IMG   -32
266 #define DOUBLE_IMG  -64
267                          /* The following 2 codes are not true FITS         */
268                          /* datatypes; these codes are only used internally */
269                          /* within cfitsio to make it easier for users      */
270                          /* to deal with unsigned integers.                 */
271 #define SBYTE_IMG     10
272 #define USHORT_IMG    20
273 #define ULONG_IMG     40
274 #define ULONGLONG_IMG 80
275 
276 #define IMAGE_HDU  0  /* Primary Array or IMAGE HDU */
277 #define ASCII_TBL  1  /* ASCII table HDU  */
278 #define BINARY_TBL 2  /* Binary table HDU */
279 #define ANY_HDU   -1  /* matches any HDU type */
280 
281 #define READONLY  0    /* options when opening a file */
282 #define READWRITE 1
283 
284 /* adopt a hopefully obscure number to use as a null value flag */
285 /* could be problems if the FITS files contain data with these values */
286 #define FLOATNULLVALUE -9.11912E-36F
287 #define DOUBLENULLVALUE -9.1191291391491E-36
288 
289 /* compression algorithm codes */
290 #define NO_DITHER -1
291 #define SUBTRACTIVE_DITHER_1 1
292 #define SUBTRACTIVE_DITHER_2 2
293 #define MAX_COMPRESS_DIM     6
294 #define RICE_1      11
295 #define GZIP_1      21
296 #define GZIP_2      22
297 #define PLIO_1      31
298 #define HCOMPRESS_1 41
299 #define BZIP2_1     51  /* not publicly supported; only for test purposes */
300 #define NOCOMPRESS  -1
301 
302 #ifndef TRUE
303 #define TRUE 1
304 #endif
305 
306 #ifndef FALSE
307 #define FALSE 0
308 #endif
309 
310 #define CASESEN   1   /* do case-sensitive string match */
311 #define CASEINSEN 0   /* do case-insensitive string match */
312 
313 #define GT_ID_ALL_URI  0   /* hierarchical grouping parameters */
314 #define GT_ID_REF      1
315 #define GT_ID_POS      2
316 #define GT_ID_ALL      3
317 #define GT_ID_REF_URI 11
318 #define GT_ID_POS_URI 12
319 
320 #define OPT_RM_GPT      0
321 #define OPT_RM_ENTRY    1
322 #define OPT_RM_MBR      2
323 #define OPT_RM_ALL      3
324 
325 #define OPT_GCP_GPT     0
326 #define OPT_GCP_MBR     1
327 #define OPT_GCP_ALL     2
328 
329 #define OPT_MCP_ADD     0
330 #define OPT_MCP_NADD    1
331 #define OPT_MCP_REPL    2
332 #define OPT_MCP_MOV     3
333 
334 #define OPT_MRG_COPY    0
335 #define OPT_MRG_MOV     1
336 
337 #define OPT_CMT_MBR      1
338 #define OPT_CMT_MBR_DEL 11
339 
340 typedef struct        /* structure used to store table column information */
341 {
342     char ttype[70];   /* column name = FITS TTYPEn keyword; */
343     LONGLONG tbcol;       /* offset in row to first byte of each column */
344     int  tdatatype;   /* datatype code of each column */
345     LONGLONG trepeat;    /* repeat count of column; number of elements */
346     double tscale;    /* FITS TSCALn linear scaling factor */
347     double tzero;     /* FITS TZEROn linear scaling zero point */
348     LONGLONG tnull;   /* FITS null value for int image or binary table cols */
349     char strnull[20]; /* FITS null value string for ASCII table columns */
350     char tform[10];   /* FITS tform keyword value  */
351     long  twidth;     /* width of each ASCII table column */
352 }tcolumn;
353 
354 #define VALIDSTRUC 555  /* magic value used to identify if structure is valid */
355 
356 typedef struct      /* structure used to store basic FITS file information */
357 {
358     int filehandle;   /* handle returned by the file open function */
359     int driver;       /* defines which set of I/O drivers should be used */
360     int open_count;   /* number of opened 'fitsfiles' using this structure */
361     char *filename;   /* file name */
362     int validcode;    /* magic value used to verify that structure is valid */
363     int only_one;     /* flag meaning only copy the specified extension */
364     LONGLONG filesize; /* current size of the physical disk file in bytes */
365     LONGLONG logfilesize; /* logical size of file, including unflushed buffers */
366     int lasthdu;      /* is this the last HDU in the file? 0 = no, else yes */
367     LONGLONG bytepos; /* current logical I/O pointer position in file */
368     LONGLONG io_pos;  /* current I/O pointer position in the physical file */
369     int curbuf;       /* number of I/O buffer currently in use */
370     int curhdu;       /* current HDU number; 0 = primary array */
371     int hdutype;      /* 0 = primary array, 1 = ASCII table, 2 = binary table */
372     int writemode;    /* 0 = readonly, 1 = readwrite */
373     int maxhdu;       /* highest numbered HDU known to exist in the file */
374     int MAXHDU;       /* dynamically allocated dimension of headstart array */
375     LONGLONG *headstart; /* byte offset in file to start of each HDU */
376     LONGLONG headend;   /* byte offest in file to end of the current HDU header */
377     LONGLONG ENDpos;    /* byte offest to where the END keyword was last written */
378     LONGLONG nextkey;   /* byte offset in file to beginning of next keyword */
379     LONGLONG datastart; /* byte offset in file to start of the current data unit */
380     int imgdim;         /* dimension of image; cached for fast access */
381     LONGLONG imgnaxis[99]; /* length of each axis; cached for fast access */
382     int tfield;          /* number of fields in the table (primary array has 2 */
383     int startcol;        /* used by ffgcnn to record starting column number */
384     LONGLONG origrows;   /* original number of rows (value of NAXIS2 keyword)  */
385     LONGLONG numrows;    /* number of rows in the table (dynamically updated) */
386     LONGLONG rowlength;  /* length of a table row or image size (bytes) */
387     tcolumn *tableptr;   /* pointer to the table structure */
388     LONGLONG heapstart;  /* heap start byte relative to start of data unit */
389     LONGLONG heapsize;   /* size of the heap, in bytes */
390 
391          /* the following elements are related to compressed images */
392 
393     /* these record the 'requested' options to be used when the image is compressed */
394     int request_compress_type;  /* requested image compression algorithm */
395     long request_tilesize[MAX_COMPRESS_DIM]; /* requested tiling size */
396     float request_quantize_level;  /* requested quantize level */
397     int request_quantize_method ;  /* requested  quantizing method */
398     int request_dither_seed;     /* starting offset into the array of random dithering */
399     int request_lossy_int_compress; /* lossy compress integer image as if float image? */
400     int request_huge_hdu;          /* use '1Q' rather then '1P' variable length arrays */
401     float request_hcomp_scale;     /* requested HCOMPRESS scale factor */
402     int request_hcomp_smooth;      /* requested HCOMPRESS smooth parameter */
403 
404     /* these record the actual options that were used when the image was compressed */
405     int compress_type;      /* type of compression algorithm */
406     long tilesize[MAX_COMPRESS_DIM]; /* size of compression tiles */
407     float quantize_level;   /* floating point quantization level */
408     int quantize_method;   /* floating point pixel quantization algorithm */
409     int dither_seed;      /* starting offset into the array of random dithering */
410 
411     /* other compression parameters */
412     int compressimg; /* 1 if HDU contains a compressed image, else 0 */
413     char zcmptype[12];      /* compression type string */
414     int zbitpix;            /* FITS data type of image (BITPIX) */
415     int zndim;              /* dimension of image */
416     long znaxis[MAX_COMPRESS_DIM];  /* length of each axis */
417     long maxtilelen;        /* max number of pixels in each image tile */
418     long maxelem;	    /* maximum byte length of tile compressed arrays */
419 
420     int cn_compressed;	    /* column number for COMPRESSED_DATA column */
421     int cn_uncompressed;    /* column number for UNCOMPRESSED_DATA column */
422     int cn_gzip_data;       /* column number for GZIP2 lossless compressed data */
423     int cn_zscale;	    /* column number for ZSCALE column */
424     int cn_zzero;	    /* column number for ZZERO column */
425     int cn_zblank;          /* column number for the ZBLANK column */
426 
427     double zscale;          /* scaling value, if same for all tiles */
428     double zzero;           /* zero pt, if same for all tiles */
429     double cn_bscale;       /* value of the BSCALE keyword in header */
430     double cn_bzero;        /* value of the BZERO keyword (may be reset) */
431     double cn_actual_bzero; /* actual value of the BZERO keyword  */
432     int zblank;             /* value for null pixels, if not a column */
433 
434     int rice_blocksize;     /* first compression parameter: Rice pixels/block */
435     int rice_bytepix;       /* 2nd compression parameter:   Rice bytes/pixel */
436     float hcomp_scale;      /* 1st hcompress compression parameter */
437     int hcomp_smooth;       /* 2nd hcompress compression parameter */
438 
439     int  *tilerow;          /* row number of the array of uncompressed tiledata */
440     long *tiledatasize;     /* length of the array of tile data in bytes */
441     int *tiletype;          /* datatype of the array of tile (TINT, TSHORT, etc) */
442     void **tiledata;        /* array of uncompressed tile of data, for row *tilerow */
443     void **tilenullarray;   /* array of optional array of null value flags */
444     int *tileanynull;       /* anynulls in the array of tile? */
445 
446     char *iobuffer;         /* pointer to FITS file I/O buffers */
447     long bufrecnum[NIOBUF]; /* file record number of each of the buffers */
448     int dirty[NIOBUF];     /* has the corresponding buffer been modified? */
449     int ageindex[NIOBUF];  /* relative age of each buffer */
450 } FITSfile;
451 
452 typedef struct         /* structure used to store basic HDU information */
453 {
454     int HDUposition;  /* HDU position in file; 0 = first HDU */
455     FITSfile *Fptr;   /* pointer to FITS file structure */
456 }fitsfile;
457 
458 typedef struct  /* structure for the iterator function column information */
459 {
460      /* elements required as input to fits_iterate_data: */
461 
462     fitsfile *fptr;     /* pointer to the HDU containing the column */
463     int      colnum;    /* column number in the table (use name if < 1) */
464     char     colname[70]; /* name (= TTYPEn value) of the column (optional) */
465     int      datatype;  /* output datatype (converted if necessary  */
466     int      iotype;    /* = InputCol, InputOutputCol, or OutputCol */
467 
468     /* output elements that may be useful for the work function: */
469 
470     void     *array;    /* pointer to the array (and the null value) */
471     long     repeat;    /* binary table vector repeat value */
472     long     tlmin;     /* legal minimum data value */
473     long     tlmax;     /* legal maximum data value */
474     char     tunit[70]; /* physical unit string */
475     char     tdisp[70]; /* suggested display format */
476 
477 } iteratorCol;
478 
479 #define InputCol         0  /* flag for input only iterator column       */
480 #define InputOutputCol   1  /* flag for input and output iterator column */
481 #define OutputCol        2  /* flag for output only iterator column      */
482 
483 /*=============================================================================
484 *
485 *       The following wtbarr typedef is used in the fits_read_wcstab() routine,
486 *       which is intended for use with the WCSLIB library written by Mark
487 *       Calabretta, http://www.atnf.csiro.au/~mcalabre/index.html
488 *
489 *       In order to maintain WCSLIB and CFITSIO as independent libraries it
490 *       was not permissible for any CFITSIO library code to include WCSLIB
491 *       header files, or vice versa.  However, the CFITSIO function
492 *       fits_read_wcstab() accepts an array of structs defined by wcs.h within
493 *       WCSLIB.  The problem then was to define this struct within fitsio.h
494 *       without including wcs.h, especially noting that wcs.h will often (but
495 *       not always) be included together with fitsio.h in an applications
496 *       program that uses fits_read_wcstab().
497 *
498 *       Of the various possibilities, the solution adopted was for WCSLIB to
499 *       define "struct wtbarr" while fitsio.h defines "typedef wtbarr", a
500 *       untagged struct with identical members.  This allows both wcs.h and
501 *       fitsio.h to define a wtbarr data type without conflict by virtue of
502 *       the fact that structure tags and typedef names share different
503 *       namespaces in C. Therefore, declarations within WCSLIB look like
504 *
505 *          struct wtbarr *w;
506 *
507 *       while within CFITSIO they are simply
508 *
509 *          wtbarr *w;
510 *
511 *       but as suggested by the commonality of the names, these are really the
512 *       same aggregate data type.  However, in passing a (struct wtbarr *) to
513 *       fits_read_wcstab() a cast to (wtbarr *) is formally required.
514 *===========================================================================*/
515 
516 #ifndef WCSLIB_GETWCSTAB
517 #define WCSLIB_GETWCSTAB
518 
519 typedef struct {
520    int  i;                      /* Image axis number.                       */
521    int  m;                      /* Array axis number for index vectors.     */
522    int  kind;                   /* Array type, 'c' (coord) or 'i' (index).  */
523    char extnam[72];             /* EXTNAME of binary table extension.       */
524    int  extver;                 /* EXTVER  of binary table extension.       */
525    int  extlev;                 /* EXTLEV  of binary table extension.       */
526    char ttype[72];              /* TTYPEn of column containing the array.   */
527    long row;                    /* Table row number.                        */
528    int  ndim;                   /* Expected array dimensionality.           */
529    int  *dimlen;                /* Where to write the array axis lengths.   */
530    double **arrayp;             /* Where to write the address of the array  */
531                                 /* allocated to store the array.            */
532 } wtbarr;
533 
534 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
535 #ifndef __CINT__
536 /*  the following 3 lines are needed to support C++ compilers */
537 #ifdef __cplusplus
538 extern "C" {
539 #endif
540 #endif
541 
542 int CFITS_API fits_read_wcstab(fitsfile *fptr, int nwtb, wtbarr *wtb, int *status);
543 
544 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
545 #ifndef __CINT__
546 #ifdef __cplusplus
547 }
548 #endif
549 #endif
550 
551 #endif /* WCSLIB_GETWCSTAB */
552 
553 /* error status codes */
554 
555 #define CREATE_DISK_FILE -106 /* create disk file, without extended filename syntax */
556 #define OPEN_DISK_FILE   -105 /* open disk file, without extended filename syntax */
557 #define SKIP_TABLE       -104 /* move to 1st image when opening file */
558 #define SKIP_IMAGE       -103 /* move to 1st table when opening file */
559 #define SKIP_NULL_PRIMARY -102 /* skip null primary array when opening file */
560 #define USE_MEM_BUFF     -101  /* use memory buffer when opening file */
561 #define OVERFLOW_ERR      -11  /* overflow during datatype conversion */
562 #define PREPEND_PRIMARY    -9  /* used in ffiimg to insert new primary array */
563 #define SAME_FILE         101  /* input and output files are the same */
564 #define TOO_MANY_FILES    103  /* tried to open too many FITS files */
565 #define FILE_NOT_OPENED   104  /* could not open the named file */
566 #define FILE_NOT_CREATED  105  /* could not create the named file */
567 #define WRITE_ERROR       106  /* error writing to FITS file */
568 #define END_OF_FILE       107  /* tried to move past end of file */
569 #define READ_ERROR        108  /* error reading from FITS file */
570 #define FILE_NOT_CLOSED   110  /* could not close the file */
571 #define ARRAY_TOO_BIG     111  /* array dimensions exceed internal limit */
572 #define READONLY_FILE     112  /* Cannot write to readonly file */
573 #define MEMORY_ALLOCATION 113  /* Could not allocate memory */
574 #define BAD_FILEPTR       114  /* invalid fitsfile pointer */
575 #define NULL_INPUT_PTR    115  /* NULL input pointer to routine */
576 #define SEEK_ERROR        116  /* error seeking position in file */
577 #define BAD_NETTIMEOUT    117  /* bad value for file download timeout setting */
578 
579 #define BAD_URL_PREFIX    121  /* invalid URL prefix on file name */
580 #define TOO_MANY_DRIVERS  122  /* tried to register too many IO drivers */
581 #define DRIVER_INIT_FAILED 123  /* driver initialization failed */
582 #define NO_MATCHING_DRIVER 124  /* matching driver is not registered */
583 #define URL_PARSE_ERROR    125  /* failed to parse input file URL */
584 #define RANGE_PARSE_ERROR  126  /* failed to parse input file URL */
585 
586 #define	SHARED_ERRBASE	(150)
587 #define	SHARED_BADARG	(SHARED_ERRBASE + 1)
588 #define	SHARED_NULPTR	(SHARED_ERRBASE + 2)
589 #define	SHARED_TABFULL	(SHARED_ERRBASE + 3)
590 #define	SHARED_NOTINIT	(SHARED_ERRBASE + 4)
591 #define	SHARED_IPCERR	(SHARED_ERRBASE + 5)
592 #define	SHARED_NOMEM	(SHARED_ERRBASE + 6)
593 #define	SHARED_AGAIN	(SHARED_ERRBASE + 7)
594 #define	SHARED_NOFILE	(SHARED_ERRBASE + 8)
595 #define	SHARED_NORESIZE	(SHARED_ERRBASE + 9)
596 
597 #define HEADER_NOT_EMPTY  201  /* header already contains keywords */
598 #define KEY_NO_EXIST      202  /* keyword not found in header */
599 #define KEY_OUT_BOUNDS    203  /* keyword record number is out of bounds */
600 #define VALUE_UNDEFINED   204  /* keyword value field is blank */
601 #define NO_QUOTE          205  /* string is missing the closing quote */
602 #define BAD_INDEX_KEY     206  /* illegal indexed keyword name */
603 #define BAD_KEYCHAR       207  /* illegal character in keyword name or card */
604 #define BAD_ORDER         208  /* required keywords out of order */
605 #define NOT_POS_INT       209  /* keyword value is not a positive integer */
606 #define NO_END            210  /* couldn't find END keyword */
607 #define BAD_BITPIX        211  /* illegal BITPIX keyword value*/
608 #define BAD_NAXIS         212  /* illegal NAXIS keyword value */
609 #define BAD_NAXES         213  /* illegal NAXISn keyword value */
610 #define BAD_PCOUNT        214  /* illegal PCOUNT keyword value */
611 #define BAD_GCOUNT        215  /* illegal GCOUNT keyword value */
612 #define BAD_TFIELDS       216  /* illegal TFIELDS keyword value */
613 #define NEG_WIDTH         217  /* negative table row size */
614 #define NEG_ROWS          218  /* negative number of rows in table */
615 #define COL_NOT_FOUND     219  /* column with this name not found in table */
616 #define BAD_SIMPLE        220  /* illegal value of SIMPLE keyword  */
617 #define NO_SIMPLE         221  /* Primary array doesn't start with SIMPLE */
618 #define NO_BITPIX         222  /* Second keyword not BITPIX */
619 #define NO_NAXIS          223  /* Third keyword not NAXIS */
620 #define NO_NAXES          224  /* Couldn't find all the NAXISn keywords */
621 #define NO_XTENSION       225  /* HDU doesn't start with XTENSION keyword */
622 #define NOT_ATABLE        226  /* the CHDU is not an ASCII table extension */
623 #define NOT_BTABLE        227  /* the CHDU is not a binary table extension */
624 #define NO_PCOUNT         228  /* couldn't find PCOUNT keyword */
625 #define NO_GCOUNT         229  /* couldn't find GCOUNT keyword */
626 #define NO_TFIELDS        230  /* couldn't find TFIELDS keyword */
627 #define NO_TBCOL          231  /* couldn't find TBCOLn keyword */
628 #define NO_TFORM          232  /* couldn't find TFORMn keyword */
629 #define NOT_IMAGE         233  /* the CHDU is not an IMAGE extension */
630 #define BAD_TBCOL         234  /* TBCOLn keyword value < 0 or > rowlength */
631 #define NOT_TABLE         235  /* the CHDU is not a table */
632 #define COL_TOO_WIDE      236  /* column is too wide to fit in table */
633 #define COL_NOT_UNIQUE    237  /* more than 1 column name matches template */
634 #define BAD_ROW_WIDTH     241  /* sum of column widths not = NAXIS1 */
635 #define UNKNOWN_EXT       251  /* unrecognizable FITS extension type */
636 #define UNKNOWN_REC       252  /* unrecognizable FITS record */
637 #define END_JUNK          253  /* END keyword is not blank */
638 #define BAD_HEADER_FILL   254  /* Header fill area not blank */
639 #define BAD_DATA_FILL     255  /* Data fill area not blank or zero */
640 #define BAD_TFORM         261  /* illegal TFORM format code */
641 #define BAD_TFORM_DTYPE   262  /* unrecognizable TFORM datatype code */
642 #define BAD_TDIM          263  /* illegal TDIMn keyword value */
643 #define BAD_HEAP_PTR      264  /* invalid BINTABLE heap address */
644 
645 #define BAD_HDU_NUM       301  /* HDU number < 1 or > MAXHDU */
646 #define BAD_COL_NUM       302  /* column number < 1 or > tfields */
647 #define NEG_FILE_POS      304  /* tried to move before beginning of file  */
648 #define NEG_BYTES         306  /* tried to read or write negative bytes */
649 #define BAD_ROW_NUM       307  /* illegal starting row number in table */
650 #define BAD_ELEM_NUM      308  /* illegal starting element number in vector */
651 #define NOT_ASCII_COL     309  /* this is not an ASCII string column */
652 #define NOT_LOGICAL_COL   310  /* this is not a logical datatype column */
653 #define BAD_ATABLE_FORMAT 311  /* ASCII table column has wrong format */
654 #define BAD_BTABLE_FORMAT 312  /* Binary table column has wrong format */
655 #define NO_NULL           314  /* null value has not been defined */
656 #define NOT_VARI_LEN      317  /* this is not a variable length column */
657 #define BAD_DIMEN         320  /* illegal number of dimensions in array */
658 #define BAD_PIX_NUM       321  /* first pixel number greater than last pixel */
659 #define ZERO_SCALE        322  /* illegal BSCALE or TSCALn keyword = 0 */
660 #define NEG_AXIS          323  /* illegal axis length < 1 */
661 
662 #define NOT_GROUP_TABLE         340
663 #define HDU_ALREADY_MEMBER      341
664 #define MEMBER_NOT_FOUND        342
665 #define GROUP_NOT_FOUND         343
666 #define BAD_GROUP_ID            344
667 #define TOO_MANY_HDUS_TRACKED   345
668 #define HDU_ALREADY_TRACKED     346
669 #define BAD_OPTION              347
670 #define IDENTICAL_POINTERS      348
671 #define BAD_GROUP_ATTACH        349
672 #define BAD_GROUP_DETACH        350
673 
674 #define BAD_I2C           401  /* bad int to formatted string conversion */
675 #define BAD_F2C           402  /* bad float to formatted string conversion */
676 #define BAD_INTKEY        403  /* can't interprete keyword value as integer */
677 #define BAD_LOGICALKEY    404  /* can't interprete keyword value as logical */
678 #define BAD_FLOATKEY      405  /* can't interprete keyword value as float */
679 #define BAD_DOUBLEKEY     406  /* can't interprete keyword value as double */
680 #define BAD_C2I           407  /* bad formatted string to int conversion */
681 #define BAD_C2F           408  /* bad formatted string to float conversion */
682 #define BAD_C2D           409  /* bad formatted string to double conversion */
683 #define BAD_DATATYPE      410  /* bad keyword datatype code */
684 #define BAD_DECIM         411  /* bad number of decimal places specified */
685 #define NUM_OVERFLOW      412  /* overflow during datatype conversion */
686 
687 # define DATA_COMPRESSION_ERR 413  /* error in imcompress routines */
688 # define DATA_DECOMPRESSION_ERR 414 /* error in imcompress routines */
689 # define NO_COMPRESSED_TILE  415 /* compressed tile doesn't exist */
690 
691 #define BAD_DATE          420  /* error in date or time conversion */
692 
693 #define PARSE_SYNTAX_ERR  431  /* syntax error in parser expression */
694 #define PARSE_BAD_TYPE    432  /* expression did not evaluate to desired type */
695 #define PARSE_LRG_VECTOR  433  /* vector result too large to return in array */
696 #define PARSE_NO_OUTPUT   434  /* data parser failed not sent an out column */
697 #define PARSE_BAD_COL     435  /* bad data encounter while parsing column */
698 #define PARSE_BAD_OUTPUT  436  /* Output file not of proper type          */
699 
700 #define ANGLE_TOO_BIG     501  /* celestial angle too large for projection */
701 #define BAD_WCS_VAL       502  /* bad celestial coordinate or pixel value */
702 #define WCS_ERROR         503  /* error in celestial coordinate calculation */
703 #define BAD_WCS_PROJ      504  /* unsupported type of celestial projection */
704 #define NO_WCS_KEY        505  /* celestial coordinate keywords not found */
705 #define APPROX_WCS_KEY    506  /* approximate WCS keywords were calculated */
706 
707 #define NO_CLOSE_ERROR    999  /* special value used internally to switch off */
708                                /* the error message from ffclos and ffchdu */
709 
710 /*------- following error codes are used in the grparser.c file -----------*/
711 #define	NGP_ERRBASE		(360)			/* base chosen so not to interfere with CFITSIO */
712 #define	NGP_OK			(0)
713 #define	NGP_NO_MEMORY		(NGP_ERRBASE + 0)	/* malloc failed */
714 #define	NGP_READ_ERR		(NGP_ERRBASE + 1)	/* read error from file */
715 #define	NGP_NUL_PTR		(NGP_ERRBASE + 2)	/* null pointer passed as argument */
716 #define	NGP_EMPTY_CURLINE	(NGP_ERRBASE + 3)	/* line read seems to be empty */
717 #define	NGP_UNREAD_QUEUE_FULL	(NGP_ERRBASE + 4)	/* cannot unread more then 1 line (or single line twice) */
718 #define	NGP_INC_NESTING		(NGP_ERRBASE + 5)	/* too deep include file nesting (inf. loop ?) */
719 #define	NGP_ERR_FOPEN		(NGP_ERRBASE + 6)	/* fopen() failed, cannot open file */
720 #define	NGP_EOF			(NGP_ERRBASE + 7)	/* end of file encountered */
721 #define	NGP_BAD_ARG		(NGP_ERRBASE + 8)	/* bad arguments passed */
722 #define	NGP_TOKEN_NOT_EXPECT	(NGP_ERRBASE + 9)	/* token not expected here */
723 
724 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
725 #ifndef __CINT__
726 /*  the following 3 lines are needed to support C++ compilers */
727 #ifdef __cplusplus
728 extern "C" {
729 #endif
730 #endif
731 
732 int CFITS2Unit( fitsfile *fptr );
733 CFITS_API fitsfile* CUnit2FITS(int unit);
734 
735 /*----------------  FITS file URL parsing routines -------------*/
736 int CFITS_API fits_get_token (char **ptr, char *delimiter, char *token, int *isanumber);
737 int CFITS_API fits_get_token2(char **ptr, char *delimiter, char **token, int *isanumber, int *status);
738 char  CFITS_API *fits_split_names(char *list);
739 int CFITS_API ffiurl(  char *url,  char *urltype, char *infile,
740                     char *outfile, char *extspec, char *rowfilter,
741                     char *binspec, char *colspec, int *status);
742 int CFITS_API ffifile (char *url,  char *urltype, char *infile,
743                     char *outfile, char *extspec, char *rowfilter,
744                     char *binspec, char *colspec, char *pixfilter, int *status);
745 int CFITS_API ffifile2 (char *url,  char *urltype, char *infile,
746                     char *outfile, char *extspec, char *rowfilter,
747                     char *binspec, char *colspec, char *pixfilter, char *compspec, int *status);
748 int CFITS_API ffrtnm(char *url, char *rootname, int *status);
749 int CFITS_API ffexist(const char *infile, int *exists, int *status);
750 int CFITS_API ffexts(char *extspec, int *extnum,  char *extname, int *extvers,
751           int *hdutype, char *colname, char *rowexpress, int *status);
752 int CFITS_API ffextn(char *url, int *extension_num, int *status);
753 int CFITS_API ffurlt(fitsfile *fptr, char *urlType, int *status);
754 int CFITS_API ffbins(char *binspec, int *imagetype, int *haxis,
755                       char colname[4][FLEN_VALUE], double *minin,
756                       double *maxin, double *binsizein,
757                       char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
758                       char binname[4][FLEN_VALUE], double *weight, char *wtname,
759                       int *recip, int *status);
760 int CFITS_API ffbinr(char **binspec, char *colname, double *minin,
761                         double *maxin, double *binsizein, char *minname,
762                         char *maxname, char *binname, int *status);
763 int CFITS_API fits_copy_cell2image(fitsfile *fptr, fitsfile *newptr, char *colname,
764                       long rownum, int *status);
765 int CFITS_API fits_copy_image2cell(fitsfile *fptr, fitsfile *newptr, char *colname,
766                       long rownum, int copykeyflag, int *status);
767 int CFITS_API fits_copy_pixlist2image(fitsfile *infptr, fitsfile *outfptr, int firstkey,       /* I - first HDU record number to start with */
768            int naxis, int *colnum, int *status);
769 int CFITS_API ffimport_file( char *filename, char **contents, int *status );
770 int CFITS_API ffrwrg( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges,
771       long *minrow, long *maxrow, int *status);
772 int CFITS_API ffrwrgll( char *rowlist, LONGLONG maxrows, int maxranges, int *numranges,
773       LONGLONG *minrow, LONGLONG *maxrow, int *status);
774 /*----------------  FITS file I/O routines -------------*/
775 int CFITS_API fits_init_cfitsio(void);
776 int CFITS_API ffomem(fitsfile **fptr, const char *name, int mode, void **buffptr,
777            size_t *buffsize, size_t deltasize,
778            void *(*mem_realloc)(void *p, size_t newsize),
779            int *status);
780 int CFITS_API ffopen(fitsfile **fptr, const char *filename, int iomode, int *status);
781 int CFITS_API ffopentest(int soname, fitsfile **fptr, const char *filename, int iomode, int *status);
782 
783 int CFITS_API ffdopn(fitsfile **fptr, const char *filename, int iomode, int *status);
784 int CFITS_API ffeopn(fitsfile **fptr, const char *filename, int iomode,
785      char *extlist, int *hdutype, int *status);
786 int CFITS_API fftopn(fitsfile **fptr, const char *filename, int iomode, int *status);
787 int CFITS_API ffiopn(fitsfile **fptr, const char *filename, int iomode, int *status);
788 int CFITS_API ffdkopn(fitsfile **fptr, const char *filename, int iomode, int *status);
789 int CFITS_API ffreopen(fitsfile *openfptr, fitsfile **newfptr, int *status);
790 int CFITS_API ffinit(  fitsfile **fptr, const char *filename, int *status);
791 int CFITS_API ffdkinit(fitsfile **fptr, const char *filename, int *status);
792 int CFITS_API ffimem(fitsfile **fptr,  void **buffptr,
793            size_t *buffsize, size_t deltasize,
794            void *(*mem_realloc)(void *p, size_t newsize),
795            int *status);
796 int CFITS_API fftplt(fitsfile **fptr, const char *filename, const char *tempname,
797            int *status);
798 int CFITS_API ffflus(fitsfile *fptr, int *status);
799 int CFITS_API ffflsh(fitsfile *fptr, int clearbuf, int *status);
800 int CFITS_API ffclos(fitsfile *fptr, int *status);
801 int CFITS_API ffdelt(fitsfile *fptr, int *status);
802 int CFITS_API ffflnm(fitsfile *fptr, char *filename, int *status);
803 int CFITS_API ffflmd(fitsfile *fptr, int *filemode, int *status);
804 int CFITS_API fits_delete_iraf_file(const char *filename, int *status);
805 
806 /*---------------- utility routines -------------*/
807 
808 float CFITS_API ffvers(float *version);
809 void CFITS_API ffupch(char *string);
810 void CFITS_API ffgerr(int status, char *errtext);
811 void CFITS_API ffpmsg(const char *err_message);
812 void CFITS_API ffpmrk(void);
813 int  CFITS_API ffgmsg(char *err_message);
814 void CFITS_API ffcmsg(void);
815 void CFITS_API ffcmrk(void);
816 void CFITS_API ffrprt(FILE *stream, int status);
817 void CFITS_API ffcmps(char *templt, char *colname, int  casesen, int *match,
818            int *exact);
819 int CFITS_API fftkey(const char *keyword, int *status);
820 int CFITS_API fftrec(char *card, int *status);
821 int CFITS_API ffnchk(fitsfile *fptr, int *status);
822 int CFITS_API ffkeyn(const char *keyroot, int value, char *keyname, int *status);
823 int CFITS_API ffnkey(int value, const char *keyroot, char *keyname, int *status);
824 int CFITS_API ffgkcl(char *card);
825 int CFITS_API ffdtyp(const char *cval, char *dtype, int *status);
826 int CFITS_API ffinttyp(char *cval, int *datatype, int *negative, int *status);
827 int CFITS_API ffpsvc(char *card, char *value, char *comm, int *status);
828 int CFITS_API ffgknm(char *card, char *name, int *length, int *status);
829 int CFITS_API ffgthd(char *tmplt, char *card, int *hdtype, int *status);
830 int CFITS_API ffmkky(const char *keyname, char *keyval, const char *comm, char *card, int *status);
831 int CFITS_API fits_translate_keyword(char *inrec, char *outrec, char *patterns[][2],
832           int npat, int n_value, int n_offset, int n_range, int *pat_num,
833           int *i, int *j,  int *m, int *n, int *status);
834 int CFITS_API fits_translate_keywords(fitsfile *infptr, fitsfile *outfptr,
835           int firstkey, char *patterns[][2],
836           int npat, int n_value, int n_offset, int n_range, int *status);
837 int CFITS_API ffasfm(char *tform, int *datacode, long *width, int *decim, int *status);
838 int CFITS_API ffbnfm(char *tform, int *datacode, long *repeat, long *width, int *status);
839 int CFITS_API ffbnfmll(char *tform, int *datacode, LONGLONG *repeat, long *width, int *status);
840 int CFITS_API ffgabc(int tfields, char **tform, int space, long *rowlen, long *tbcol,
841            int *status);
842 int CFITS_API fits_get_section_range(char **ptr,long *secmin,long *secmax,long *incre,
843               int *status);
844 /* ffmbyt should not normally be used in application programs, but it is
845    defined here as a publicly available routine because there are a few
846    rare cases where it is needed
847 */
848 int CFITS_API ffmbyt(fitsfile *fptr, LONGLONG bytpos, int ignore_err, int *status);
849 /*----------------- write single keywords --------------*/
850 int CFITS_API ffpky(fitsfile *fptr, int datatype, const char *keyname, void *value,
851           const char *comm, int *status);
852 int CFITS_API ffprec(fitsfile *fptr, const char *card, int *status);
853 int CFITS_API ffpcom(fitsfile *fptr, const char *comm, int *status);
854 int CFITS_API ffpunt(fitsfile *fptr, const char *keyname, const char *unit, int *status);
855 int CFITS_API ffphis(fitsfile *fptr, const char *history, int *status);
856 int CFITS_API ffpdat(fitsfile *fptr, int *status);
857 int CFITS_API ffverifydate(int year, int month, int day, int *status);
858 int CFITS_API ffgstm(char *timestr, int *timeref, int *status);
859 int CFITS_API ffgsdt(int *day, int *month, int *year, int *status);
860 int CFITS_API ffdt2s(int year, int month, int day, char *datestr, int *status);
861 int CFITS_API fftm2s(int year, int month, int day, int hour, int minute, double second,
862           int decimals, char *datestr, int *status);
863 int CFITS_API ffs2dt(char *datestr, int *year, int *month, int *day, int *status);
864 int CFITS_API ffs2tm(char *datestr, int *year, int *month, int *day, int *hour,
865           int *minute, double *second, int *status);
866 int CFITS_API ffpkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
867 int CFITS_API ffpkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
868 int CFITS_API ffpkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
869 int CFITS_API ffplsw(fitsfile *fptr, int *status);
870 int CFITS_API ffpkyl(fitsfile *fptr, const char *keyname, int  value, const char *comm, int *status);
871 int CFITS_API ffpkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
872 int CFITS_API ffpkyuj(fitsfile *fptr, const char *keyname, ULONGLONG value, const char *comm, int *status);
873 int CFITS_API ffpkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
874           int *status);
875 int CFITS_API ffpkye(fitsfile *fptr, const char *keyname, float  value, int decim, const char *comm,
876           int *status);
877 int CFITS_API ffpkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
878           int *status);
879 int CFITS_API ffpkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
880           int *status);
881 int CFITS_API ffpkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
882           int *status);
883 int CFITS_API ffpkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
884           int *status);
885 int CFITS_API ffpkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
886           int *status);
887 int CFITS_API ffpkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
888           int *status);
889 int CFITS_API ffpkyt(fitsfile *fptr, const char *keyname, long intval, double frac, const char *comm,
890           int *status);
891 int CFITS_API ffptdm( fitsfile *fptr, int colnum, int naxis, long naxes[], int *status);
892 int CFITS_API ffptdmll( fitsfile *fptr, int colnum, int naxis, LONGLONG naxes[], int *status);
893 
894 /*----------------- write array of keywords --------------*/
895 int CFITS_API ffpkns(fitsfile *fptr, const char *keyroot, int nstart, int nkey, char *value[],
896            char *comm[], int *status);
897 int CFITS_API ffpknl(fitsfile *fptr, const char *keyroot, int nstart, int nkey, int *value,
898            char *comm[], int *status);
899 int CFITS_API ffpknj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, long *value,
900            char *comm[], int *status);
901 int CFITS_API ffpknjj(fitsfile *fptr, const char *keyroot, int nstart, int nkey, LONGLONG *value,
902            char *comm[], int *status);
903 int CFITS_API ffpknf(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value,
904            int decim, char *comm[], int *status);
905 int CFITS_API ffpkne(fitsfile *fptr, const char *keyroot, int nstart, int nkey, float *value,
906            int decim, char *comm[], int *status);
907 int CFITS_API ffpkng(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value,
908            int decim, char *comm[], int *status);
909 int CFITS_API ffpknd(fitsfile *fptr, const char *keyroot, int nstart, int nkey, double *value,
910            int decim, char *comm[], int *status);
911 int CFITS_API ffcpky(fitsfile *infptr,fitsfile *outfptr,int incol,int outcol,
912            char *rootname, int *status);
913 
914 /*----------------- write required header keywords --------------*/
915 int CFITS_API ffphps( fitsfile *fptr, int bitpix, int naxis, long naxes[], int *status);
916 int CFITS_API ffphpsll( fitsfile *fptr, int bitpix, int naxis, LONGLONG naxes[], int *status);
917 int CFITS_API ffphpr( fitsfile *fptr, int simple, int bitpix, int naxis, long naxes[],
918             LONGLONG pcount, LONGLONG gcount, int extend, int *status);
919 int CFITS_API ffphprll( fitsfile *fptr, int simple, int bitpix, int naxis, LONGLONG naxes[],
920             LONGLONG pcount, LONGLONG gcount, int extend, int *status);
921 int CFITS_API ffphtb(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype,
922           long *tbcol, char **tform, char **tunit, const char *extname, int *status);
923 int CFITS_API ffphbn(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype,
924           char **tform, char **tunit, const char *extname, LONGLONG pcount, int *status);
925 int CFITS_API ffphext( fitsfile *fptr, const char *xtension, int bitpix, int naxis, long naxes[],
926             LONGLONG pcount, LONGLONG gcount, int *status);
927 /*----------------- write template keywords --------------*/
928 int CFITS_API ffpktp(fitsfile *fptr, const char *filename, int *status);
929 
930 /*------------------ get header information --------------*/
931 int CFITS_API ffghsp(fitsfile *fptr, int *nexist, int *nmore, int *status);
932 int CFITS_API ffghps(fitsfile *fptr, int *nexist, int *position, int *status);
933 
934 /*------------------ move position in header -------------*/
935 int CFITS_API ffmaky(fitsfile *fptr, int nrec, int *status);
936 int CFITS_API ffmrky(fitsfile *fptr, int nrec, int *status);
937 
938 /*------------------ read single keywords -----------------*/
939 int CFITS_API ffgnxk(fitsfile *fptr, char **inclist, int ninc, char **exclist,
940            int nexc, char *card, int  *status);
941 int CFITS_API ffgrec(fitsfile *fptr, int nrec,      char *card, int *status);
942 int CFITS_API ffgcrd(fitsfile *fptr, const char *keyname, char *card, int *status);
943 int CFITS_API ffgstr(fitsfile *fptr, const char *string, char *card, int *status);
944 int CFITS_API ffgunt(fitsfile *fptr, const char *keyname, char *unit, int  *status);
945 int CFITS_API ffgkyn(fitsfile *fptr, int nkey, char *keyname, char *keyval, char *comm,
946            int *status);
947 int CFITS_API ffgkey(fitsfile *fptr, const char *keyname, char *keyval, char *comm,
948            int *status);
949 
950 int CFITS_API ffgky( fitsfile *fptr, int datatype, const char *keyname, void *value,
951            char *comm, int *status);
952 int CFITS_API ffgkys(fitsfile *fptr, const char *keyname, char *value, char *comm, int *status);
953 int CFITS_API ffgksl(fitsfile *fptr, const char *keyname, int *length, int *status);
954 int CFITS_API ffgkls(fitsfile *fptr, const char *keyname, char **value, char *comm, int *status);
955 int CFITS_API ffgsky(fitsfile *fptr, const char *keyname, int firstchar, int maxchar,
956                char *value, int *valuelen, char *comm, int *status);
957 int CFITS_API fffree(void *value,  int  *status);
958 int CFITS_API fffkls(char *value, int *status);
959 int CFITS_API ffgkyl(fitsfile *fptr, const char *keyname, int *value, char *comm, int *status);
960 int CFITS_API ffgkyj(fitsfile *fptr, const char *keyname, long *value, char *comm, int *status);
961 int CFITS_API ffgkyjj(fitsfile *fptr, const char *keyname, LONGLONG *value, char *comm, int *status);
962 int CFITS_API ffgkyujj(fitsfile *fptr, const char *keyname, ULONGLONG *value, char *comm, int *status);
963 int CFITS_API ffgkye(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status);
964 int CFITS_API ffgkyd(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status);
965 int CFITS_API ffgkyc(fitsfile *fptr, const char *keyname, float *value, char *comm,int *status);
966 int CFITS_API ffgkym(fitsfile *fptr, const char *keyname, double *value,char *comm,int *status);
967 int CFITS_API ffgkyt(fitsfile *fptr, const char *keyname, long *ivalue, double *dvalue,
968            char *comm, int *status);
969 int CFITS_API ffgtdm(fitsfile *fptr, int colnum, int maxdim, int *naxis, long naxes[],
970            int *status);
971 int CFITS_API ffgtdmll(fitsfile *fptr, int colnum, int maxdim, int *naxis, LONGLONG naxes[],
972            int *status);
973 int CFITS_API ffdtdm(fitsfile *fptr, char *tdimstr, int colnum, int maxdim,
974            int *naxis, long naxes[], int *status);
975 int CFITS_API ffdtdmll(fitsfile *fptr, char *tdimstr, int colnum, int maxdim,
976            int *naxis, LONGLONG naxes[], int *status);
977 
978 /*------------------ read array of keywords -----------------*/
979 int CFITS_API ffgkns(fitsfile *fptr, const char *keyname, int nstart, int nmax, char *value[],
980            int *nfound,  int *status);
981 int CFITS_API ffgknl(fitsfile *fptr, const char *keyname, int nstart, int nmax, int *value,
982            int *nfound, int *status);
983 int CFITS_API ffgknj(fitsfile *fptr, const char *keyname, int nstart, int nmax, long *value,
984            int *nfound, int *status);
985 int CFITS_API ffgknjj(fitsfile *fptr, const char *keyname, int nstart, int nmax, LONGLONG *value,
986            int *nfound, int *status);
987 int CFITS_API ffgkne(fitsfile *fptr, const char *keyname, int nstart, int nmax, float *value,
988            int *nfound, int *status);
989 int CFITS_API ffgknd(fitsfile *fptr, const char *keyname, int nstart, int nmax, double *value,
990            int *nfound, int *status);
991 int CFITS_API ffh2st(fitsfile *fptr, char **header, int  *status);
992 int CFITS_API ffhdr2str( fitsfile *fptr,  int exclude_comm, char **exclist,
993    int nexc, char **header, int *nkeys, int  *status);
994 int CFITS_API ffcnvthdr2str( fitsfile *fptr,  int exclude_comm, char **exclist,
995    int nexc, char **header, int *nkeys, int  *status);
996 
997 /*----------------- read required header keywords --------------*/
998 int CFITS_API ffghpr(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
999           long naxes[], long *pcount, long *gcount, int *extend, int *status);
1000 
1001 int CFITS_API ffghprll(fitsfile *fptr, int maxdim, int *simple, int *bitpix, int *naxis,
1002           LONGLONG naxes[], long *pcount, long *gcount, int *extend, int *status);
1003 
1004 int CFITS_API ffghtb(fitsfile *fptr,int maxfield, long *naxis1, long *naxis2,
1005            int *tfields, char **ttype, long *tbcol, char **tform, char **tunit,
1006            char *extname,  int *status);
1007 
1008 int CFITS_API ffghtbll(fitsfile *fptr,int maxfield, LONGLONG *naxis1, LONGLONG *naxis2,
1009            int *tfields, char **ttype, LONGLONG *tbcol, char **tform, char **tunit,
1010            char *extname,  int *status);
1011 
1012 
1013 int CFITS_API ffghbn(fitsfile *fptr, int maxfield, long *naxis2, int *tfields,
1014            char **ttype, char **tform, char **tunit, char *extname,
1015            long *pcount, int *status);
1016 
1017 int CFITS_API ffghbnll(fitsfile *fptr, int maxfield, LONGLONG *naxis2, int *tfields,
1018            char **ttype, char **tform, char **tunit, char *extname,
1019            LONGLONG *pcount, int *status);
1020 
1021 /*--------------------- update keywords ---------------*/
1022 int CFITS_API ffuky(fitsfile *fptr, int datatype, const char *keyname, void *value,
1023           const char *comm, int *status);
1024 int CFITS_API ffucrd(fitsfile *fptr, const char *keyname, const char *card, int *status);
1025 int CFITS_API ffukyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
1026 int CFITS_API ffukys(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status);
1027 int CFITS_API ffukls(fitsfile *fptr, const char *keyname, const char *value, const char *comm, int *status);
1028 int CFITS_API ffukyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
1029 int CFITS_API ffukyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
1030 int CFITS_API ffukyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1031           int *status);
1032 int CFITS_API ffukye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1033           int *status);
1034 int CFITS_API ffukyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1035           int *status);
1036 int CFITS_API ffukyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1037           int *status);
1038 int CFITS_API ffukyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1039           int *status);
1040 int CFITS_API ffukym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1041           int *status);
1042 int CFITS_API ffukfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1043           int *status);
1044 int CFITS_API ffukfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1045           int *status);
1046 
1047 /*--------------------- modify keywords ---------------*/
1048 int CFITS_API ffmrec(fitsfile *fptr, int nkey, const char *card, int *status);
1049 int CFITS_API ffmcrd(fitsfile *fptr, const char *keyname, const char *card, int *status);
1050 int CFITS_API ffmnam(fitsfile *fptr, const char *oldname, const char *newname, int *status);
1051 int CFITS_API ffmcom(fitsfile *fptr, const char *keyname, const char *comm, int *status);
1052 int CFITS_API ffmkyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
1053 int CFITS_API ffmkys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
1054 int CFITS_API ffmkls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
1055 int CFITS_API ffmkyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
1056 int CFITS_API ffmkyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
1057 int CFITS_API ffmkyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1058           int *status);
1059 int CFITS_API ffmkye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1060           int *status);
1061 int CFITS_API ffmkyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1062           int *status);
1063 int CFITS_API ffmkyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1064           int *status);
1065 int CFITS_API ffmkyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1066           int *status);
1067 int CFITS_API ffmkym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1068           int *status);
1069 int CFITS_API ffmkfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1070           int *status);
1071 int CFITS_API ffmkfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1072           int *status);
1073 
1074 /*--------------------- insert keywords ---------------*/
1075 int CFITS_API ffirec(fitsfile *fptr, int nkey, const char *card, int *status);
1076 int CFITS_API ffikey(fitsfile *fptr, const char *card, int *status);
1077 int CFITS_API ffikyu(fitsfile *fptr, const char *keyname, const char *comm, int *status);
1078 int CFITS_API ffikys(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
1079 int CFITS_API ffikls(fitsfile *fptr, const char *keyname, const char *value, const char *comm,int *status);
1080 int CFITS_API ffikyl(fitsfile *fptr, const char *keyname, int value, const char *comm, int *status);
1081 int CFITS_API ffikyj(fitsfile *fptr, const char *keyname, LONGLONG value, const char *comm, int *status);
1082 int CFITS_API ffikyf(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1083           int *status);
1084 int CFITS_API ffikye(fitsfile *fptr, const char *keyname, float value, int decim, const char *comm,
1085           int *status);
1086 int CFITS_API ffikyg(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1087           int *status);
1088 int CFITS_API ffikyd(fitsfile *fptr, const char *keyname, double value, int decim, const char *comm,
1089           int *status);
1090 int CFITS_API ffikyc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1091           int *status);
1092 int CFITS_API ffikym(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1093           int *status);
1094 int CFITS_API ffikfc(fitsfile *fptr, const char *keyname, float *value, int decim, const char *comm,
1095           int *status);
1096 int CFITS_API ffikfm(fitsfile *fptr, const char *keyname, double *value, int decim, const char *comm,
1097           int *status);
1098 
1099 /*--------------------- delete keywords ---------------*/
1100 int CFITS_API ffdkey(fitsfile *fptr, const char *keyname, int *status);
1101 int CFITS_API ffdstr(fitsfile *fptr, const char *string, int *status);
1102 int CFITS_API ffdrec(fitsfile *fptr, int keypos, int *status);
1103 
1104 /*--------------------- get HDU information -------------*/
1105 int CFITS_API ffghdn(fitsfile *fptr, int *chdunum);
1106 int CFITS_API ffghdt(fitsfile *fptr, int *exttype, int *status);
1107 int CFITS_API ffghad(fitsfile *fptr, long *headstart, long *datastart, long *dataend,
1108            int *status);
1109 int CFITS_API ffghadll(fitsfile *fptr, LONGLONG *headstart, LONGLONG *datastart,
1110            LONGLONG *dataend, int *status);
1111 int CFITS_API ffghof(fitsfile *fptr, OFF_T *headstart, OFF_T *datastart, OFF_T *dataend,
1112            int *status);
1113 int CFITS_API ffgipr(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis,
1114            long *naxes, int *status);
1115 int CFITS_API ffgiprll(fitsfile *fptr, int maxaxis, int *imgtype, int *naxis,
1116            LONGLONG *naxes, int *status);
1117 int CFITS_API ffgidt(fitsfile *fptr, int *imgtype, int *status);
1118 int CFITS_API ffgiet(fitsfile *fptr, int *imgtype, int *status);
1119 int CFITS_API ffgidm(fitsfile *fptr, int *naxis,  int *status);
1120 int CFITS_API ffgisz(fitsfile *fptr, int nlen, long *naxes, int *status);
1121 int CFITS_API ffgiszll(fitsfile *fptr, int nlen, LONGLONG *naxes, int *status);
1122 
1123 /*--------------------- HDU operations -------------*/
1124 int CFITS_API ffmahd(fitsfile *fptr, int hdunum, int *exttype, int *status);
1125 int CFITS_API ffmrhd(fitsfile *fptr, int hdumov, int *exttype, int *status);
1126 int CFITS_API ffmnhd(fitsfile *fptr, int exttype, char *hduname, int hduvers,
1127            int *status);
1128 int CFITS_API ffthdu(fitsfile *fptr, int *nhdu, int *status);
1129 int CFITS_API ffcrhd(fitsfile *fptr, int *status);
1130 int CFITS_API ffcrim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
1131 int CFITS_API ffcrimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
1132 int CFITS_API ffcrtb(fitsfile *fptr, int tbltype, LONGLONG naxis2, int tfields, char **ttype,
1133            char **tform, char **tunit, const char *extname, int *status);
1134 int CFITS_API ffiimg(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
1135 int CFITS_API ffiimgll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
1136 int CFITS_API ffitab(fitsfile *fptr, LONGLONG naxis1, LONGLONG naxis2, int tfields, char **ttype,
1137            long *tbcol, char **tform, char **tunit, const char *extname, int *status);
1138 int CFITS_API ffibin(fitsfile *fptr, LONGLONG naxis2, int tfields, char **ttype, char **tform,
1139            char **tunit, const char *extname, LONGLONG pcount, int *status);
1140 int CFITS_API ffrsim(fitsfile *fptr, int bitpix, int naxis, long *naxes, int *status);
1141 int CFITS_API ffrsimll(fitsfile *fptr, int bitpix, int naxis, LONGLONG *naxes, int *status);
1142 int CFITS_API ffdhdu(fitsfile *fptr, int *hdutype, int *status);
1143 int CFITS_API ffcopy(fitsfile *infptr, fitsfile *outfptr, int morekeys, int *status);
1144 int CFITS_API ffcpfl(fitsfile *infptr, fitsfile *outfptr, int prev, int cur, int follow,
1145             int *status);
1146 int CFITS_API ffcphd(fitsfile *infptr, fitsfile *outfptr, int *status);
1147 int CFITS_API ffcpdt(fitsfile *infptr, fitsfile *outfptr, int *status);
1148 int CFITS_API ffchfl(fitsfile *fptr, int *status);
1149 int CFITS_API ffcdfl(fitsfile *fptr, int *status);
1150 int CFITS_API ffwrhdu(fitsfile *fptr, FILE *outstream, int *status);
1151 
1152 int CFITS_API ffrdef(fitsfile *fptr, int *status);
1153 int CFITS_API ffrhdu(fitsfile *fptr, int *hdutype, int *status);
1154 int CFITS_API ffhdef(fitsfile *fptr, int morekeys, int *status);
1155 int CFITS_API ffpthp(fitsfile *fptr, long theap, int *status);
1156 
1157 int CFITS_API ffcsum(fitsfile *fptr, long nrec, unsigned long *sum, int *status);
1158 void CFITS_API ffesum(unsigned long sum, int complm, char *ascii);
1159 unsigned long CFITS_API ffdsum(char *ascii, int complm, unsigned long *sum);
1160 int CFITS_API ffpcks(fitsfile *fptr, int *status);
1161 int CFITS_API ffupck(fitsfile *fptr, int *status);
1162 int CFITS_API ffvcks(fitsfile *fptr, int *datastatus, int *hdustatus, int *status);
1163 int CFITS_API ffgcks(fitsfile *fptr, unsigned long *datasum, unsigned long *hdusum,
1164     int *status);
1165 
1166 /*--------------------- define scaling or null values -------------*/
1167 int CFITS_API ffpscl(fitsfile *fptr, double scale, double zeroval, int *status);
1168 int CFITS_API ffpnul(fitsfile *fptr, LONGLONG nulvalue, int *status);
1169 int CFITS_API fftscl(fitsfile *fptr, int colnum, double scale, double zeroval, int *status);
1170 int CFITS_API fftnul(fitsfile *fptr, int colnum, LONGLONG nulvalue, int *status);
1171 int CFITS_API ffsnul(fitsfile *fptr, int colnum, char *nulstring, int *status);
1172 
1173 /*--------------------- get column information -------------*/
1174 int CFITS_API ffgcno(fitsfile *fptr, int casesen, char *templt, int  *colnum,
1175            int *status);
1176 int CFITS_API ffgcnn(fitsfile *fptr, int casesen, char *templt, char *colname,
1177            int *colnum, int *status);
1178 
1179 int CFITS_API ffgtcl(fitsfile *fptr, int colnum, int *typecode, long *repeat,
1180            long *width, int *status);
1181 int CFITS_API ffgtclll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat,
1182            LONGLONG *width, int *status);
1183 int CFITS_API ffeqty(fitsfile *fptr, int colnum, int *typecode, long *repeat,
1184            long *width, int *status);
1185 int CFITS_API ffeqtyll(fitsfile *fptr, int colnum, int *typecode, LONGLONG *repeat,
1186            LONGLONG *width, int *status);
1187 int CFITS_API ffgncl(fitsfile *fptr, int  *ncols, int *status);
1188 int CFITS_API ffgnrw(fitsfile *fptr, long *nrows, int *status);
1189 int CFITS_API ffgnrwll(fitsfile *fptr, LONGLONG *nrows, int *status);
1190 int CFITS_API ffgacl(fitsfile *fptr, int colnum, char *ttype, long *tbcol,
1191            char *tunit, char *tform, double *tscal, double *tzero,
1192            char *tnull, char *tdisp, int *status);
1193 int CFITS_API ffgbcl(fitsfile *fptr, int colnum, char *ttype, char *tunit,
1194            char *dtype, long *repeat, double *tscal, double *tzero,
1195            long *tnull, char *tdisp, int  *status);
1196 int CFITS_API ffgbclll(fitsfile *fptr, int colnum, char *ttype, char *tunit,
1197            char *dtype, LONGLONG *repeat, double *tscal, double *tzero,
1198            LONGLONG *tnull, char *tdisp, int  *status);
1199 int CFITS_API ffgrsz(fitsfile *fptr, long *nrows, int *status);
1200 int CFITS_API ffgcdw(fitsfile *fptr, int colnum, int *width, int *status);
1201 
1202 /*--------------------- read primary array or image elements -------------*/
1203 int CFITS_API ffgpxv(fitsfile *fptr, int  datatype, long *firstpix, LONGLONG nelem,
1204           void *nulval, void *array, int *anynul, int *status);
1205 int CFITS_API ffgpxvll(fitsfile *fptr, int  datatype, LONGLONG *firstpix, LONGLONG nelem,
1206           void *nulval, void *array, int *anynul, int *status);
1207 int CFITS_API ffgpxf(fitsfile *fptr, int  datatype, long *firstpix, LONGLONG nelem,
1208            void *array, char *nullarray, int *anynul, int *status);
1209 int CFITS_API ffgpxfll(fitsfile *fptr, int  datatype, LONGLONG *firstpix, LONGLONG nelem,
1210            void *array, char *nullarray, int *anynul, int *status);
1211 int CFITS_API ffgsv(fitsfile *fptr, int datatype, long *blc, long *trc, long *inc,
1212           void *nulval, void *array, int *anynul, int  *status);
1213 
1214 int CFITS_API ffgpv(fitsfile *fptr, int  datatype, LONGLONG firstelem, LONGLONG nelem,
1215           void *nulval, void *array, int *anynul, int  *status);
1216 int CFITS_API ffgpf(fitsfile *fptr, int  datatype, LONGLONG firstelem, LONGLONG nelem,
1217           void *array, char *nullarray, int  *anynul, int  *status);
1218 int CFITS_API ffgpvb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, unsigned
1219            char nulval, unsigned char *array, int *anynul, int *status);
1220 int CFITS_API ffgpvsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem, signed
1221            char nulval, signed char *array, int *anynul, int *status);
1222 int CFITS_API ffgpvui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1223            unsigned short nulval, unsigned short *array, int *anynul,
1224            int *status);
1225 int CFITS_API ffgpvi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1226            short nulval, short *array, int *anynul, int *status);
1227 int CFITS_API ffgpvuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1228            unsigned long nulval, unsigned long *array, int *anynul,
1229            int *status);
1230 int CFITS_API ffgpvj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1231            long nulval, long *array, int *anynul, int *status);
1232 int CFITS_API ffgpvujj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1233            ULONGLONG nulval, ULONGLONG *array, int *anynul, int *status);
1234 int CFITS_API ffgpvjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1235            LONGLONG nulval, LONGLONG *array, int *anynul, int *status);
1236 int CFITS_API ffgpvuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1237            unsigned int nulval, unsigned int *array, int *anynul, int *status);
1238 int CFITS_API ffgpvk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1239            int nulval, int *array, int *anynul, int *status);
1240 int CFITS_API ffgpve(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1241            float nulval, float *array, int *anynul, int *status);
1242 int CFITS_API ffgpvd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1243            double nulval, double *array, int *anynul, int *status);
1244 
1245 int CFITS_API ffgpfb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1246            unsigned char *array, char *nularray, int *anynul, int *status);
1247 int CFITS_API ffgpfsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1248            signed char *array, char *nularray, int *anynul, int *status);
1249 int CFITS_API ffgpfui(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1250            unsigned short *array, char *nularray, int *anynul, int *status);
1251 int CFITS_API ffgpfi(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1252            short *array, char *nularray, int *anynul, int *status);
1253 int CFITS_API ffgpfuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1254            unsigned long *array, char *nularray, int *anynul, int *status);
1255 int CFITS_API ffgpfj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1256            long *array, char *nularray, int *anynul, int *status);
1257 int CFITS_API ffgpfujj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1258            ULONGLONG *array, char *nularray, int *anynul, int *status);
1259 int CFITS_API ffgpfjj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1260            LONGLONG *array, char *nularray, int *anynul, int *status);
1261 int CFITS_API ffgpfuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1262            unsigned int *array, char *nularray, int *anynul, int *status);
1263 int CFITS_API ffgpfk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1264            int *array, char *nularray, int *anynul, int *status);
1265 int CFITS_API ffgpfe(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1266            float *array, char *nularray, int *anynul, int *status);
1267 int CFITS_API ffgpfd(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1268            double *array, char *nularray, int *anynul, int *status);
1269 
1270 int CFITS_API ffg2db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols,
1271            LONGLONG naxis1, LONGLONG naxis2, unsigned char *array,
1272            int *anynul, int *status);
1273 int CFITS_API ffg2dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols,
1274            LONGLONG naxis1, LONGLONG naxis2, signed char *array,
1275            int *anynul, int *status);
1276 int CFITS_API ffg2dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols,
1277            LONGLONG naxis1, LONGLONG naxis2, unsigned short *array,
1278            int *anynul, int *status);
1279 int CFITS_API ffg2di(fitsfile *fptr, long group, short nulval, LONGLONG ncols,
1280            LONGLONG naxis1, LONGLONG naxis2, short *array,
1281            int *anynul, int *status);
1282 int CFITS_API ffg2duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols,
1283            LONGLONG naxis1, LONGLONG naxis2, unsigned long *array,
1284            int *anynul, int *status);
1285 int CFITS_API ffg2dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols,
1286            LONGLONG naxis1, LONGLONG naxis2, long *array,
1287            int *anynul, int *status);
1288 int CFITS_API ffg2dujj(fitsfile *fptr, long group, ULONGLONG nulval, LONGLONG ncols,
1289            LONGLONG naxis1, LONGLONG naxis2, ULONGLONG *array,
1290            int *anynul, int *status);
1291 int CFITS_API ffg2djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols,
1292            LONGLONG naxis1, LONGLONG naxis2, LONGLONG *array,
1293            int *anynul, int *status);
1294 int CFITS_API ffg2duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols,
1295            LONGLONG naxis1, LONGLONG naxis2, unsigned int *array,
1296            int *anynul, int *status);
1297 int CFITS_API ffg2dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols,
1298            LONGLONG naxis1, LONGLONG naxis2, int *array,
1299            int *anynul, int *status);
1300 int CFITS_API ffg2de(fitsfile *fptr, long group, float nulval, LONGLONG ncols,
1301            LONGLONG naxis1, LONGLONG naxis2, float *array,
1302            int *anynul, int *status);
1303 int CFITS_API ffg2dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols,
1304            LONGLONG naxis1, LONGLONG naxis2, double *array,
1305            int *anynul, int *status);
1306 
1307 int CFITS_API ffg3db(fitsfile *fptr, long group, unsigned char nulval, LONGLONG ncols,
1308            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1309            unsigned char *array, int *anynul, int *status);
1310 int CFITS_API ffg3dsb(fitsfile *fptr, long group, signed char nulval, LONGLONG ncols,
1311            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1312            signed char *array, int *anynul, int *status);
1313 int CFITS_API ffg3dui(fitsfile *fptr, long group, unsigned short nulval, LONGLONG ncols,
1314            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1315            unsigned short *array, int *anynul, int *status);
1316 int CFITS_API ffg3di(fitsfile *fptr, long group, short nulval, LONGLONG ncols,
1317            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1318            short *array, int *anynul, int *status);
1319 int CFITS_API ffg3duj(fitsfile *fptr, long group, unsigned long nulval, LONGLONG ncols,
1320            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1321            unsigned long *array, int *anynul, int *status);
1322 int CFITS_API ffg3dj(fitsfile *fptr, long group, long nulval, LONGLONG ncols,
1323            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1324            long *array, int *anynul, int *status);
1325 int CFITS_API ffg3dujj(fitsfile *fptr, long group, ULONGLONG nulval, LONGLONG ncols,
1326            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1327            ULONGLONG *array, int *anynul, int *status);
1328 int CFITS_API ffg3djj(fitsfile *fptr, long group, LONGLONG nulval, LONGLONG ncols,
1329            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1330            LONGLONG *array, int *anynul, int *status);
1331 int CFITS_API ffg3duk(fitsfile *fptr, long group, unsigned int nulval, LONGLONG ncols,
1332            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1333            unsigned int *array, int *anynul, int *status);
1334 int CFITS_API ffg3dk(fitsfile *fptr, long group, int nulval, LONGLONG ncols,
1335            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1336            int *array, int *anynul, int *status);
1337 int CFITS_API ffg3de(fitsfile *fptr, long group, float nulval, LONGLONG ncols,
1338            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1339            float *array, int *anynul, int *status);
1340 int CFITS_API ffg3dd(fitsfile *fptr, long group, double nulval, LONGLONG ncols,
1341            LONGLONG nrows, LONGLONG naxis1, LONGLONG naxis2, LONGLONG naxis3,
1342            double *array, int *anynul, int *status);
1343 
1344 int CFITS_API ffgsvb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1345   long *trc, long *inc, unsigned char nulval, unsigned char *array,
1346   int *anynul, int *status);
1347 int CFITS_API ffgsvsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1348   long *trc, long *inc, signed char nulval, signed char *array,
1349   int *anynul, int *status);
1350 int CFITS_API ffgsvui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1351   long *trc, long *inc, unsigned short nulval, unsigned short *array,
1352   int *anynul, int *status);
1353 int CFITS_API ffgsvi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1354   long *trc, long *inc, short nulval, short *array, int *anynul, int *status);
1355 int CFITS_API ffgsvuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1356   long *trc, long *inc, unsigned long nulval, unsigned long *array,
1357   int *anynul, int *status);
1358 int CFITS_API ffgsvj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1359   long *trc, long *inc, long nulval, long *array, int *anynul, int *status);
1360 int CFITS_API ffgsvujj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1361   long *trc, long *inc, ULONGLONG nulval, ULONGLONG *array, int *anynul,
1362   int *status);
1363 int CFITS_API ffgsvjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1364   long *trc, long *inc, LONGLONG nulval, LONGLONG *array, int *anynul,
1365   int *status);
1366 int CFITS_API ffgsvuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1367   long *trc, long *inc, unsigned int nulval, unsigned int *array,
1368   int *anynul, int *status);
1369 int CFITS_API ffgsvk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1370   long *trc, long *inc, int nulval, int *array, int *anynul, int *status);
1371 int CFITS_API ffgsve(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1372   long *trc, long *inc, float nulval, float *array, int *anynul, int *status);
1373 int CFITS_API ffgsvd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1374   long *trc, long *inc, double nulval, double *array, int *anynul,
1375   int *status);
1376 
1377 int CFITS_API ffgsfb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1378   long *trc, long *inc, unsigned char *array, char *flagval,
1379   int *anynul, int *status);
1380 int CFITS_API ffgsfsb(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1381   long *trc, long *inc, signed char *array, char *flagval,
1382   int *anynul, int *status);
1383 int CFITS_API ffgsfui(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1384   long *trc, long *inc, unsigned short *array, char *flagval, int *anynul,
1385   int *status);
1386 int CFITS_API ffgsfi(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1387   long *trc, long *inc, short *array, char *flagval, int *anynul, int *status);
1388 int CFITS_API ffgsfuj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1389   long  *trc, long *inc, unsigned long *array, char *flagval, int *anynul,
1390   int *status);
1391 int CFITS_API ffgsfj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1392   long  *trc, long *inc, long *array, char *flagval, int *anynul, int *status);
1393 int CFITS_API ffgsfujj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1394   long  *trc, long *inc, ULONGLONG *array, char *flagval, int *anynul,
1395   int *status);
1396 int CFITS_API ffgsfjj(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1397   long  *trc, long *inc, LONGLONG *array, char *flagval, int *anynul,
1398   int *status);
1399 int CFITS_API ffgsfuk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1400   long  *trc, long *inc, unsigned int *array, char *flagval, int *anynul,
1401   int *status);
1402 int CFITS_API ffgsfk(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1403   long  *trc, long *inc, int *array, char *flagval, int *anynul, int *status);
1404 int CFITS_API ffgsfe(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1405   long *trc, long *inc, float *array, char *flagval, int *anynul, int *status);
1406 int CFITS_API ffgsfd(fitsfile *fptr, int colnum, int naxis, long *naxes, long *blc,
1407   long *trc, long *inc, double *array, char *flagval, int *anynul,
1408   int *status);
1409 
1410 int CFITS_API ffggpb(fitsfile *fptr, long group, long firstelem, long nelem,
1411            unsigned char *array, int *status);
1412 int CFITS_API ffggpsb(fitsfile *fptr, long group, long firstelem, long nelem,
1413            signed char *array, int *status);
1414 int CFITS_API ffggpui(fitsfile *fptr, long group, long firstelem, long nelem,
1415            unsigned short *array, int *status);
1416 int CFITS_API ffggpi(fitsfile *fptr, long group, long firstelem, long nelem,
1417            short *array, int *status);
1418 int CFITS_API ffggpuj(fitsfile *fptr, long group, long firstelem, long nelem,
1419            unsigned long *array, int *status);
1420 int CFITS_API ffggpj(fitsfile *fptr, long group, long firstelem, long nelem,
1421            long *array, int *status);
1422 int CFITS_API ffggpujj(fitsfile *fptr, long group, long firstelem, long nelem,
1423            ULONGLONG *array, int *status);
1424 int CFITS_API ffggpjj(fitsfile *fptr, long group, long firstelem, long nelem,
1425            LONGLONG *array, int *status);
1426 int CFITS_API ffggpuk(fitsfile *fptr, long group, long firstelem, long nelem,
1427            unsigned int *array, int *status);
1428 int CFITS_API ffggpk(fitsfile *fptr, long group, long firstelem, long nelem,
1429            int *array, int *status);
1430 int CFITS_API ffggpe(fitsfile *fptr, long group, long firstelem, long nelem,
1431            float *array, int *status);
1432 int CFITS_API ffggpd(fitsfile *fptr, long group, long firstelem, long nelem,
1433            double *array, int *status);
1434 
1435 /*--------------------- read column elements -------------*/
1436 int CFITS_API ffgcv( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
1437            LONGLONG firstelem, LONGLONG nelem, void *nulval, void *array, int *anynul,
1438            int  *status);
1439 int CFITS_API ffgcf( fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
1440            LONGLONG firstelem, LONGLONG nelem, void *array, char *nullarray,
1441            int *anynul, int *status);
1442 int CFITS_API ffgcvs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1443            LONGLONG nelem, char *nulval, char **array, int *anynul, int *status);
1444 int CFITS_API ffgcl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1445            LONGLONG nelem, char *array, int  *status);
1446 int CFITS_API ffgcvl (fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1447            LONGLONG nelem, char nulval, char *array, int *anynul, int  *status);
1448 int CFITS_API ffgcvb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1449            LONGLONG nelem, unsigned char nulval, unsigned char *array,
1450            int *anynul, int *status);
1451 int CFITS_API ffgcvsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1452            LONGLONG nelem, signed char nulval, signed char *array,
1453            int *anynul, int *status);
1454 int CFITS_API ffgcvui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1455            LONGLONG nelem, unsigned short nulval, unsigned short *array,
1456            int *anynul, int *status);
1457 int CFITS_API ffgcvi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1458            LONGLONG nelem, short nulval, short *array, int *anynul, int *status);
1459 int CFITS_API ffgcvuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1460            LONGLONG nelem, unsigned long nulval, unsigned long *array, int *anynul,
1461            int *status);
1462 int CFITS_API ffgcvj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1463            LONGLONG nelem, long nulval, long *array, int *anynul, int *status);
1464 int CFITS_API ffgcvujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1465            LONGLONG nelem, ULONGLONG nulval, ULONGLONG *array, int *anynul,
1466            int *status);
1467 int CFITS_API ffgcvjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1468            LONGLONG nelem, LONGLONG nulval, LONGLONG *array, int *anynul,
1469            int *status);
1470 int CFITS_API ffgcvuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1471            LONGLONG nelem, unsigned int nulval, unsigned int *array, int *anynul,
1472            int *status);
1473 int CFITS_API ffgcvk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1474            LONGLONG nelem, int nulval, int *array, int *anynul, int *status);
1475 int CFITS_API ffgcve(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1476            LONGLONG nelem, float nulval, float *array, int *anynul, int *status);
1477 int CFITS_API ffgcvd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1478          LONGLONG nelem, double nulval, double *array, int *anynul, int *status);
1479 int CFITS_API ffgcvc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1480            LONGLONG nelem, float nulval, float *array, int *anynul, int *status);
1481 int CFITS_API ffgcvm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1482          LONGLONG nelem, double nulval, double *array, int *anynul, int *status);
1483 
1484 int CFITS_API ffgcx(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstbit,
1485             LONGLONG nbits, char *larray, int *status);
1486 int CFITS_API ffgcxui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows,
1487             long firstbit, int nbits, unsigned short *array, int *status);
1488 int CFITS_API ffgcxuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows,
1489             long firstbit, int nbits, unsigned int *array, int *status);
1490 
1491 int CFITS_API ffgcfs(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1492       LONGLONG nelem, char **array, char *nularray, int *anynul, int *status);
1493 int CFITS_API ffgcfl(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1494       LONGLONG nelem, char *array, char *nularray, int *anynul, int *status);
1495 int CFITS_API ffgcfb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1496       LONGLONG nelem, unsigned char *array, char *nularray, int *anynul, int *status);
1497 int CFITS_API ffgcfsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1498       LONGLONG nelem, signed char *array, char *nularray, int *anynul, int *status);
1499 int CFITS_API ffgcfui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1500       LONGLONG nelem, unsigned short *array, char *nularray, int *anynul,
1501       int *status);
1502 int CFITS_API ffgcfi(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1503       LONGLONG nelem, short *array, char *nularray, int *anynul, int *status);
1504 int CFITS_API ffgcfuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1505       LONGLONG nelem, unsigned long *array, char *nularray, int *anynul,
1506       int *status);
1507 int CFITS_API ffgcfj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1508       LONGLONG nelem, long *array, char *nularray, int *anynul, int *status);
1509 int CFITS_API ffgcfujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1510       LONGLONG nelem, ULONGLONG *array, char *nularray, int *anynul, int *status);
1511 int CFITS_API ffgcfjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1512       LONGLONG nelem, LONGLONG *array, char *nularray, int *anynul, int *status);
1513 int CFITS_API ffgcfuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1514       LONGLONG nelem, unsigned int *array, char *nularray, int *anynul,
1515       int *status);
1516 int CFITS_API ffgcfk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1517       LONGLONG nelem, int *array, char *nularray, int *anynul, int *status);
1518 int CFITS_API ffgcfe(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1519       LONGLONG nelem, float *array, char *nularray, int *anynul, int *status);
1520 int CFITS_API ffgcfd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1521       LONGLONG nelem, double *array, char *nularray, int *anynul, int *status);
1522 int CFITS_API ffgcfc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1523       LONGLONG nelem, float *array, char *nularray, int *anynul, int *status);
1524 int CFITS_API ffgcfm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1525       LONGLONG nelem, double *array, char *nularray, int *anynul, int *status);
1526 
1527 int CFITS_API ffgdes(fitsfile *fptr, int colnum, LONGLONG rownum, long *length,
1528            long *heapaddr, int *status);
1529 int CFITS_API ffgdesll(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG *length,
1530            LONGLONG *heapaddr, int *status);
1531 int CFITS_API ffgdess(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, long *length,
1532            long *heapaddr, int *status);
1533 int CFITS_API ffgdessll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG nrows, LONGLONG *length,
1534            LONGLONG *heapaddr, int *status);
1535 int CFITS_API ffpdes(fitsfile *fptr, int colnum, LONGLONG rownum, LONGLONG length,
1536            LONGLONG heapaddr, int *status);
1537 int CFITS_API fftheap(fitsfile *fptr, LONGLONG *heapsize, LONGLONG *unused, LONGLONG *overlap,
1538             int *valid, int *status);
1539 int CFITS_API ffcmph(fitsfile *fptr, int *status);
1540 
1541 int CFITS_API ffgtbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars,
1542            unsigned char *values, int *status);
1543 
1544 int CFITS_API ffgextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status);
1545 int CFITS_API ffpextn(fitsfile *fptr, LONGLONG offset, LONGLONG nelem, void *array, int *status);
1546 
1547 /*------------ write primary array or image elements -------------*/
1548 int CFITS_API ffppx(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
1549           void *array, int *status);
1550 int CFITS_API ffppxll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
1551           void *array, int *status);
1552 int CFITS_API ffppxn(fitsfile *fptr, int datatype, long *firstpix, LONGLONG nelem,
1553           void *array, void *nulval, int *status);
1554 int CFITS_API ffppxnll(fitsfile *fptr, int datatype, LONGLONG *firstpix, LONGLONG nelem,
1555           void *array, void *nulval, int *status);
1556 int CFITS_API ffppr(fitsfile *fptr, int datatype, LONGLONG  firstelem,
1557            LONGLONG nelem, void *array, int *status);
1558 int CFITS_API ffpprb(fitsfile *fptr, long group, LONGLONG firstelem,
1559            LONGLONG nelem, unsigned char *array, int *status);
1560 int CFITS_API ffpprsb(fitsfile *fptr, long group, LONGLONG firstelem,
1561            LONGLONG nelem, signed char *array, int *status);
1562 int CFITS_API ffpprui(fitsfile *fptr, long group, LONGLONG firstelem,
1563            LONGLONG nelem, unsigned short *array, int *status);
1564 int CFITS_API ffppri(fitsfile *fptr, long group, LONGLONG firstelem,
1565            LONGLONG nelem, short *array, int *status);
1566 int CFITS_API ffppruj(fitsfile *fptr, long group, LONGLONG firstelem,
1567            LONGLONG nelem, unsigned long *array, int *status);
1568 int CFITS_API ffpprj(fitsfile *fptr, long group, LONGLONG firstelem,
1569            LONGLONG nelem, long *array, int *status);
1570 int CFITS_API ffppruk(fitsfile *fptr, long group, LONGLONG firstelem,
1571            LONGLONG nelem, unsigned int *array, int *status);
1572 int CFITS_API ffpprk(fitsfile *fptr, long group, LONGLONG firstelem,
1573            LONGLONG nelem, int *array, int *status);
1574 int CFITS_API ffppre(fitsfile *fptr, long group, LONGLONG firstelem,
1575            LONGLONG nelem, float *array, int *status);
1576 int CFITS_API ffpprd(fitsfile *fptr, long group, LONGLONG firstelem,
1577            LONGLONG nelem, double *array, int *status);
1578 int CFITS_API ffpprjj(fitsfile *fptr, long group, LONGLONG firstelem,
1579            LONGLONG nelem, LONGLONG *array, int *status);
1580 int CFITS_API ffpprujj(fitsfile *fptr, long group, LONGLONG firstelem,
1581            LONGLONG nelem, ULONGLONG *array, int *status);
1582 
1583 int CFITS_API ffppru(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1584            int *status);
1585 int CFITS_API ffpprn(fitsfile *fptr, LONGLONG firstelem, LONGLONG nelem, int *status);
1586 
1587 int CFITS_API ffppn(fitsfile *fptr, int datatype, LONGLONG  firstelem, LONGLONG nelem,
1588           void  *array, void *nulval, int  *status);
1589 int CFITS_API ffppnb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1590            unsigned char *array, unsigned char nulval, int *status);
1591 int CFITS_API ffppnsb(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1592            signed char *array, signed char nulval, int *status);
1593 int CFITS_API ffppnui(fitsfile *fptr, long group, LONGLONG firstelem,
1594            LONGLONG nelem, unsigned short *array, unsigned short nulval,
1595            int *status);
1596 int CFITS_API ffppni(fitsfile *fptr, long group, LONGLONG firstelem,
1597            LONGLONG nelem, short *array, short nulval, int *status);
1598 int CFITS_API ffppnj(fitsfile *fptr, long group, LONGLONG firstelem,
1599            LONGLONG nelem, long *array, long nulval, int *status);
1600 int CFITS_API ffppnuj(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1601            unsigned long *array, unsigned long nulval, int *status);
1602 int CFITS_API ffppnuk(fitsfile *fptr, long group, LONGLONG firstelem, LONGLONG nelem,
1603            unsigned int *array, unsigned int nulval, int *status);
1604 int CFITS_API ffppnk(fitsfile *fptr, long group, LONGLONG firstelem,
1605            LONGLONG nelem, int *array, int nulval, int *status);
1606 int CFITS_API ffppne(fitsfile *fptr, long group, LONGLONG firstelem,
1607            LONGLONG nelem, float *array, float nulval, int *status);
1608 int CFITS_API ffppnd(fitsfile *fptr, long group, LONGLONG firstelem,
1609            LONGLONG nelem, double *array, double nulval, int *status);
1610 int CFITS_API ffppnjj(fitsfile *fptr, long group, LONGLONG firstelem,
1611            LONGLONG nelem, LONGLONG *array, LONGLONG nulval, int *status);
1612 int CFITS_API ffppnujj(fitsfile *fptr, long group, LONGLONG firstelem,
1613            LONGLONG nelem, ULONGLONG *array, ULONGLONG nulval, int *status);
1614 
1615 int CFITS_API ffp2db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1616            LONGLONG naxis2, unsigned char *array, int *status);
1617 int CFITS_API ffp2dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1618            LONGLONG naxis2, signed char *array, int *status);
1619 int CFITS_API ffp2dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1620            LONGLONG naxis2, unsigned short *array, int *status);
1621 int CFITS_API ffp2di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1622            LONGLONG naxis2, short *array, int *status);
1623 int CFITS_API ffp2duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1624            LONGLONG naxis2, unsigned long *array, int *status);
1625 int CFITS_API ffp2dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1626            LONGLONG naxis2, long *array, int *status);
1627 int CFITS_API ffp2duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1628            LONGLONG naxis2, unsigned int *array, int *status);
1629 int CFITS_API ffp2dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1630            LONGLONG naxis2, int *array, int *status);
1631 int CFITS_API ffp2de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1632            LONGLONG naxis2, float *array, int *status);
1633 int CFITS_API ffp2dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1634            LONGLONG naxis2, double *array, int *status);
1635 int CFITS_API ffp2djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1636            LONGLONG naxis2, LONGLONG *array, int *status);
1637 int CFITS_API ffp2dujj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG naxis1,
1638            LONGLONG naxis2, ULONGLONG *array, int *status);
1639 
1640 int CFITS_API ffp3db(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1641            LONGLONG naxis2, LONGLONG naxis3, unsigned char *array, int *status);
1642 int CFITS_API ffp3dsb(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1643            LONGLONG naxis2, LONGLONG naxis3, signed char *array, int *status);
1644 int CFITS_API ffp3dui(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1645            LONGLONG naxis2, LONGLONG naxis3, unsigned short *array, int *status);
1646 int CFITS_API ffp3di(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1647            LONGLONG naxis2, LONGLONG naxis3, short *array, int *status);
1648 int CFITS_API ffp3duj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1649            LONGLONG naxis2, LONGLONG naxis3, unsigned long *array, int *status);
1650 int CFITS_API ffp3dj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1651            LONGLONG naxis2, LONGLONG naxis3, long *array, int *status);
1652 int CFITS_API ffp3duk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1653            LONGLONG naxis2, LONGLONG naxis3, unsigned int *array, int *status);
1654 int CFITS_API ffp3dk(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1655            LONGLONG naxis2, LONGLONG naxis3, int *array, int *status);
1656 int CFITS_API ffp3de(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1657            LONGLONG naxis2, LONGLONG naxis3, float *array, int *status);
1658 int CFITS_API ffp3dd(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1659            LONGLONG naxis2, LONGLONG naxis3, double *array, int *status);
1660 int CFITS_API ffp3djj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1661            LONGLONG naxis2, LONGLONG naxis3, LONGLONG *array, int *status);
1662 int CFITS_API ffp3dujj(fitsfile *fptr, long group, LONGLONG ncols, LONGLONG nrows, LONGLONG naxis1,
1663            LONGLONG naxis2, LONGLONG naxis3, ULONGLONG *array, int *status);
1664 
1665 int CFITS_API ffpss(fitsfile *fptr, int datatype,
1666            long *fpixel, long *lpixel, void *array, int *status);
1667 int CFITS_API ffpssb(fitsfile *fptr, long group, long naxis, long *naxes,
1668            long *fpixel, long *lpixel, unsigned char *array, int *status);
1669 int CFITS_API ffpsssb(fitsfile *fptr, long group, long naxis, long *naxes,
1670            long *fpixel, long *lpixel, signed char *array, int *status);
1671 int CFITS_API ffpssui(fitsfile *fptr, long group, long naxis, long *naxes,
1672            long *fpixel, long *lpixel, unsigned short *array, int *status);
1673 int CFITS_API ffpssi(fitsfile *fptr, long group, long naxis, long *naxes,
1674            long *fpixel, long *lpixel, short *array, int *status);
1675 int CFITS_API ffpssuj(fitsfile *fptr, long group, long naxis, long *naxes,
1676            long *fpixel, long *lpixel, unsigned long *array, int *status);
1677 int CFITS_API ffpssj(fitsfile *fptr, long group, long naxis, long *naxes,
1678            long *fpixel, long *lpixel, long *array, int *status);
1679 int CFITS_API ffpssuk(fitsfile *fptr, long group, long naxis, long *naxes,
1680            long *fpixel, long *lpixel, unsigned int *array, int *status);
1681 int CFITS_API ffpssk(fitsfile *fptr, long group, long naxis, long *naxes,
1682            long *fpixel, long *lpixel, int *array, int *status);
1683 int CFITS_API ffpsse(fitsfile *fptr, long group, long naxis, long *naxes,
1684            long *fpixel, long *lpixel, float *array, int *status);
1685 int CFITS_API ffpssd(fitsfile *fptr, long group, long naxis, long *naxes,
1686            long *fpixel, long *lpixel, double *array, int *status);
1687 int CFITS_API ffpssjj(fitsfile *fptr, long group, long naxis, long *naxes,
1688            long *fpixel, long *lpixel, LONGLONG *array, int *status);
1689 int CFITS_API ffpssujj(fitsfile *fptr, long group, long naxis, long *naxes,
1690            long *fpixel, long *lpixel, ULONGLONG *array, int *status);
1691 
1692 int CFITS_API ffpgpb(fitsfile *fptr, long group, long firstelem,
1693            long nelem, unsigned char *array, int *status);
1694 int CFITS_API ffpgpsb(fitsfile *fptr, long group, long firstelem,
1695            long nelem, signed char *array, int *status);
1696 int CFITS_API ffpgpui(fitsfile *fptr, long group, long firstelem,
1697            long nelem, unsigned short *array, int *status);
1698 int CFITS_API ffpgpi(fitsfile *fptr, long group, long firstelem,
1699            long nelem, short *array, int *status);
1700 int CFITS_API ffpgpuj(fitsfile *fptr, long group, long firstelem,
1701            long nelem, unsigned long *array, int *status);
1702 int CFITS_API ffpgpj(fitsfile *fptr, long group, long firstelem,
1703            long nelem, long *array, int *status);
1704 int CFITS_API ffpgpuk(fitsfile *fptr, long group, long firstelem,
1705            long nelem, unsigned int *array, int *status);
1706 int CFITS_API ffpgpk(fitsfile *fptr, long group, long firstelem,
1707            long nelem, int *array, int *status);
1708 int CFITS_API ffpgpe(fitsfile *fptr, long group, long firstelem,
1709            long nelem, float *array, int *status);
1710 int CFITS_API ffpgpd(fitsfile *fptr, long group, long firstelem,
1711            long nelem, double *array, int *status);
1712 int CFITS_API ffpgpjj(fitsfile *fptr, long group, long firstelem,
1713            long nelem, LONGLONG *array, int *status);
1714 int CFITS_API ffpgpujj(fitsfile *fptr, long group, long firstelem,
1715            long nelem, ULONGLONG *array, int *status);
1716 
1717 /*--------------------- iterator functions -------------*/
1718 int CFITS_API fits_iter_set_by_name(iteratorCol *col, fitsfile *fptr, char *colname,
1719           int datatype,  int iotype);
1720 int CFITS_API fits_iter_set_by_num(iteratorCol *col, fitsfile *fptr, int colnum,
1721           int datatype,  int iotype);
1722 int CFITS_API fits_iter_set_file(iteratorCol *col, fitsfile *fptr);
1723 int CFITS_API fits_iter_set_colname(iteratorCol *col, char *colname);
1724 int CFITS_API fits_iter_set_colnum(iteratorCol *col, int colnum);
1725 int CFITS_API fits_iter_set_datatype(iteratorCol *col, int datatype);
1726 int CFITS_API fits_iter_set_iotype(iteratorCol *col, int iotype);
1727 
1728 CFITS_API fitsfile * fits_iter_get_file(iteratorCol *col);
1729 char CFITS_API * fits_iter_get_colname(iteratorCol *col);
1730 int CFITS_API fits_iter_get_colnum(iteratorCol *col);
1731 int CFITS_API fits_iter_get_datatype(iteratorCol *col);
1732 int CFITS_API fits_iter_get_iotype(iteratorCol *col);
1733 void CFITS_API *fits_iter_get_array(iteratorCol *col);
1734 long CFITS_API fits_iter_get_tlmin(iteratorCol *col);
1735 long CFITS_API fits_iter_get_tlmax(iteratorCol *col);
1736 long CFITS_API fits_iter_get_repeat(iteratorCol *col);
1737 char CFITS_API *fits_iter_get_tunit(iteratorCol *col);
1738 char CFITS_API *fits_iter_get_tdisp(iteratorCol *col);
1739 
1740 int CFITS_API ffiter(int ncols,  iteratorCol *data, long offset, long nPerLoop,
1741            int (*workFn)( long totaln, long offset, long firstn,
1742              long nvalues, int narrays, iteratorCol *data, void *userPointer),
1743            void *userPointer, int *status);
1744 
1745 /*--------------------- write column elements -------------*/
1746 int CFITS_API ffpcl(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow,
1747           LONGLONG firstelem, LONGLONG nelem, void *array, int *status);
1748 int CFITS_API ffpcls(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1749            LONGLONG nelem, char **array, int *status);
1750 int CFITS_API ffpcll(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1751            LONGLONG nelem, char *array, int *status);
1752 int CFITS_API ffpclb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1753            LONGLONG nelem, unsigned char *array, int *status);
1754 int CFITS_API ffpclsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1755            LONGLONG nelem, signed char *array, int *status);
1756 int CFITS_API ffpclui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1757            LONGLONG nelem, unsigned short *array, int *status);
1758 int CFITS_API ffpcli(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1759            LONGLONG nelem, short *array, int *status);
1760 int CFITS_API ffpcluj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1761            LONGLONG nelem, unsigned long *array, int *status);
1762 int CFITS_API ffpclj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1763            LONGLONG nelem, long *array, int *status);
1764 int CFITS_API ffpcluk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1765            LONGLONG nelem, unsigned int *array, int *status);
1766 int CFITS_API ffpclk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1767            LONGLONG nelem, int *array, int *status);
1768 int CFITS_API ffpcle(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1769            LONGLONG nelem, float *array, int *status);
1770 int CFITS_API ffpcld(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1771            LONGLONG nelem, double *array, int *status);
1772 int CFITS_API ffpclc(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1773            LONGLONG nelem, float *array, int *status);
1774 int CFITS_API ffpclm(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1775            LONGLONG nelem, double *array, int *status);
1776 int CFITS_API ffpclu(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1777            LONGLONG nelem, int *status);
1778 int CFITS_API ffprwu(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
1779 int CFITS_API ffpcljj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1780            LONGLONG nelem, LONGLONG *array, int *status);
1781 int CFITS_API ffpclujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1782            LONGLONG nelem, ULONGLONG *array, int *status);
1783 int CFITS_API ffpclx(fitsfile *fptr, int colnum, LONGLONG frow, long fbit, long nbit,
1784             char *larray, int *status);
1785 
1786 int CFITS_API ffpcn(fitsfile *fptr, int datatype, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1787           LONGLONG nelem, void *array, void *nulval, int *status);
1788 int CFITS_API ffpcns( fitsfile *fptr, int  colnum, LONGLONG  firstrow, LONGLONG  firstelem,
1789             LONGLONG  nelem, char **array, char  *nulvalue, int  *status);
1790 int CFITS_API ffpcnl( fitsfile *fptr, int  colnum, LONGLONG  firstrow, LONGLONG  firstelem,
1791             LONGLONG  nelem, char *array, char  nulvalue,  int  *status);
1792 int CFITS_API ffpcnb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1793            LONGLONG nelem, unsigned char *array, unsigned char nulvalue,
1794            int *status);
1795 int CFITS_API ffpcnsb(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1796            LONGLONG nelem, signed char *array, signed char nulvalue,
1797            int *status);
1798 int CFITS_API ffpcnui(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1799            LONGLONG nelem, unsigned short *array, unsigned short nulvalue,
1800            int *status);
1801 int CFITS_API ffpcni(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1802            LONGLONG nelem, short *array, short nulvalue, int *status);
1803 int CFITS_API ffpcnuj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1804            LONGLONG nelem, unsigned long *array, unsigned long nulvalue,
1805            int *status);
1806 int CFITS_API ffpcnj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1807            LONGLONG nelem, long *array, long nulvalue, int *status);
1808 int CFITS_API ffpcnuk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1809            LONGLONG nelem, unsigned int *array, unsigned int nulvalue,
1810            int *status);
1811 int CFITS_API ffpcnk(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1812            LONGLONG nelem, int *array, int nulvalue, int *status);
1813 int CFITS_API ffpcne(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1814            LONGLONG nelem, float *array, float nulvalue, int *status);
1815 int CFITS_API ffpcnd(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1816            LONGLONG nelem, double *array, double nulvalue, int *status);
1817 int CFITS_API ffpcnjj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1818            LONGLONG nelem, LONGLONG *array, LONGLONG nulvalue, int *status);
1819 int CFITS_API ffpcnujj(fitsfile *fptr, int colnum, LONGLONG firstrow, LONGLONG firstelem,
1820            LONGLONG nelem, ULONGLONG *array, ULONGLONG nulvalue, int *status);
1821 int CFITS_API ffptbb(fitsfile *fptr, LONGLONG firstrow, LONGLONG firstchar, LONGLONG nchars,
1822            unsigned char *values, int *status);
1823 
1824 int CFITS_API ffirow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
1825 int CFITS_API ffdrow(fitsfile *fptr, LONGLONG firstrow, LONGLONG nrows, int *status);
1826 int CFITS_API ffdrrg(fitsfile *fptr, char *ranges, int *status);
1827 int CFITS_API ffdrws(fitsfile *fptr, long *rownum,  long nrows, int *status);
1828 int CFITS_API ffdrwsll(fitsfile *fptr, LONGLONG *rownum,  LONGLONG nrows, int *status);
1829 int CFITS_API fficol(fitsfile *fptr, int numcol, char *ttype, char *tform, int *status);
1830 int CFITS_API fficls(fitsfile *fptr, int firstcol, int ncols, char **ttype,
1831            char **tform, int *status);
1832 int CFITS_API ffmvec(fitsfile *fptr, int colnum, LONGLONG newveclen, int *status);
1833 int CFITS_API ffdcol(fitsfile *fptr, int numcol, int *status);
1834 int CFITS_API ffcpcl(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol,
1835            int create_col, int *status);
1836 int CFITS_API ffccls(fitsfile *infptr, fitsfile *outfptr, int incol, int outcol,
1837        int ncols, int create_col, int *status);
1838 int CFITS_API ffcprw(fitsfile *infptr, fitsfile *outfptr, LONGLONG firstrow,
1839            LONGLONG nrows, int *status);
1840 
1841 /*--------------------- WCS Utilities ------------------*/
1842 int CFITS_API ffgics(fitsfile *fptr, double *xrval, double *yrval, double *xrpix,
1843            double *yrpix, double *xinc, double *yinc, double *rot,
1844            char *type, int *status);
1845 int CFITS_API ffgicsa(fitsfile *fptr, char version, double *xrval, double *yrval, double *xrpix,
1846            double *yrpix, double *xinc, double *yinc, double *rot,
1847            char *type, int *status);
1848 int CFITS_API ffgtcs(fitsfile *fptr, int xcol, int ycol, double *xrval,
1849            double *yrval, double *xrpix, double *yrpix, double *xinc,
1850            double *yinc, double *rot, char *type, int *status);
1851 int CFITS_API ffwldp(double xpix, double ypix, double xref, double yref,
1852            double xrefpix, double yrefpix, double xinc, double yinc,
1853            double rot, char *type, double *xpos, double *ypos, int *status);
1854 int CFITS_API ffxypx(double xpos, double ypos, double xref, double yref,
1855            double xrefpix, double yrefpix, double xinc, double yinc,
1856            double rot, char *type, double *xpix, double *ypix, int *status);
1857 
1858 /*   WCS support routines (provide interface to Doug Mink's WCS library */
1859 int CFITS_API ffgiwcs(fitsfile *fptr,  char **header, int *status);
1860 int CFITS_API ffgtwcs(fitsfile *fptr, int xcol, int ycol, char **header, int *status);
1861 
1862 /*--------------------- lexical parsing routines ------------------*/
1863 int CFITS_API fftexp( fitsfile *fptr, char *expr, int maxdim,
1864         int *datatype, long *nelem, int *naxis,
1865         long *naxes, int *status );
1866 
1867 int CFITS_API fffrow( fitsfile *infptr, char *expr,
1868         long firstrow, long nrows,
1869             long *n_good_rows, char *row_status, int *status);
1870 
1871 int CFITS_API ffffrw( fitsfile *fptr, char *expr, long *rownum, int *status);
1872 
1873 int CFITS_API fffrwc( fitsfile *fptr, char *expr, char *timeCol,
1874             char *parCol, char *valCol, long ntimes,
1875             double *times, char *time_status, int  *status );
1876 
1877 int CFITS_API ffsrow( fitsfile *infptr, fitsfile *outfptr, char *expr,
1878             int *status);
1879 
1880 int CFITS_API ffcrow( fitsfile *fptr, int datatype, char *expr,
1881         long firstrow, long nelements, void *nulval,
1882         void *array, int *anynul, int *status );
1883 
1884 int CFITS_API ffcalc_rng( fitsfile *infptr, char *expr, fitsfile *outfptr,
1885                char *parName, char *parInfo, int nRngs,
1886                  long *start, long *end, int *status );
1887 
1888 int CFITS_API ffcalc( fitsfile *infptr, char *expr, fitsfile *outfptr,
1889             char *parName, char *parInfo, int *status );
1890 
1891   /* ffhist is not really intended as a user-callable routine */
1892   /* but it may be useful for some specialized applications   */
1893   /* ffhist2 is a newer version which is strongly recommended instead of ffhist */
1894 
1895 int CFITS_API ffhist(fitsfile **fptr, char *outfile, int imagetype, int naxis,
1896            char colname[4][FLEN_VALUE],
1897            double *minin, double *maxin, double *binsizein,
1898            char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
1899            char binname[4][FLEN_VALUE],
1900            double weightin, char wtcol[FLEN_VALUE],
1901            int recip, char *rowselect, int *status);
1902 int CFITS_API ffhist2(fitsfile **fptr, char *outfile, int imagetype, int naxis,
1903            char colname[4][FLEN_VALUE],
1904            double *minin, double *maxin, double *binsizein,
1905            char minname[4][FLEN_VALUE], char maxname[4][FLEN_VALUE],
1906            char binname[4][FLEN_VALUE],
1907            double weightin, char wtcol[FLEN_VALUE],
1908            int recip, char *rowselect, int *status);
1909 CFITS_API fitsfile *ffhist3(fitsfile *fptr,
1910            char *outfile, int imagetype,  int naxis,
1911            char colname[4][FLEN_VALUE],
1912            double *minin,
1913            double *maxin,
1914            double *binsizein,
1915            char minname[4][FLEN_VALUE],
1916            char maxname[4][FLEN_VALUE],
1917            char binname[4][FLEN_VALUE],
1918            double weightin,
1919            char wtcol[FLEN_VALUE],
1920            int recip,
1921            char *selectrow,
1922            int *status);
1923 int CFITS_API fits_select_image_section(fitsfile **fptr, char *outfile,
1924            char *imagesection, int *status);
1925 int CFITS_API fits_copy_image_section(fitsfile *infptr, fitsfile *outfile,
1926            char *imagesection, int *status);
1927 
1928 int CFITS_API fits_calc_binning(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE],
1929     double *minin, double *maxin,  double *binsizein,
1930     char minname[4][FLEN_VALUE],  char maxname[4][FLEN_VALUE],
1931     char binname[4][FLEN_VALUE],  int *colnum,  long *haxes,
1932     float *amin, float *amax, float *binsize,  int *status);
1933 int CFITS_API fits_calc_binningd(fitsfile *fptr, int naxis, char colname[4][FLEN_VALUE],
1934     double *minin, double *maxin,  double *binsizein,
1935     char minname[4][FLEN_VALUE],  char maxname[4][FLEN_VALUE],
1936     char binname[4][FLEN_VALUE],  int *colnum,  long *haxes,
1937     double *amin, double *amax, double *binsize,  int *status);
1938 
1939 int CFITS_API fits_write_keys_histo(fitsfile *fptr,  fitsfile *histptr,
1940       int naxis, int *colnum, int *status);
1941 int CFITS_API fits_rebin_wcs( fitsfile *fptr, int naxis, float *amin,  float *binsize,
1942       int *status);
1943 int CFITS_API fits_rebin_wcsd( fitsfile *fptr, int naxis, double *amin,  double *binsize,
1944       int *status);
1945 int CFITS_API fits_make_hist(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis,
1946      long *naxes,  int *colnum,  float *amin,  float *amax, float *binsize,
1947      float weight, int wtcolnum, int recip, char *selectrow, int *status);
1948 int CFITS_API fits_make_histd(fitsfile *fptr, fitsfile *histptr, int bitpix,int naxis,
1949      long *naxes,  int *colnum,  double *amin,  double *amax, double *binsize,
1950      double weight, int wtcolnum, int recip, char *selectrow, int *status);
1951 
1952 typedef struct
1953 {
1954     /* input(s) */
1955     int count;
1956     char ** path;
1957     char ** tag;
1958     fitsfile ** ifptr;
1959 
1960     char * expression;
1961 
1962     /* output control */
1963     int bitpix;
1964     long blank;
1965     fitsfile * ofptr;
1966     char keyword[FLEN_KEYWORD];
1967     char comment[FLEN_COMMENT];
1968 } PixelFilter;
1969 
1970 
1971 int CFITS_API fits_pixel_filter (PixelFilter * filter, int * status);
1972 
1973 
1974 /*--------------------- grouping routines ------------------*/
1975 
1976 int CFITS_API ffgtcr(fitsfile *fptr, char *grpname, int grouptype, int *status);
1977 int CFITS_API ffgtis(fitsfile *fptr, char *grpname, int grouptype, int *status);
1978 int CFITS_API ffgtch(fitsfile *gfptr, int grouptype, int *status);
1979 int CFITS_API ffgtrm(fitsfile *gfptr, int rmopt, int *status);
1980 int CFITS_API ffgtcp(fitsfile *infptr, fitsfile *outfptr, int cpopt, int *status);
1981 int CFITS_API ffgtmg(fitsfile *infptr, fitsfile *outfptr, int mgopt, int *status);
1982 int CFITS_API ffgtcm(fitsfile *gfptr, int cmopt, int *status);
1983 int CFITS_API ffgtvf(fitsfile *gfptr, long *firstfailed, int *status);
1984 int CFITS_API ffgtop(fitsfile *mfptr,int group,fitsfile **gfptr,int *status);
1985 int CFITS_API ffgtam(fitsfile *gfptr, fitsfile *mfptr, int hdupos, int *status);
1986 int CFITS_API ffgtnm(fitsfile *gfptr, long *nmembers, int *status);
1987 int CFITS_API ffgmng(fitsfile *mfptr, long *nmembers, int *status);
1988 int CFITS_API ffgmop(fitsfile *gfptr, long member, fitsfile **mfptr, int *status);
1989 int CFITS_API ffgmcp(fitsfile *gfptr, fitsfile *mfptr, long member, int cpopt,
1990        int *status);
1991 int CFITS_API ffgmtf(fitsfile *infptr, fitsfile *outfptr,	long member, int tfopt,
1992        int *status);
1993 int CFITS_API ffgmrm(fitsfile *fptr, long member, int rmopt, int *status);
1994 
1995 /*--------------------- group template parser routines ------------------*/
1996 
1997 int CFITS_API fits_execute_template(fitsfile *ff, char *ngp_template, int *status);
1998 
1999 int CFITS_API fits_img_stats_short(short *array,long nx, long ny, int nullcheck,
2000     short nullvalue,long *ngoodpix, short *minvalue, short *maxvalue, double *mean,
2001     double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
2002 int CFITS_API fits_img_stats_int(int *array,long nx, long ny, int nullcheck,
2003     int nullvalue,long *ngoodpix, int *minvalue, int *maxvalue, double *mean,
2004     double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
2005 int CFITS_API fits_img_stats_float(float *array, long nx, long ny, int nullcheck,
2006     float nullvalue,long *ngoodpix, float *minvalue, float *maxvalue, double *mean,
2007     double *sigma, double *noise1, double *noise2, double *noise3, double *noise5, int *status);
2008 
2009 /*--------------------- image compression routines ------------------*/
2010 
2011 int CFITS_API fits_set_compression_type(fitsfile *fptr, int ctype, int *status);
2012 int CFITS_API fits_set_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
2013 int CFITS_API fits_set_noise_bits(fitsfile *fptr, int noisebits, int *status);
2014 int CFITS_API fits_set_quantize_level(fitsfile *fptr, float qlevel, int *status);
2015 int CFITS_API fits_set_hcomp_scale(fitsfile *fptr, float scale, int *status);
2016 int CFITS_API fits_set_hcomp_smooth(fitsfile *fptr, int smooth, int *status);
2017 int CFITS_API fits_set_quantize_method(fitsfile *fptr, int method, int *status);
2018 int CFITS_API fits_set_quantize_dither(fitsfile *fptr, int dither, int *status);
2019 int CFITS_API fits_set_dither_seed(fitsfile *fptr, int seed, int *status);
2020 int CFITS_API fits_set_dither_offset(fitsfile *fptr, int offset, int *status);
2021 int CFITS_API fits_set_lossy_int(fitsfile *fptr, int lossy_int, int *status);
2022 int CFITS_API fits_set_huge_hdu(fitsfile *fptr, int huge, int *status);
2023 int CFITS_API fits_set_compression_pref(fitsfile *infptr, fitsfile *outfptr, int *status);
2024 
2025 int CFITS_API fits_get_compression_type(fitsfile *fptr, int *ctype, int *status);
2026 int CFITS_API fits_get_tile_dim(fitsfile *fptr, int ndim, long *dims, int *status);
2027 int CFITS_API fits_get_quantize_level(fitsfile *fptr, float *qlevel, int *status);
2028 int CFITS_API fits_get_noise_bits(fitsfile *fptr, int *noisebits, int *status);
2029 int CFITS_API fits_get_hcomp_scale(fitsfile *fptr, float *scale, int *status);
2030 int CFITS_API fits_get_hcomp_smooth(fitsfile *fptr, int *smooth, int *status);
2031 int CFITS_API fits_get_dither_seed(fitsfile *fptr, int *seed, int *status);
2032 
2033 int CFITS_API fits_img_compress(fitsfile *infptr, fitsfile *outfptr, int *status);
2034 int CFITS_API fits_compress_img(fitsfile *infptr, fitsfile *outfptr, int compress_type,
2035          long *tilesize, int parm1, int parm2, int *status);
2036 int CFITS_API fits_is_compressed_image(fitsfile *fptr, int *status);
2037 int CFITS_API fits_is_reentrant(void);
2038 int CFITS_API fits_decompress_img (fitsfile *infptr, fitsfile *outfptr, int *status);
2039 int CFITS_API fits_img_decompress_header(fitsfile *infptr, fitsfile *outfptr, int *status);
2040 int CFITS_API fits_img_decompress (fitsfile *infptr, fitsfile *outfptr, int *status);
2041 
2042 /* H-compress routines */
2043 int CFITS_API fits_hcompress(int *a, int nx, int ny, int scale, char *output,
2044     long *nbytes, int *status);
2045 int CFITS_API fits_hcompress64(LONGLONG *a, int nx, int ny, int scale, char *output,
2046     long *nbytes, int *status);
2047 int CFITS_API fits_hdecompress(unsigned char *input, int smooth, int *a, int *nx,
2048        int *ny, int *scale, int *status);
2049 int CFITS_API fits_hdecompress64(unsigned char *input, int smooth, LONGLONG *a, int *nx,
2050        int *ny, int *scale, int *status);
2051 
2052 int CFITS_API fits_compress_table  (fitsfile *infptr, fitsfile *outfptr, int *status);
2053 int CFITS_API fits_uncompress_table(fitsfile *infptr, fitsfile *outfptr, int *status);
2054 
2055 /* curl library wrapper routines (for https access) */
2056 int CFITS_API fits_init_https(void);
2057 int CFITS_API fits_cleanup_https(void);
2058 void CFITS_API fits_verbose_https(int flag);
2059 
2060 void CFITS_API ffshdwn(int flag);
2061 int CFITS_API ffgtmo(void);
2062 int CFITS_API ffstmo(int sec, int *status);
2063 
2064 /*  The following exclusion if __CINT__ is defined is needed for ROOT */
2065 #ifndef __CINT__
2066 #ifdef __cplusplus
2067 }
2068 #endif
2069 #endif
2070 
2071 #endif
2072 
2073