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

void qfits_header_mod ( qfits_header hdr,
const char *  key,
const char *  val,
const char *  com 
)

Modifies a FITS card.

Parameters:
hdr qfits_header to modify
key FITS key
val FITS value
com FITS comment
Returns:
void
Finds the first card in the header matching 'key', and replaces its value and comment fields by the provided values. The initial FITS line is set to NULL in the card.

Definition at line 410 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->val) qfits_free(k->val);
    if (k->com) qfits_free(k->com);
    if (k->lin) qfits_free(k->lin);
    k->val = NULL ;
    k->com = NULL ;
    k->lin = NULL ;
    if (val) {
        if (strlen(val)>0) k->val = qfits_strdup(val);
    }
    if (com) {
        if (strlen(com)>0) k->com = qfits_strdup(com);
    }
    return ;
}


Generated by  Doxygen 1.6.0   Back to index