C Standard Library Extensions: Card handling functions

C Standard Library Extensions 6.2.0

- Main Page
- Modules
- Classes
- Files

Functions
Card handling functions

## Functions
void | qfits_card_build (char *line, const char *key, const char *val, const char *com)
| Write out a card to a string on 80 chars.
char * | qfits_getkey (const char *line)
| Find the keyword in a key card (80 chars)
char * | qfits_getvalue (const char *line)
| Find the value in a key card (80 chars)
char * | qfits_getcomment (const char *line)
| Find the comment in a key card (80 chars)
char * | qfits_expand_keyword (const char *keyword)
| Expand a keyword from shortFITS to HIERARCH notation.

## Detailed Description

This module contains various routines to help parsing a single FITS card into its components: key, value, comment.

## Function Documentation

void qfits_card_build | ( | char * | line,
|  | const char * | key,
|  | const char * | val,
|  | const char * | com
| ) |  |

Write out a card to a string on 80 chars.

Parameters:

  line | Allocated output character buffer.
  key | Key to write.
  val | Value to write.
  com | Comment to write.

Returns:
  void

Write out a key, value and comment into an allocated character buffer. The buffer must be at least 80 chars to receive the information. Formatting is done according to FITS standard.

References qfits_is_boolean(), qfits_is_complex(), qfits_is_float(), qfits_is_int(), and qfits_pretty_string().

char* qfits_expand_keyword | ( | const char * | keyword | ) |

Expand a keyword from shortFITS to HIERARCH notation.

Parameters:

  keyword | Keyword to expand.

Returns:
  1 pointer to statically allocated string.

This function expands a given keyword from shortFITS to HIERARCH notation, bringing it to uppercase at the same time.

Examples:

      det.dit          expands to     HIERARCH ESO DET DIT
      ins.filt1.id     expands to     HIERARCH ESO INS FILT1 ID

If the input keyword is a regular FITS keyword (i.e. it contains not dots '.') the result is identical to the input.

Referenced by qfits_header_add_after(), qfits_header_del(), qfits_header_getcom(), qfits_header_getstr(), qfits_header_mod(), qfits_query_card(), qfits_query_ext(), and qfits_replace_card().

char* qfits_getcomment | ( | const char * | line | ) |

Find the comment in a key card (80 chars)

Parameters:

  line | allocated 80-char line from a FITS header

Returns:
  statically allocated char *

Find out the part of a FITS line corresponding to the comment. Returns NULL in case of error, or if no comment can be found. The returned pointer is statically allocated in this function, so do not modify or try to free it.

Referenced by qfits_header_read_hdr(), qfits_header_read_hdr_string(), and qfits_header_readext().

char* qfits_getkey | ( | const char * | line | ) |

Find the keyword in a key card (80 chars)

Parameters:

  line | allocated 80-char line from a FITS header

Returns:
  statically allocated char *

Find out the part of a FITS line corresponding to the keyword. Returns NULL in case of error. The returned pointer is statically allocated in this function, so do not modify or try to free it.

Referenced by qfits_header_read_hdr(), qfits_header_read_hdr_string(), and qfits_header_readext().

char* qfits_getvalue | ( | const char * | line | ) |

Find the value in a key card (80 chars)

Parameters:

  line | allocated 80-char line from a FITS header

Returns:
  statically allocated char *

Find out the part of a FITS line corresponding to the value. Returns NULL in case of error, or if no value can be found. The returned pointer is statically allocated in this function, so do not modify or try to free it.

Referenced by qfits_header_read_hdr(), qfits_header_read_hdr_string(), qfits_header_readext(), and qfits_query_ext().