Logo Search packages:      
Sourcecode: qfits version File versions  Download package

int qfits_get_datinfo ( const char *  filename,
int  xtnum,
int *  seg_start,
int *  seg_size 
)

Retrieve offset to start and size of a data section in a file.

Parameters:
filename Name of the file to examine.
xtnum Extension number (0 for main).
seg_start Segment start in bytes (output).
seg_size Segment size in bytes (output).
Returns:
int 0 if Ok, -1 otherwise.
This function retrieves the two most important informations about a data section in a FITS file: the offset to its beginning, and the size of the section in bytes. Both values are returned in the passed pointers to ints. It is Ok to pass NULL for any pointer if you do not want to retrieve the associated value.

You must provide an extension number for the header, 0 meaning the main header in the file.

Definition at line 490 of file qfits_rw.c.

References qfits_query().

Referenced by qfits_table_open(), and qfitsloader_init().

{
    if (filename==NULL || xtnum<0 || (seg_start==NULL && seg_size==NULL)) {
        return -1 ;
    }
    if (seg_start!=NULL) {
        *seg_start = qfits_query(filename, QFITS_QUERY_DAT_START | xtnum);
        if (*seg_start<0)
            return -1 ;
    }
    if (seg_size!=NULL) {
        *seg_size = qfits_query(filename, QFITS_QUERY_DAT_SIZE | xtnum);
        if (*seg_size<0)
            return -1 ;
    }
    return 0 ;  
}


Generated by  Doxygen 1.6.0   Back to index