qfits_table.h

00001 /* $Id: qfits_table.h,v 1.1.1.1 2008/11/03 13:40:49 agabasch Exp $
00002  *
00003  * This file is part of the ESO QFITS Library
00004  * Copyright (C) 2001-2004 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: agabasch $
00023  * $Date: 2008/11/03 13:40:49 $
00024  * $Revision: 1.1.1.1 $
00025  * $Name: midi-2_7_0 $
00026  */
00027 
00028 #ifndef QFITS_TABLE_H
00029 #define QFITS_TABLE_H
00030 
00031 /*-----------------------------------------------------------------------------
00032                                    Includes
00033  -----------------------------------------------------------------------------*/
00034 
00035 #include <stdio.h>
00036 #include <string.h>
00037 #include <stdlib.h>
00038 #include <unistd.h>
00039     
00040 #include "qfits_header.h"
00041 
00042 /*-----------------------------------------------------------------------------
00043                                    Defines
00044  -----------------------------------------------------------------------------*/
00045 
00046 /* The following defines the maximum acceptable size for a FITS value */
00047 #define FITSVALSZ                    60
00048 
00049 #define QFITS_INVALIDTABLE            0
00050 #define QFITS_BINTABLE                1
00051 #define QFITS_ASCIITABLE            2
00052 
00053 /*-----------------------------------------------------------------------------
00054                                    New types
00055  -----------------------------------------------------------------------------*/
00056 
00057 /*----------------------------------------------------------------------------*/
00061 /*----------------------------------------------------------------------------*/
00062 typedef enum _TFITS_DATA_TYPE_ {
00063     TFITS_ASCII_TYPE_A,
00064     TFITS_ASCII_TYPE_D,
00065     TFITS_ASCII_TYPE_E,
00066     TFITS_ASCII_TYPE_F,
00067     TFITS_ASCII_TYPE_I,
00068     TFITS_BIN_TYPE_A,
00069     TFITS_BIN_TYPE_B,
00070     TFITS_BIN_TYPE_C,
00071     TFITS_BIN_TYPE_D,
00072     TFITS_BIN_TYPE_E,
00073     TFITS_BIN_TYPE_I,
00074     TFITS_BIN_TYPE_J,
00075     TFITS_BIN_TYPE_L,
00076     TFITS_BIN_TYPE_M,
00077     TFITS_BIN_TYPE_P,
00078     TFITS_BIN_TYPE_X,
00079     TFITS_BIN_TYPE_UNKNOWN
00080 } tfits_type ;
00081 
00082 /*----------------------------------------------------------------------------*/
00093 /*----------------------------------------------------------------------------*/
00094 typedef struct qfits_col
00095 {
00104     int            atom_nb ;
00105 
00110     int         atom_dec_nb ;
00111 
00131     int            atom_size ;    
00132     
00138     tfits_type    atom_type ;
00139 
00141     char        tlabel[FITSVALSZ] ;
00142 
00144     char        tunit[FITSVALSZ] ;
00145     
00147     char        nullval[FITSVALSZ] ;
00148 
00150     char        tdisp[FITSVALSZ] ;
00151     
00158     int            zero_present ;    
00159     float        zero ;        
00160     int            scale_present ;
00161     float        scale ;   
00162 
00164     int            off_beg ;
00165     
00167     int            readable ;
00168 } qfits_col ;
00169 
00170 
00171 /*----------------------------------------------------------------------------*/
00201 /*----------------------------------------------------------------------------*/
00202 typedef struct qfits_table
00203 {
00207     char            filename[512] ;
00212     int                tab_t ;
00214     int                tab_w ;            
00216     int                nc ;            
00218     int                nr ;
00220     qfits_col    *    col ;            
00221 } qfits_table ;
00222 
00223 /*-----------------------------------------------------------------------------
00224                                Function prototypes
00225  -----------------------------------------------------------------------------*/
00226 
00227 int qfits_is_table(const char * filename, int xtnum) ;
00228 qfits_header * qfits_table_prim_header_default(void) ;
00229 qfits_header * qfits_table_ext_header_default(const qfits_table *) ;
00230 qfits_table * qfits_table_new(const char *, int, int, int, int) ;
00231 int qfits_col_fill(qfits_col *, int, int, int, tfits_type, const char *, 
00232         const char *, const char *, const char *, int, float, int, float, int) ;
00233 qfits_table * qfits_table_open(const char *, int) ;
00234 void qfits_table_close(qfits_table *) ;
00235 unsigned char * qfits_query_column(const qfits_table *, int, const int *) ;
00236 unsigned char * qfits_query_column_seq(const qfits_table *, int, int, int) ;
00237 void * qfits_query_column_data(const qfits_table *, int, const int *, 
00238         const void *) ;
00239 void * qfits_query_column_seq_data(const qfits_table *, int, int, int, 
00240         const void *) ;
00241 int * qfits_query_column_nulls(const qfits_table *, int, const int *, int *, 
00242         int *);
00243 int qfits_save_table_hdrdump(const void **, const qfits_table *, 
00244         const qfits_header *) ;
00245 int qfits_table_append_xtension(FILE *, const qfits_table *, const void **) ;
00246 int qfits_table_append_xtension_hdr(FILE *, const qfits_table *, const void **,
00247         const qfits_header *) ;
00248 char * qfits_table_field_to_string(const qfits_table *, int, int, int) ;
00249 
00250 #endif

Generated on 11 Feb 2011 for C Standard Library Extensions by  doxygen 1.6.1