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

char* qfits_header_getcom ( const qfits_header hdr,
const char *  key 
)

Return the comment associated to a key, as a string.

Parameters:
hdr qfits_header to parse
key key to find
Returns:
pointer to statically allocated string
Finds the comment associated to the given key and return it as a string. The returned pointer is statically allocated, so do not modify its contents or try to free it.

Returns NULL if no matching key is found or no comment is attached.

Definition at line 697 of file qfits_header.c.

References first, and qfits_expand_keyword().

{
    keytuple    *   k ;
    char        *   xkey ;

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

    xkey = qfits_expand_keyword(key);
    k = (keytuple*)hdr->first ;
    while (k!=NULL) {
        if (!strcmp(k->key, xkey)) break ;
        k=k->next ;
    }
    if (k==NULL) return NULL ;
    return k->com ;
}


Generated by  Doxygen 1.6.0   Back to index