GammaLib  1.7.0.dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GFitsCfitsio.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * GFitsCfitsio.hpp - CFITSIO interface header *
3  * ----------------------------------------------------------------------- *
4  * copyright (C) 2008-2017 by Juergen Knoedlseder *
5  * ----------------------------------------------------------------------- *
6  * *
7  * This program is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License *
18  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
19  * *
20  ***************************************************************************/
21 /**
22  * @file GFitsCfitsio.hpp
23  * @brief CFITSIO interface header
24  * @author Juergen Knoedlseder
25  */
26 
27 #ifndef GFITSCFITSIO_HPP
28 #define GFITSCFITSIO_HPP
29 
30 /* __ Includes ___________________________________________________________ */
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
34 #include <cstring>
35 
36 /* __ Namespaces _________________________________________________________ */
37 
38 
39 /***************************************************************************
40  * CFITSIO is available *
41  ***************************************************************************/
42 #if defined(HAVE_LIBCFITSIO)
43 
44 #if defined(HAVE_CFITSIO_FITSIO_H)
45 #include <cfitsio/fitsio.h>
46 #elif defined(HAVE_LIBCFITSIO0_FITSIO_H)
47 #include <libcfitsio0/fitsio.h>
48 #else
49 #include <fitsio.h>
50 #endif
51 
52 /* __ Macros _____________________________________________________________ */
53 #define __ffclos(A, B) ffclos(A, B)
54 #define __ffcrim(A, B, C, D, E) ffcrim(A, B, C, D, E)
55 #define __ffcrtb(A, B, C, D, E, F, G, H, I) ffcrtb(A, B, C, D, E, F, G, H, I)
56 #define __ffdcol(A, B, C) ffdcol(A, B, C)
57 #define __ffdelt(A, B) ffdelt(A, B)
58 #define __ffdhdu(A, B, C) ffdhdu(A, B, C)
59 #define __ffdrow(A, B, C, D) ffdrow(A, B, C, D)
60 #define __ffflus(A, B) ffflus(A, B)
61 #define __ffgabc(A, B, C, D, E, F) ffgabc(A, B, C, D, E, F)
62 #define __ffgcv(A, B, C, D, E, F, G, H, I, J) ffgcv(A, B, C, D, E, F, G, H, I, J)
63 #define __ffgcvb(A, B, C, D, E, F, G, H, I) ffgcvb(A, B, C, D, E, F, G, H, I)
64 #define __ffgcvs(A, B, C, D, E, F, G, H, I) ffgcvs(A, B, C, D, E, F, G, H, I)
65 #define __ffgdes(A, B, C, D, E, F) ffgdes(A, B, C, D, E, F)
66 #define __ffgerr(A, B) ffgerr(A, B)
67 #define __ffghdt(A, B, C) ffghdt(A, B, C)
68 #define __ffghsp(A, B, C, D) ffghsp(A, B, C, D)
69 #define __ffgidm(A, B, C) ffgidm(A, B, C)
70 #define __ffgidt(A, B, C) ffgidt(A, B, C)
71 #define __ffgiet(A, B, C) ffgiet(A, B, C)
72 #define __ffgipr(A, B, C, D, E, F) ffgipr(A, B, C, D, E, F)
73 #define __ffgisz(A, B, C, D) ffgisz(A, B, C, D)
74 #define __ffgky(A, B, C, D, E, F) ffgky(A, B, C, D, E, F)
75 #define __ffgkey(A, B, C, D, E) ffgkey(A, B, C, D, E)
76 #define __ffgkyn(A, B, C, D, E, F) ffgkyn(A, B, C, D, E, F)
77 #define __ffgnrw(A, B, C) ffgnrw(A, B, C)
78 #define __ffgncl(A, B, C) ffgncl(A, B, C)
79 #define __ffgsv(A, B, C, D, E, F, G, H, I) ffgsv(A, B, C, D, E, F, G, H, I)
80 #define __ffgtcl(A, B, C, D, E, F) ffgtcl(A, B, C, D, E, F)
81 #define __ffibin(A, B, C, D, E, F, G, H, I) ffibin(A, B, C, D, E, F, G, H, I)
82 #define __fficol(A, B, C, D, E) fficol(A, B, C, D, E)
83 #define __ffiimg(A, B, C, D, E) ffiimg(A, B, C, D, E)
84 #define __ffiimgll(A, B, C, D, E) ffiimgll(A, B, C, D, E)
85 #define __ffinit(A, B, C) ffinit(A, B, C)
86 #define __ffirow(A, B, C, D) ffirow(A, B, C, D)
87 #define __ffitab(A, B, C, D, E, F, G, H, I, J) ffitab(A, B, C, D, E, F, G, H, I, J)
88 #define __ffopen(A, B, C, D) ffopen(A, B, C, D)
89 #define __ffmahd(A, B, C, D) ffmahd(A, B, C, D)
90 #define __ffpcn(A, B, C, D, E, F, G, H, I) ffpcn(A, B, C, D, E, F, G, H, I)
91 #define __ffpcom(A, B, C) ffpcom(A, B, C)
92 #define __ffphis(A, B, C) ffphis(A, B, C)
93 #define __ffpss(A, B, C, D, E, F) ffpss(A, B, C, D, E, F)
94 #define __ffprec(A, B, C) ffprec(A, B, C)
95 #define __ffrsim(A, B, C, D, E) ffrsim(A, B, C, D, E)
96 #define __ffsrow(A, B, C, D) ffsrow(A, B, C, D)
97 #define __ffthdu(A, B, C) ffthdu(A, B, C)
98 #define __fftscl(A, B, C, D, E) fftscl(A, B, C, D, E)
99 #define __ffuky(A, B, C, D, E, F) ffuky(A, B, C, D, E, F)
100 #define __ffukye(A, B, C, D, E, F) ffukye(A, B, C, D, E, F)
101 #define __ffukyd(A, B, C, D, E, F) ffukyd(A, B, C, D, E, F)
102 #define __ffukyj(A, B, C, D, E) ffukyj(A, B, C, D, E)
103 #define __ffukyl(A, B, C, D, E) ffukyl(A, B, C, D, E)
104 #define __ffukys(A, B, C, D, E) ffukys(A, B, C, D, E)
105 #define __ffukyu(A, B, C, D) ffukyu(A, B, C, D)
106 #define __TNULL 0
107 #define __TBIT TBIT
108 #define __TBYTE TBYTE
109 #define __TSBYTE TSBYTE
110 #define __TLOGICAL TLOGICAL
111 #define __TSTRING TSTRING
112 #define __TUSHORT TUSHORT
113 #define __TSHORT TSHORT
114 #define __TUINT TUINT
115 #define __TINT TINT
116 #define __TULONG TULONG
117 #define __TLONG TLONG
118 #define __TFLOAT TFLOAT
119 #define __TLONGLONG TLONGLONG
120 #define __TDOUBLE TDOUBLE
121 #define __TCOMPLEX TCOMPLEX
122 #define __TDBLCOMPLEX TDBLCOMPLEX
123 
124 /* __ Type definition ____________________________________________________ */
125 typedef fitsfile __fitsfile;
126 
127 /***************************************************************************
128  * CFITSIO is not available *
129  ***************************************************************************/
130 #else
131 
132 /* __ Macros _____________________________________________________________ */
133 #define __ffclos(A, B) __dummy()
134 #define __ffcrim(A, B, C, D, E) __dummy()
135 #define __ffcrtb(A, B, C, D, E, F, G, H, I) __dummy()
136 #define __ffdcol(A, B, C) __dummy()
137 #define __ffdelt(A, B) __dummy()
138 #define __ffdhdu(A, B, C) __dummy()
139 #define __ffdrow(A, B, C, D) __dummy()
140 #define __ffflus(A, B) __dummy()
141 #define __ffgabc(A, B, C, D, E, F) __dummy()
142 #define __ffgcv(A, B, C, D, E, F, G, H, I, J) __dummy()
143 #define __ffgcvb(A, B, C, D, E, F, G, H, I) __dummy()
144 #define __ffgcvs(A, B, C, D, E, F, G, H, I) __dummy()
145 #define __ffgdes(A, B, C, D, E, F) __dummy()
146 #define __ffgerr(A, B) __error(A, B)
147 #define __ffghdt(A, B, C) __dummy()
148 #define __ffghsp(A, B, C, D) __dummy()
149 #define __ffgidm(A, B, C) __dummy()
150 #define __ffgidt(A, B, C) __dummy()
151 #define __ffgiet(A, B, C) __dummy()
152 #define __ffgipr(A, B, C, D, E, F) __dummy()
153 #define __ffgisz(A, B, C, D) __dummy()
154 #define __ffgky(A, B, C, D, E, F) __dummy()
155 #define __ffgkey(A, B, C, D, E) __dummy()
156 #define __ffgkyn(A, B, C, D, E, F) __dummy()
157 #define __ffgnrw(A, B, C) __dummy()
158 #define __ffgncl(A, B, C) __dummy()
159 #define __ffgsv(A, B, C, D, E, F, G, H, I) __dummy()
160 #define __ffgtcl(A, B, C, D, E, F) __dummy()
161 #define __ffibin(A, B, C, D, E, F, G, H, I) __dummy()
162 #define __fficol(A, B, C, D, E) __dummy()
163 #define __ffiimg(A, B, C, D, E) __dummy()
164 #define __ffiimgll(A, B, C, D, E) __dummy()
165 #define __ffinit(A, B, C) __dummy()
166 #define __ffirow(A, B, C, D) __dummy()
167 #define __ffitab(A, B, C, D, E, F, G, H, I, J) __dummy()
168 #define __ffmahd(A, B, C, D) __dummy()
169 #define __ffpcn(A, B, C, D, E, F, G, H, I) __dummy()
170 #define __ffopen(A, B, C, D) __dummy()
171 #define __ffpcom(A, B, C) __dummy()
172 #define __ffphis(A, B, C) __dummy()
173 #define __ffpss(A, B, C, D, E, F) __dummy()
174 #define __ffprec(A, B, C) __dummy()
175 #define __ffrsim(A, B, C, D, E) __dummy()
176 #define __ffsrow(A, B, C, D) __dummy()
177 #define __ffthdu(A, B, C) __dummy()
178 #define __fftscl(A, B, C, D, E) __dummy()
179 #define __ffuky(A, B, C, D, E, F) __dummy()
180 #define __ffukye(A, B, C, D, E, F) __dummy()
181 #define __ffukyd(A, B, C, D, E, F) __dummy()
182 #define __ffukyj(A, B, C, D, E) __dummy()
183 #define __ffukyl(A, B, C, D, E) __dummy()
184 #define __ffukys(A, B, C, D, E) __dummy()
185 #define __ffukyu(A, B, C, D) __dummy()
186 #define __TNULL 0
187 #define __TBIT 1
188 #define __TBYTE 11
189 #define __TSBYTE 12
190 #define __TLOGICAL 14
191 #define __TSTRING 16
192 #define __TUSHORT 20
193 #define __TSHORT 21
194 #define __TUINT 30
195 #define __TINT 31
196 #define __TULONG 40
197 #define __TLONG 41
198 #define __TFLOAT 42
199 #define __TLONGLONG 81
200 #define __TDOUBLE 82
201 #define __TCOMPLEX 83
202 #define __TDBLCOMPLEX 163
203 
204 /* __ Type definition ____________________________________________________ */
205 typedef struct {
206  int HDUposition; // HDU position in file; 0 = first HDU
207  int* Fptr; // Pointer to FITS file structure
208 } __fitsfile;
209 
210 /* __ Dummy function _____________________________________________________ */
211 inline
212 void __error(int status, char* err_text)
213 {
214  std::strcpy(err_text, "CFITSIO not available");
215 }
216 inline
217 int __dummy(void)
218 {
219  return 0;
220 }
221 
222 #endif
223 
224 /* __ Common macros ______________________________________________________ */
225 #define FPTR(A) ((__fitsfile*)A)
226 #define FHANDLE(A) ((__fitsfile**)&A)
227 #define FPTR_COPY(A, B) *((__fitsfile*)A) = *((__fitsfile*)B)
228 
229 #endif /* GFITSCFITSIO_HPP */
void __error(int status, char *err_text)
int __dummy(void)