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

int qfits_header_getint ( const qfits_header hdr,
const char *  key,
int  errval 
)

Return the value associated to a key, as an int.

Parameters:
hdr qfits_header to parse
key key to find
errval default value to return if nothing is found
Returns:
int
Finds the value associated to the given key and return it as an int. Returns errval if no matching key is found or no value is attached.

Definition at line 727 of file qfits_header.c.

References qfits_header_getstr().

Referenced by qfitsloader_init().

{
    char    *   c ;
    int         d ;

    if (hdr==NULL || key==NULL) return errval ;

    c = qfits_header_getstr(hdr, key);
    if (c==NULL) return errval ;
    if (sscanf(c, "%d", &d)!=1) return errval ;
    return d ;
}


Generated by  Doxygen 1.6.0   Back to index