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

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

Append a new card to a FITS header.

Parameters:
hdr qfits_header object to modify
key FITS key
val FITS value
com FITS comment
lin FITS original line if exists
Returns:
void
Adds a new card in a FITS header as the last one. All fields can be NULL except key.

Definition at line 334 of file qfits_header.c.

References first, last, and n.

Referenced by qfits_header_copy(), qfits_header_default(), qfits_header_read_hdr(), qfits_header_read_hdr_string(), qfits_header_readext(), qfits_table_ext_header_default(), and qfits_table_prim_header_default().

{
    keytuple    *    k;
    keytuple    *    last ;

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

    k = keytuple_new(key, val, com, lin);
    if (hdr->n==0) {
        hdr->first = hdr->last = k ;
        hdr->n = 1 ;
        return ;
    }
    last  = (keytuple*)hdr->last ;
    last->next = k ;
    k->prev = last ;
    hdr->last = k ;
    hdr->n++ ;
    return ;
}


Generated by  Doxygen 1.6.0   Back to index