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

void qfits_header_add_after ( qfits_header hdr,
const char *  after,
const char *  key,
const char *  val,
const char *  com,
const char *  lin 
)

add a new card to a FITS header

Parameters:
hdr qfits_header object to modify
after Key to specify insertion place
key FITS key
val FITS value
com FITS comment
lin FITS original line if exists
Returns:
void
Adds a new card to a FITS header, after the specified key. Nothing happens if the specified key is not found in the header. All fields can be NULL, except after and key.

Definition at line 288 of file qfits_header.c.

References first, n, and qfits_expand_keyword().

{
    keytuple    *   kreq;
    keytuple    *   k;
    char        *   exp_after ;

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

    exp_after = qfits_expand_keyword(after);
    /* Locate where the entry is requested */
    kreq = (keytuple*)(hdr->first) ;
    while (kreq!=NULL) {
        if (!strcmp(kreq->key, exp_after)) break ;
        kreq = kreq->next ;
    }
    if (kreq==NULL) return ;
    k = keytuple_new(key, val, com, lin);

    k->next = kreq->next ;
    kreq->next->prev = k ;
    kreq->next = k ;
    k->prev = kreq ;
    hdr->n ++ ;
    return ;
}


Generated by  Doxygen 1.6.0   Back to index