1 #if !defined( FITSCHAN_INCLUDED ) /* Include this file only once */ 2 #define FITSCHAN_INCLUDED 3 /* 4 *+ 5 * Name: 6 * fitschan.h 7 8 * Type: 9 * C include file. 10 11 * Purpose: 12 * Define the interface to the FitsChan class. 13 14 * Invocation: 15 * #include "fitschan.h" 16 17 * Description: 18 * This include file defines the interface to the FitsChan class and 19 * provides the type definitions, function prototypes and macros, 20 * etc. needed to use this class. 21 * 22 * The FitsChan class provides facilities for reading and writing AST 23 * Objects in the form of FITS header cards. 24 25 * Inheritance: 26 * The FitsChan class inherits from the Channel class. 27 28 * Macros: 29 30 * Protected: 31 * AST__NOTYPE 32 * Integer dentifier for an illegal FITS data type. 33 * AST__COMMENT 34 * Integer dentifier for a FITS comment keyword. 35 * AST__INT 36 * Integer dentifier for the integer FITS data type. 37 * AST__FLOAT 38 * Integer dentifier for the floating point FITS data type. 39 * AST__STRING 40 * Integer dentifier for the string FITS data type. 41 * AST__CONTINUE 42 * Integer dentifier for the continuation string FITS data type. 43 * AST__COMPLEXF 44 * Integer dentifier for the complex floating point FITS data type. 45 * AST__COMPLEXI 46 * Integer dentifier for the complex integer FITS data type. 47 * AST__LOGICAL 48 * Integer dentifier for the logical FITS data type. 49 * AST__UNDEF 50 * Integer dentifier for undefined FITS data type. 51 52 * Feature Test Macros: 53 * astCLASS 54 * If the astCLASS macro is undefined, only public symbols are 55 * made available, otherwise protected symbols (for use in other 56 * class implementations) are defined. This macro also affects 57 * the reporting of error context information, which is only 58 * provided for external calls to the AST library. 59 60 * Copyright: 61 * Copyright (C) 1997-2006 Council for the Central Laboratory of the 62 * Research Councils 63 64 * Licence: 65 * This program is free software: you can redistribute it and/or 66 * modify it under the terms of the GNU Lesser General Public 67 * License as published by the Free Software Foundation, either 68 * version 3 of the License, or (at your option) any later 69 * version. 70 * 71 * This program is distributed in the hope that it will be useful, 72 * but WITHOUT ANY WARRANTY; without even the implied warranty of 73 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 74 * GNU Lesser General Public License for more details. 75 * 76 * You should have received a copy of the GNU Lesser General 77 * License along with this program. If not, see 78 * <http://www.gnu.org/licenses/>. 79 80 * Authors: 81 * DSB: D.S. Berry (Starlink) 82 83 * History: 84 * 11-DEC-1996 (DSB): 85 * Original version. 86 * 30-Jun-1997 (DSB): 87 * Changed character pointer argument to character array in PutFits. 88 * 26-SEP-1997 (DSB): 89 * Added CDMatrix attribute. 90 * 21-OCT-1997 (DSB): 91 * o Renamed astFields as astKeyFields. 92 * 1-APR-2000 (DSB): 93 * Changes for CDi_j based FITS-WCS standard. 94 * 18-MAY-2000 (DSB): 95 * Added Warnings attribute. 96 * 4-APR-2001 (DSB): 97 * Added AllWarnings attribute. 98 * 20-FEB-2002 (DSB): 99 * Added CarLin attribute. 100 * 8-JAN-2003 (DSB): 101 * Added protected astInitFitsChanVtab method. 102 * 13-FEB-2003 (DSB): 103 * Added Clean attribute. 104 * 19-MAR-2004 (DSB): 105 * Added astPutCards function. 106 *- 107 */ 108 109 /* Include files. */ 110 /* ============== */ 111 /* Interface definitions. */ 112 /* ---------------------- */ 113 #include "channel.h" /* I/O channels (parent class) */ 114 #include "pointset.h" /* Defines AST__BAD */ 115 #include "keymap.h" /* Defines the AstKeyMap type */ 116 117 /* C header files. */ 118 /* --------------- */ 119 #if defined(astCLASS) /* Protected */ 120 #include <stddef.h> 121 #endif 122 123 /* Macros. */ 124 /* ------- */ 125 126 /* Define a dummy __attribute__ macro for use on non-GNU compilers. */ 127 #ifndef __GNUC__ 128 # define __attribute__(x) /*NOTHING*/ 129 #endif 130 131 #if defined(astCLASS) || defined(astFORTRAN77) 132 #define STATUS_PTR status 133 #else 134 #define STATUS_PTR astGetStatusPtr 135 #endif 136 137 #define AST__NOTYPE -1 138 #define AST__COMMENT 0 139 #define AST__INT 1 140 #define AST__FLOAT 2 141 #define AST__STRING 3 142 #define AST__COMPLEXF 4 143 #define AST__COMPLEXI 5 144 #define AST__LOGICAL 6 145 #define AST__CONTINUE 7 146 #define AST__UNDEF 8 147 148 #if defined(astCLASS) /* Protected */ 149 150 /* Define constants used to size global arrays in this module. */ 151 #define AST__FITSCHAN_FITSCARDLEN 80 152 #define AST__FITSCHAN_GETATTRIB_BUFF_LEN 50 153 154 #endif 155 156 /* The EXTNAME value for FITS binary tables used to store coordinate arrays for 157 the -TAB algorithm. */ 158 #define AST_TABEXTNAME "WCS-TAB" 159 160 /* Type Definitions. */ 161 /* ================= */ 162 163 /* FitsChan structure. */ 164 /* ------------------ */ 165 /* This structure contains all information that is unique to each object in 166 the class (e.g. its instance variables). */ 167 struct AstFitsChan; 168 typedef struct AstFitsChan { 169 170 /* Attributes inherited from the parent class. */ 171 AstChannel channel; /* Parent class structure */ 172 173 /* Attributes specific to objects in this class. */ 174 int encoding; /* System for encoding AST objects ito FITS headers */ 175 int defb1950; /* Use FK4 B1950 as defaults? */ 176 int tabok; /* Support -TAB algorithm? */ 177 int cdmatrix; /* Use a CD matrix in FITS-WCS Encoding? */ 178 int polytan; /* Use distorted TAN convention? */ 179 int carlin; /* Use linear CAR mappings? */ 180 int iwc; /* Include an IWC Frame? */ 181 int clean; /* Remove used cards even if an error occurs? */ 182 int fitsdigits; /* No. of decmial places in formatted floating point keyword values */ 183 char *fitsaxisorder; /* Pointer to a string defining WCS axis order */ 184 char *warnings; /* Pointer to a string containing warning conditions */ 185 void *card; /* Pointer to next FitsCard to be read */ 186 void *head; /* Pointer to first FitsCard in the circular linked list */ 187 AstKeyMap *keyseq; /* List of keyword sequence numbers used */ 188 AstKeyMap *keywords; /* A KeyMap holding the keywords in the FitsChan */ 189 AstKeyMap *tables; /* A KeyMap holding the binary tables in the FitsChan */ 190 191 const char *(* source)( void ); /* Pointer to source function */ 192 const char *(* saved_source)( void ); /* Pointer to saved source function */ 193 char *(* source_wrap)( const char *(*)( void ), int * ); 194 /* Source wrapper function pointer */ 195 196 void (* sink)( const char * ); /* Pointer to sink function */ 197 void (* sink_wrap)( void (*)( const char * ), const char *, int * ); 198 /* Sink wrapper function pointer */ 199 200 void (* tabsource)( void ); /* Pointer to table source function */ 201 void (* tabsource_wrap)( void (*)( void ), struct AstFitsChan *, const char *, int, int, int * ); 202 /* Table source wrapper function pointer */ 203 204 } AstFitsChan; 205 206 /* Virtual function table. */ 207 /* ----------------------- */ 208 /* The virtual function table makes a forward reference to the 209 AstFitsTable structure which is not defined until "fitstable.h" is 210 included (below). Hence make a preliminary definition available 211 now. */ 212 struct AstFitsTable; 213 214 /* This table contains all information that is the same for all 215 objects in the class (e.g. pointers to its virtual functions). */ 216 #if defined(astCLASS) /* Protected */ 217 typedef struct AstFitsChanVtab { 218 219 /* Properties (e.g. methods) inherited from the parent class. */ 220 AstChannelVtab channel_vtab; /* Parent class virtual function table */ 221 222 /* A Unique identifier to determine class membership. */ 223 AstClassIdentifier id; 224 225 /* Properties (e.g. methods) specific to this class. */ 226 AstKeyMap *(* GetTables)( AstFitsChan *, int * ); 227 int (* FindFits)( AstFitsChan *, const char *, char [81], int, int * ); 228 int (* FitsEof)( AstFitsChan *, int * ); 229 int (* FitsGetCom)( AstFitsChan *, const char *, char **, int * ); 230 int (* GetFitsCF)( AstFitsChan *, const char *, double *, int * ); 231 int (* GetFitsCI)( AstFitsChan *, const char *, int *, int * ); 232 int (* GetFitsCN)( AstFitsChan *, const char *, char **, int * ); 233 int (* GetFitsF)( AstFitsChan *, const char *, double *, int * ); 234 int (* GetFitsI)( AstFitsChan *, const char *, int *, int * ); 235 int (* GetFitsL)( AstFitsChan *, const char *, int *, int * ); 236 int (* GetFitsS)( AstFitsChan *, const char *, char **, int * ); 237 int (* KeyFields)( AstFitsChan *, const char *, int, int *, int *, int * ); 238 int (* TestFits)( AstFitsChan *, const char *, int *, int * ); 239 void (* DelFits)( AstFitsChan *, int * ); 240 void (* Empty)( AstFitsChan *, int * ); 241 void (* ReadFits)( AstFitsChan *, int * ); 242 void (* WriteFits)( AstFitsChan *, int * ); 243 void (* EmptyFits)( AstFitsChan *, int * ); 244 void (* ShowFits)( AstFitsChan *, int * ); 245 void (* PurgeWCS)( AstFitsChan *, int * ); 246 void (* PutCards)( AstFitsChan *, const char *, int * ); 247 void (* PutFits)( AstFitsChan *, const char [81], int, int * ); 248 void (* PutTable)( AstFitsChan *, struct AstFitsTable *, const char *, int * ); 249 void (* PutTables)( AstFitsChan *, AstKeyMap *, int * ); 250 void (* RemoveTables)( AstFitsChan *, const char *, int * ); 251 void (* RetainFits)( AstFitsChan *, int * ); 252 void (* SetFitsCF)( AstFitsChan *, const char *, double *, const char *, int, int * ); 253 void (* SetFitsCI)( AstFitsChan *, const char *, int *, const char *, int, int * ); 254 void (* SetFitsCM)( AstFitsChan *, const char *, int, int * ); 255 void (* SetFitsCN)( AstFitsChan *, const char *, const char *, const char *, int, int * ); 256 void (* SetFitsCom)( AstFitsChan *, const char *, const char *, int, int * ); 257 void (* SetFitsF)( AstFitsChan *, const char *, double, const char *, int, int * ); 258 void (* SetFitsI)( AstFitsChan *, const char *, int, const char *, int, int * ); 259 void (* SetFitsL)( AstFitsChan *, const char *, int, const char *, int, int * ); 260 void (* SetFitsS)( AstFitsChan *, const char *, const char *, const char *, int, int * ); 261 void (* SetFitsU)( AstFitsChan *, const char *, const char *, int, int * ); 262 263 int (* GetCard)( AstFitsChan *, int * ); 264 int (* TestCard)( AstFitsChan *, int * ); 265 void (* SetCard)( AstFitsChan *, int, int * ); 266 void (* ClearCard)( AstFitsChan *, int * ); 267 268 int (* GetFitsDigits)( AstFitsChan *, int * ); 269 int (* TestFitsDigits)( AstFitsChan *, int * ); 270 void (* SetFitsDigits)( AstFitsChan *, int, int * ); 271 void (* ClearFitsDigits)( AstFitsChan *, int * ); 272 273 const char *(* GetFitsAxisOrder)( AstFitsChan *, int * ); 274 int (* TestFitsAxisOrder)( AstFitsChan *, int * ); 275 void (* SetFitsAxisOrder)( AstFitsChan *, const char *, int * ); 276 void (* ClearFitsAxisOrder)( AstFitsChan *, int * ); 277 278 int (* GetDefB1950)( AstFitsChan *, int * ); 279 int (* TestDefB1950)( AstFitsChan *, int * ); 280 void (* SetDefB1950)( AstFitsChan *, int, int * ); 281 void (* ClearDefB1950)( AstFitsChan *, int * ); 282 283 int (* GetTabOK)( AstFitsChan *, int * ); 284 int (* TestTabOK)( AstFitsChan *, int * ); 285 void (* SetTabOK)( AstFitsChan *, int, int * ); 286 void (* ClearTabOK)( AstFitsChan *, int * ); 287 288 int (* GetCarLin)( AstFitsChan *, int * ); 289 int (* TestCarLin)( AstFitsChan *, int * ); 290 void (* SetCarLin)( AstFitsChan *, int, int * ); 291 void (* ClearCarLin)( AstFitsChan *, int * ); 292 293 int (* GetNcard)( AstFitsChan *, int * ); 294 295 int (* GetCardType)( AstFitsChan *, int * ); 296 const char *(* GetCardName)( AstFitsChan *, int * ); 297 const char *(* GetCardComm)( AstFitsChan *, int * ); 298 299 int (* GetNkey)( AstFitsChan *, int * ); 300 301 int (* GetEncoding)( AstFitsChan *, int * ); 302 int (* TestEncoding)( AstFitsChan *, int * ); 303 void (* SetEncoding)( AstFitsChan *, int, int * ); 304 void (* ClearEncoding)( AstFitsChan *, int * ); 305 306 const char *(* GetAllWarnings)( AstFitsChan *, int * ); 307 308 const char *(* GetWarnings)( AstFitsChan *, int * ); 309 int (* TestWarnings)( AstFitsChan *, int * ); 310 void (* ClearWarnings)( AstFitsChan *, int * ); 311 void (* SetWarnings)( AstFitsChan *, const char *, int * ); 312 313 int (* GetClean)( AstFitsChan *, int * ); 314 int (* TestClean)( AstFitsChan *, int * ); 315 void (* SetClean)( AstFitsChan *, int, int * ); 316 void (* ClearClean)( AstFitsChan *, int * ); 317 318 int (* GetCDMatrix)( AstFitsChan *, int * ); 319 int (* TestCDMatrix)( AstFitsChan *, int * ); 320 void (* SetCDMatrix)( AstFitsChan *, int, int * ); 321 void (* ClearCDMatrix)( AstFitsChan *, int * ); 322 323 int (* GetPolyTan)( AstFitsChan *, int * ); 324 int (* TestPolyTan)( AstFitsChan *, int * ); 325 void (* SetPolyTan)( AstFitsChan *, int, int * ); 326 void (* ClearPolyTan)( AstFitsChan *, int * ); 327 328 int (* GetIwc)( AstFitsChan *, int * ); 329 int (* TestIwc)( AstFitsChan *, int * ); 330 void (* SetIwc)( AstFitsChan *, int, int * ); 331 void (* ClearIwc)( AstFitsChan *, int * ); 332 333 void (* SetTableSource)( AstFitsChan *, 334 void (*)( void ), 335 void (*)( void (*)( void ), 336 AstFitsChan *, const char *, int, 337 int, int * ), 338 int * ); 339 340 void (* TableSource)( AstFitsChan *, 341 void (*)( AstFitsChan *, const char *, int, int, 342 int * ), 343 int * ); 344 345 } AstFitsChanVtab; 346 347 #if defined(THREAD_SAFE) 348 349 /* Define a structure holding all data items that are global within this 350 class. */ 351 typedef struct AstFitsChanGlobals { 352 AstFitsChanVtab Class_Vtab; 353 int Class_Init; 354 char GetAttrib_Buff[ AST__FITSCHAN_GETATTRIB_BUFF_LEN + 1 ]; 355 char CnvType_Text[ AST__FITSCHAN_FITSCARDLEN + 1 ]; 356 char CnvType_Text0[ AST__FITSCHAN_FITSCARDLEN + 1 ]; 357 char CnvType_Text1[ AST__FITSCHAN_FITSCARDLEN + 1 ]; 358 int Items_Written; 359 int Write_Nest; 360 int Current_Indent; 361 int Ignore_Used; 362 int Mark_New; 363 int CreateKeyword_Seq_Nchars; 364 char FormatKey_Buff[ 10 ]; 365 char FitsGetCom_Sval[ AST__FITSCHAN_FITSCARDLEN + 1 ]; 366 const char *IsSpectral_Ret; 367 char Match_Fmt[ 10 ]; 368 const char *Match_Template; 369 int *Match_PA; 370 int *Match_PB; 371 int Match_NA; 372 int Match_NB; 373 int Match_Nentry; 374 char WcsCelestial_Type[ 4 ]; 375 } AstFitsChanGlobals; 376 377 #endif 378 379 #endif 380 381 /* Function prototypes. */ 382 /* ==================== */ 383 /* Prototypes for standard class functions. */ 384 /* ---------------------------------------- */ 385 astPROTO_CHECK(FitsChan) /* Check class membership */ 386 astPROTO_ISA(FitsChan) /* Test class membership */ 387 388 /* Constructor. */ 389 #if defined(astCLASS) /* Protected. */ 390 AstFitsChan *astFitsChan_( const char *(*)( void ), void (*)( const char * ), 391 const char *, int *, ...); 392 #else 393 AstFitsChan *astFitsChanId_( const char *(*)( void ), void (*)( const char * ), 394 const char *, ... )__attribute__((format(printf,3,4))); 395 AstFitsChan *astFitsChanForId_( const char *(*)( void ), 396 char *(*)( const char *(*)( void ), int * ), 397 void (*)( const char * ), 398 void (*)( void (*)( const char * ), 399 const char *, int * ), 400 const char *, ... ); 401 #endif 402 403 #if defined(astCLASS) /* Protected */ 404 405 /* Initialiser. */ 406 AstFitsChan *astInitFitsChan_( void *, size_t, int, AstFitsChanVtab *, 407 const char *, 408 const char *(*)( void ), 409 char *(*)( const char *(*)( void ), int * ), 410 void (*)( const char * ), 411 void (*)( void (*)( const char * ), const char *, int * ), int * ); 412 413 /* Vtab initialiser. */ 414 void astInitFitsChanVtab_( AstFitsChanVtab *, const char *, int * ); 415 416 417 418 /* Loader. */ 419 AstFitsChan *astLoadFitsChan_( void *, size_t, AstFitsChanVtab *, 420 const char *, AstChannel *, int * ); 421 422 /* Thread-safe initialiser for all global data used by this module. */ 423 #if defined(THREAD_SAFE) 424 void astInitFitsChanGlobals_( AstFitsChanGlobals * ); 425 #endif 426 427 #endif 428 429 /* Prototypes for member functions. */ 430 /* -------------------------------- */ 431 AstKeyMap *astGetTables_( AstFitsChan *, int * ); 432 int astFindFits_( AstFitsChan *, const char *, char [81], int, int * ); 433 int astGetFitsCF_( AstFitsChan *, const char *, double *, int * ); 434 int astGetFitsCI_( AstFitsChan *, const char *, int *, int * ); 435 int astGetFitsCN_( AstFitsChan *, const char *, char **, int * ); 436 int astGetFitsF_( AstFitsChan *, const char *, double *, int * ); 437 int astGetFitsI_( AstFitsChan *, const char *, int *, int * ); 438 int astGetFitsL_( AstFitsChan *, const char *, int *, int * ); 439 int astGetFitsS_( AstFitsChan *, const char *, char **, int * ); 440 int astTestFits_( AstFitsChan *, const char *, int *, int * ); 441 void astDelFits_( AstFitsChan *, int * ); 442 void astReadFits_( AstFitsChan *, int * ); 443 void astWriteFits_( AstFitsChan *, int * ); 444 void astEmptyFits_( AstFitsChan *, int * ); 445 void astShowFits_( AstFitsChan *, int * ); 446 void astPurgeWCS_( AstFitsChan *, int * ); 447 void astPutCards_( AstFitsChan *, const char *, int * ); 448 void astPutFits_( AstFitsChan *, const char [81], int, int * ); 449 void astPutTable_( AstFitsChan *, struct AstFitsTable *, const char *, int * ); 450 void astPutTables_( AstFitsChan *, AstKeyMap *, int * ); 451 void astRemoveTables_( AstFitsChan *, const char *, int * ); 452 void astRetainFits_( AstFitsChan *, int * ); 453 void astSetFitsCF_( AstFitsChan *, const char *, double *, const char *, int, int * ); 454 void astSetFitsCI_( AstFitsChan *, const char *, int *, const char *, int, int * ); 455 void astSetFitsCM_( AstFitsChan *, const char *, int, int * ); 456 void astSetFitsCN_( AstFitsChan *, const char *, const char *, const char *, int, int * ); 457 void astSetFitsF_( AstFitsChan *, const char *, double, const char *, int, int * ); 458 void astSetFitsI_( AstFitsChan *, const char *, int, const char *, int, int * ); 459 void astSetFitsL_( AstFitsChan *, const char *, int, const char *, int, int * ); 460 void astSetFitsS_( AstFitsChan *, const char *, const char *, const char *, int, int * ); 461 void astSetFitsU_( AstFitsChan *, const char *, const char *, int, int * ); 462 463 void astTableSource_( AstFitsChan *, 464 void (*)( AstFitsChan *, const char *, int, int, int * ), 465 int * ); 466 467 468 469 # if defined(astCLASS) || defined(astFORTRAN77) /* Protected or F77 interface */ 470 void astSetTableSource_( AstFitsChan *, 471 void (*)( void ), 472 void (*)( void (*)( void ), 473 AstFitsChan *, const char *, int, 474 int, int * ), 475 int * ); 476 477 #endif 478 479 # if defined(astCLASS) /* Protected */ 480 481 int astFitsEof_( AstFitsChan *, int * ); 482 int astFitsGetCom_( AstFitsChan *, const char *, char **, int * ); 483 void astSetFitsCom_( AstFitsChan *, const char *, const char *, int, int * ); 484 485 int astKeyFields_( AstFitsChan *, const char *, int, int *, int *, int * ); 486 487 int astGetCard_( AstFitsChan *, int * ); 488 int astTestCard_( AstFitsChan *, int * ); 489 void astSetCard_( AstFitsChan *, int, int * ); 490 void astClearCard_( AstFitsChan *, int * ); 491 492 int astGetDefB1950_( AstFitsChan *, int * ); 493 int astTestDefB1950_( AstFitsChan *, int * ); 494 void astSetDefB1950_( AstFitsChan *, int, int * ); 495 void astClearDefB1950_( AstFitsChan *, int * ); 496 497 int astGetTabOK_( AstFitsChan *, int * ); 498 int astTestTabOK_( AstFitsChan *, int * ); 499 void astSetTabOK_( AstFitsChan *, int, int * ); 500 void astClearTabOK_( AstFitsChan *, int * ); 501 502 int astGetCDMatrix_( AstFitsChan *, int * ); 503 int astTestCDMatrix_( AstFitsChan *, int * ); 504 void astSetCDMatrix_( AstFitsChan *, int, int * ); 505 void astClearCDMatrix_( AstFitsChan *, int * ); 506 507 int astGetPolyTan_( AstFitsChan *, int * ); 508 int astTestPolyTan_( AstFitsChan *, int * ); 509 void astSetPolyTan_( AstFitsChan *, int, int * ); 510 void astClearPolyTan_( AstFitsChan *, int * ); 511 512 int astGetCarLin_( AstFitsChan *, int * ); 513 int astTestCarLin_( AstFitsChan *, int * ); 514 void astSetCarLin_( AstFitsChan *, int, int * ); 515 void astClearCarLin_( AstFitsChan *, int * ); 516 517 int astGetIwc_( AstFitsChan *, int * ); 518 int astTestIwc_( AstFitsChan *, int * ); 519 void astSetIwc_( AstFitsChan *, int, int * ); 520 void astClearIwc_( AstFitsChan *, int * ); 521 522 int astGetClean_( AstFitsChan *, int * ); 523 int astTestClean_( AstFitsChan *, int * ); 524 void astSetClean_( AstFitsChan *, int, int * ); 525 void astClearClean_( AstFitsChan *, int * ); 526 527 int astGetFitsDigits_( AstFitsChan *, int * ); 528 int astTestFitsDigits_( AstFitsChan *, int * ); 529 void astSetFitsDigits_( AstFitsChan *, int, int * ); 530 void astClearFitsDigits_( AstFitsChan *, int * ); 531 532 const char *astGetFitsAxisOrder_( AstFitsChan *, int * ); 533 int astTestFitsAxisOrder_( AstFitsChan *, int * ); 534 void astSetFitsAxisOrder_( AstFitsChan *, const char *, int * ); 535 void astClearFitsAxisOrder_( AstFitsChan *, int * ); 536 537 const char *astGetAllWarnings_( AstFitsChan *, int * ); 538 539 const char *astGetWarnings_( AstFitsChan *, int * ); 540 int astTestWarnings_( AstFitsChan *, int * ); 541 void astClearWarnings_( AstFitsChan *, int * ); 542 void astSetWarnings_( AstFitsChan *, const char *, int * ); 543 544 int astGetNcard_( AstFitsChan *, int * ); 545 546 int astGetCardType_( AstFitsChan *, int * ); 547 const char *astGetCardName_( AstFitsChan *, int * ); 548 const char *astGetCardComm_( AstFitsChan *, int * ); 549 550 int astGetNkey_( AstFitsChan *, int * ); 551 552 int astGetEncoding_( AstFitsChan *, int * ); 553 int astTestEncoding_( AstFitsChan *, int * ); 554 void astSetEncoding_( AstFitsChan *, int, int * ); 555 void astClearEncoding_( AstFitsChan *, int * ); 556 557 #endif 558 559 /* Function interfaces. */ 560 /* ==================== */ 561 /* These macros are wrap-ups for the functions defined by this class 562 to make them easier to invoke (e.g. to avoid type mis-matches when 563 passing pointers to objects from derived classes). */ 564 565 /* Interfaces to standard class functions. */ 566 /* --------------------------------------- */ 567 /* Some of these functions provide validation, so we cannot use them 568 to validate their own arguments. We must use a cast when passing 569 object pointers (so that they can accept objects from derived 570 classes). */ 571 572 /* Check class membership. */ 573 #define astCheckFitsChan(this) astINVOKE_CHECK(FitsChan,this,0) 574 #define astVerifyFitsChan(this) astINVOKE_CHECK(FitsChan,this,1) 575 576 /* Test class membership. */ 577 #define astIsAFitsChan(this) astINVOKE_ISA(FitsChan,this) 578 579 /* Constructor. */ 580 #if defined(astCLASS) /* Protected. */ 581 #define astFitsChan astINVOKE(F,astFitsChan_) 582 #else 583 #define astFitsChan astINVOKE(F,astFitsChanId_) 584 #define astFitsChanFor astINVOKE(F,astFitsChanForId_) 585 #endif 586 587 #if defined(astCLASS) /* Protected */ 588 589 /* Initialiser. */ 590 #define astInitFitsChan(mem,size,init,vtab,name,source,sourcewrap,sink,sinkwrap) \ 591 astINVOKE(O,astInitFitsChan_(mem,size,init,vtab,name,source,sourcewrap,sink,sinkwrap,STATUS_PTR)) 592 593 /* Vtab Initialiser. */ 594 #define astInitFitsChanVtab(vtab,name) astINVOKE(V,astInitFitsChanVtab_(vtab,name,STATUS_PTR)) 595 /* Loader. */ 596 #define astLoadFitsChan(mem,size,vtab,name,channel) \ 597 astINVOKE(O,astLoadFitsChan_(mem,size,vtab,name,astCheckChannel(channel),STATUS_PTR)) 598 #endif 599 600 601 /* More include files. */ 602 /* =================== */ 603 /* The interface to the FitsTable class must be included here (after the 604 type definitions for the FitsChan class) because "fitstable.h" itself 605 includes this file ("fitschan.h"), although "fitschan.h" refers to the 606 AstFitsTable structure above. This seems a little strange at first, 607 but is simply analogous to making a forward reference to a 608 structure type when recursively defining a normal C structure 609 (except that here the definitions happen to be in separate include 610 files). */ 611 #include "fitstable.h" 612 613 /* Interfaces to public member functions. */ 614 /* -------------------------------------- */ 615 /* Here we make use of astCheckFitsChan to validate FitsChan pointers 616 before use. This provides a contextual error report if a pointer 617 to the wrong sort of Object is supplied. */ 618 619 #define astPutFits(this,card,overwrite) \ 620 astINVOKE(V,astPutFits_(astCheckFitsChan(this),card,overwrite,STATUS_PTR)) 621 622 #define astPutCards(this,cards) \ 623 astINVOKE(V,astPutCards_(astCheckFitsChan(this),cards,STATUS_PTR)) 624 625 #define astDelFits(this) \ 626 astINVOKE(V,astDelFits_(astCheckFitsChan(this),STATUS_PTR)) 627 628 #define astPurgeWCS(this) \ 629 astINVOKE(V,astPurgeWCS_(astCheckFitsChan(this),STATUS_PTR)) 630 631 #define astGetTables(this) \ 632 astINVOKE(O,astGetTables_(astCheckFitsChan(this),STATUS_PTR)) 633 634 #define astPutTable(this,table,extnam) \ 635 astINVOKE(V,astPutTable_(astCheckFitsChan(this),astCheckFitsTable(table),extnam,STATUS_PTR)) 636 637 #define astPutTables(this,tables) \ 638 astINVOKE(V,astPutTables_(astCheckFitsChan(this),astCheckKeyMap(tables),STATUS_PTR)) 639 640 #define astRemoveTables(this,key) \ 641 astINVOKE(V,astRemoveTables_(astCheckFitsChan(this),key,STATUS_PTR)) 642 643 #define astRetainFits(this) \ 644 astINVOKE(V,astRetainFits_(astCheckFitsChan(this),STATUS_PTR)) 645 646 #define astFindFits( this, name, card, inc ) \ 647 astINVOKE(V,astFindFits_(astCheckFitsChan(this),name,card,inc,STATUS_PTR)) 648 649 #define astSetFitsI(this,name,value,comment,overwrite) \ 650 astINVOKE(V,astSetFitsI_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 651 652 #define astSetFitsF(this,name,value,comment,overwrite) \ 653 astINVOKE(V,astSetFitsF_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 654 655 #define astSetFitsS(this,name,value,comment,overwrite) \ 656 astINVOKE(V,astSetFitsS_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 657 658 #define astSetFitsCN(this,name,value,comment,overwrite) \ 659 astINVOKE(V,astSetFitsCN_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 660 661 #define astSetFitsCI(this,name,value,comment,overwrite) \ 662 astINVOKE(V,astSetFitsCI_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 663 664 #define astSetFitsCF(this,name,value,comment,overwrite) \ 665 astINVOKE(V,astSetFitsCF_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 666 667 #define astSetFitsL(this,name,value,comment,overwrite) \ 668 astINVOKE(V,astSetFitsL_(astCheckFitsChan(this),name,value,comment,overwrite,STATUS_PTR)) 669 670 #define astSetFitsU(this,name,comment,overwrite) \ 671 astINVOKE(V,astSetFitsU_(astCheckFitsChan(this),name,comment,overwrite,STATUS_PTR)) 672 673 #define astSetFitsCM(this,comment,overwrite) \ 674 astINVOKE(V,astSetFitsCM_(astCheckFitsChan(this),comment,overwrite,STATUS_PTR)) 675 676 #define astGetFitsCF(this,name,value) \ 677 astINVOKE(V,astGetFitsCF_(astCheckFitsChan(this),name,value,STATUS_PTR)) 678 679 #define astGetFitsCI(this,name,value) \ 680 astINVOKE(V,astGetFitsCI_(astCheckFitsChan(this),name,value,STATUS_PTR)) 681 682 #define astGetFitsF(this,name,value) \ 683 astINVOKE(V,astGetFitsF_(astCheckFitsChan(this),name,value,STATUS_PTR)) 684 685 #define astGetFitsI(this,name,value) \ 686 astINVOKE(V,astGetFitsI_(astCheckFitsChan(this),name,value,STATUS_PTR)) 687 688 #define astGetFitsL(this,name,value) \ 689 astINVOKE(V,astGetFitsL_(astCheckFitsChan(this),name,value,STATUS_PTR)) 690 691 #define astTestFits(this,name,there) \ 692 astINVOKE(V,astTestFits_(astCheckFitsChan(this),name,there,STATUS_PTR)) 693 694 #define astGetFitsS(this,name,value) \ 695 astINVOKE(V,astGetFitsS_(astCheckFitsChan(this),name,value,STATUS_PTR)) 696 697 #define astGetFitsCN(this,name,value) \ 698 astINVOKE(V,astGetFitsCN_(astCheckFitsChan(this),name,value,STATUS_PTR)) 699 700 #define astReadFits(this) \ 701 astINVOKE(V,astReadFits_(astCheckFitsChan(this),STATUS_PTR)) 702 703 #define astWriteFits(this) \ 704 astINVOKE(V,astWriteFits_(astCheckFitsChan(this),STATUS_PTR)) 705 706 #define astEmptyFits(this) \ 707 astINVOKE(V,astEmptyFits_(astCheckFitsChan(this),STATUS_PTR)) 708 709 #define astShowFits(this) \ 710 astINVOKE(V,astShowFits_(astCheckFitsChan(this),STATUS_PTR)) 711 712 #define astTableSource(this,tabsource) \ 713 astINVOKE(V,astTableSource_(astCheckFitsChan(this),tabsource,STATUS_PTR)) 714 715 716 #if defined(astCLASS) || defined(astFORTRAN77) /* Protected or F77 interface */ 717 718 #define astSetTableSource(this,tabsource,tabsource_wrap) \ 719 astINVOKE(V,astSetTableSource_(astCheckFitsChan(this),tabsource,tabsource_wrap,STATUS_PTR)) 720 721 #endif 722 723 724 #if defined(astCLASS) /* Protected */ 725 726 #define astFitsEof(this) \ 727 astINVOKE(V,astFitsEof_(astCheckFitsChan(this),STATUS_PTR)) 728 729 #define astFitsGetCom(this,name,comment) \ 730 astINVOKE(V,astFitsGetCom_(astCheckFitsChan(this),name,comment,STATUS_PTR)) 731 732 #define astSetFitsCom(this,name,comment,overwrite) \ 733 astINVOKE(V,astSetFitsCom_(astCheckFitsChan(this),name,comment,overwrite,STATUS_PTR)) 734 735 #define astKeyFields(this,filter,maxfld,ubnd,lbnd) \ 736 astINVOKE(V,astKeyFields_(astCheckFitsChan(this),filter,maxfld,ubnd,lbnd,STATUS_PTR)) 737 738 #define astClearCard(this) \ 739 astINVOKE(V,astClearCard_(astCheckFitsChan(this),STATUS_PTR)) 740 #define astGetCard(this) \ 741 astINVOKE(V,astGetCard_(astCheckFitsChan(this),STATUS_PTR)) 742 #define astSetCard(this,card) \ 743 astINVOKE(V,astSetCard_(astCheckFitsChan(this),card,STATUS_PTR)) 744 #define astTestCard(this) \ 745 astINVOKE(V,astTestCard_(astCheckFitsChan(this),STATUS_PTR)) 746 747 #define astClearDefB1950(this) \ 748 astINVOKE(V,astClearDefB1950_(astCheckFitsChan(this),STATUS_PTR)) 749 #define astGetDefB1950(this) \ 750 astINVOKE(V,astGetDefB1950_(astCheckFitsChan(this),STATUS_PTR)) 751 #define astSetDefB1950(this,defb950) \ 752 astINVOKE(V,astSetDefB1950_(astCheckFitsChan(this),defb950,STATUS_PTR)) 753 #define astTestDefB1950(this) \ 754 astINVOKE(V,astTestDefB1950_(astCheckFitsChan(this),STATUS_PTR)) 755 756 #define astClearTabOK(this) \ 757 astINVOKE(V,astClearTabOK_(astCheckFitsChan(this),STATUS_PTR)) 758 #define astGetTabOK(this) \ 759 astINVOKE(V,astGetTabOK_(astCheckFitsChan(this),STATUS_PTR)) 760 #define astSetTabOK(this,tabok) \ 761 astINVOKE(V,astSetTabOK_(astCheckFitsChan(this),tabok,STATUS_PTR)) 762 #define astTestTabOK(this) \ 763 astINVOKE(V,astTestTabOK_(astCheckFitsChan(this),STATUS_PTR)) 764 765 #define astClearCDMatrix(this) \ 766 astINVOKE(V,astClearCDMatrix_(astCheckFitsChan(this),STATUS_PTR)) 767 #define astGetCDMatrix(this) \ 768 astINVOKE(V,astGetCDMatrix_(astCheckFitsChan(this),STATUS_PTR)) 769 #define astSetCDMatrix(this,cdmatrix) \ 770 astINVOKE(V,astSetCDMatrix_(astCheckFitsChan(this),cdmatrix,STATUS_PTR)) 771 #define astTestCDMatrix(this) \ 772 astINVOKE(V,astTestCDMatrix_(astCheckFitsChan(this),STATUS_PTR)) 773 774 #define astClearPolyTan(this) \ 775 astINVOKE(V,astClearPolyTan_(astCheckFitsChan(this),STATUS_PTR)) 776 #define astGetPolyTan(this) \ 777 astINVOKE(V,astGetPolyTan_(astCheckFitsChan(this),STATUS_PTR)) 778 #define astSetPolyTan(this,value) \ 779 astINVOKE(V,astSetPolyTan_(astCheckFitsChan(this),value,STATUS_PTR)) 780 #define astTestPolyTan(this) \ 781 astINVOKE(V,astTestPolyTan_(astCheckFitsChan(this),STATUS_PTR)) 782 783 #define astClearCarLin(this) \ 784 astINVOKE(V,astClearCarLin_(astCheckFitsChan(this),STATUS_PTR)) 785 #define astGetCarLin(this) \ 786 astINVOKE(V,astGetCarLin_(astCheckFitsChan(this),STATUS_PTR)) 787 #define astSetCarLin(this,carln) \ 788 astINVOKE(V,astSetCarLin_(astCheckFitsChan(this),carln,STATUS_PTR)) 789 #define astTestCarLin(this) \ 790 astINVOKE(V,astTestCarLin_(astCheckFitsChan(this),STATUS_PTR)) 791 792 #define astClearClean(this) \ 793 astINVOKE(V,astClearClean_(astCheckFitsChan(this),STATUS_PTR)) 794 #define astGetClean(this) \ 795 astINVOKE(V,astGetClean_(astCheckFitsChan(this),STATUS_PTR)) 796 #define astSetClean(this,value) \ 797 astINVOKE(V,astSetClean_(astCheckFitsChan(this),value,STATUS_PTR)) 798 #define astTestClean(this) \ 799 astINVOKE(V,astTestClean_(astCheckFitsChan(this),STATUS_PTR)) 800 801 #define astClearFitsDigits(this) \ 802 astINVOKE(V,astClearFitsDigits_(astCheckFitsChan(this),STATUS_PTR)) 803 #define astGetFitsDigits(this) \ 804 astINVOKE(V,astGetFitsDigits_(astCheckFitsChan(this),STATUS_PTR)) 805 #define astSetFitsDigits(this,fitsdigits) \ 806 astINVOKE(V,astSetFitsDigits_(astCheckFitsChan(this),fitsdigits,STATUS_PTR)) 807 #define astTestFitsDigits(this) \ 808 astINVOKE(V,astTestFitsDigits_(astCheckFitsChan(this),STATUS_PTR)) 809 810 #define astClearFitsAxisOrder(this) \ 811 astINVOKE(V,astClearFitsAxisOrder_(astCheckFitsChan(this),STATUS_PTR)) 812 #define astGetFitsAxisOrder(this) \ 813 astINVOKE(V,astGetFitsAxisOrder_(astCheckFitsChan(this),STATUS_PTR)) 814 #define astSetFitsAxisOrder(this,fitsaxisorder) \ 815 astINVOKE(V,astSetFitsAxisOrder_(astCheckFitsChan(this),fitsaxisorder,STATUS_PTR)) 816 #define astTestFitsAxisOrder(this) \ 817 astINVOKE(V,astTestFitsAxisOrder_(astCheckFitsChan(this),STATUS_PTR)) 818 819 #define astClearWarnings(this) \ 820 astINVOKE(V,astClearWarnings_(astCheckFitsChan(this),STATUS_PTR)) 821 #define astGetWarnings(this) \ 822 astINVOKE(V,astGetWarnings_(astCheckFitsChan(this),STATUS_PTR)) 823 #define astSetWarnings(this,warnings) \ 824 astINVOKE(V,astSetWarnings_(astCheckFitsChan(this),warnings,STATUS_PTR)) 825 #define astTestWarnings(this) \ 826 astINVOKE(V,astTestWarnings_(astCheckFitsChan(this),STATUS_PTR)) 827 828 #define astGetAllWarnings(this) \ 829 astINVOKE(V,astGetAllWarnings_(astCheckFitsChan(this),STATUS_PTR)) 830 831 #define astGetCardType(this) \ 832 astINVOKE(V,astGetCardType_(astCheckFitsChan(this),STATUS_PTR)) 833 834 #define astGetCardName(this) \ 835 astINVOKE(V,astGetCardName_(astCheckFitsChan(this),STATUS_PTR)) 836 837 #define astGetCardComm(this) \ 838 astINVOKE(V,astGetCardComm_(astCheckFitsChan(this),STATUS_PTR)) 839 840 #define astGetNcard(this) \ 841 astINVOKE(V,astGetNcard_(astCheckFitsChan(this),STATUS_PTR)) 842 843 #define astGetNkey(this) \ 844 astINVOKE(V,astGetNkey_(astCheckFitsChan(this),STATUS_PTR)) 845 846 #define astClearEncoding(this) \ 847 astINVOKE(V,astClearEncoding_(astCheckFitsChan(this),STATUS_PTR)) 848 #define astGetEncoding(this) \ 849 astINVOKE(V,astGetEncoding_(astCheckFitsChan(this),STATUS_PTR)) 850 #define astSetEncoding(this,encoding) \ 851 astINVOKE(V,astSetEncoding_(astCheckFitsChan(this),encoding,STATUS_PTR)) 852 #define astTestEncoding(this) \ 853 astINVOKE(V,astTestEncoding_(astCheckFitsChan(this),STATUS_PTR)) 854 855 #define astClearIwc(this) \ 856 astINVOKE(V,astClearIwc_(astCheckFitsChan(this),STATUS_PTR)) 857 #define astGetIwc(this) \ 858 astINVOKE(V,astGetIwc_(astCheckFitsChan(this),STATUS_PTR)) 859 #define astSetIwc(this,iwc) \ 860 astINVOKE(V,astSetIwc_(astCheckFitsChan(this),iwc,STATUS_PTR)) 861 #define astTestIwc(this) \ 862 astINVOKE(V,astTestIwc_(astCheckFitsChan(this),STATUS_PTR)) 863 864 #endif 865 866 #endif 867 868 869 870 871 872