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

void qfits_header_del ( qfits_header hdr,
const char *  key 
)

Delete a card in a FITS header.

Parameters:
hdr qfits_header to modify
key specifies which card to remove
Returns:
void
Removes a card from a FITS header. The first found card that matches the key is removed.

Definition at line 371 of file qfits_header.c.

References first, and qfits_expand_keyword().

{
    keytuple    *   k ;
    char        *   xkey ;

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

    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 ;
    if(k == hdr->first) {
        hdr->first = k->next ;
    } else {
        k->prev->next = k->next ;
        k->next->prev = k->prev ;
    }
    keytuple_del(k);
    return ;
}


Generated by  Doxygen 1.6.0   Back to index