next up previous contents
Next: 6. Setting Keyword Values Up: CFHT FITS Handling Library Previous: 4. Examining Extensions and   Contents

Subsections

5. Getting Keyword Values

5.1 fh_get_bool()

Returns FH_SUCCESS if `name' is found and contains either T or F (and not as a string, but as a `logical' FITS card.)

5.2 fh_get_int()

Returns FH_SUCCESS if `name' is found and contains a valid integer. A floating point value (with a decimal point) is not a valid integer. *value will contain the value as converted by the C strtol() function.

5.3 fh_get_flt()

Returns FH_SUCCESS if `name' is found and contains a valid float (real) value. *value will contain the result of the C strtod() function.

5.4 fh_get_str()

Returns FH_SUCCESS if `name' is found and contains a FITS string in single quotes ('...'). *value will contain a '$\backslash$0'-terminated list of (up to) the first maxlen characters. (Always pass buffers of 80 characters to be sure strings will not have to be truncated.)

5.5 fh_search()

Use this to see if a keyword exists. A return of FH_SUCCESS means the keyword exists. If you pass a non-NULL pointer in `idx', the current `idx' will be returned in *idx.

5.6 fh_show()

Prints the first 79 columns of each card to stdout. Column 80 is replaced by a newline, so the terminal doesn't have to have exactly 80 columns to display properly, and the search-forward ('/' key) of `less' can be used.

See the example fhlist.c.

5.7 fh_idx_after()

5.8 fh_idx_before()

Use these functions to obtain `idx' numbers which would cause a new card to appear just before or after an existing card. Note that if the ``new'' card already exists too, it will be replaced and will not be relocated in the header.

Pass the return of this function as the `idx' argument to the fh_set*() routines. Alternatively, you can pass FH_AUTO or a fixed value (see the section on `idx' numbers.)


next up previous contents
Next: 6. Setting Keyword Values Up: CFHT FITS Handling Library Previous: 4. Examining Extensions and   Contents
Sidik Isani
2001-04-25