From fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 8 Jul 2015 20:46:52 -0400 Subject: Initial commit --- pkg/tbtables/tbfgcm.x | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkg/tbtables/tbfgcm.x (limited to 'pkg/tbtables/tbfgcm.x') diff --git a/pkg/tbtables/tbfgcm.x b/pkg/tbtables/tbfgcm.x new file mode 100644 index 00000000..22e483ad --- /dev/null +++ b/pkg/tbtables/tbfgcm.x @@ -0,0 +1,50 @@ +include +include "tbtables.h" + +# tbfgcm -- get a comment for a FITS header parameter +# +# Phil Hodge, 6-Jul-1995 Subroutine created + +procedure tbfgcm (tp, keyword, comment, maxch) + +pointer tp # i: pointer to table descriptor +char keyword[SZ_KEYWORD] # i: keyword to be found +char comment[ARB] # o: comment string for keyword +int maxch # i: max size of comment +#-- +pointer sp +pointer value # scratch for value (ignored) +pointer cmt # scratch for comment; also for error message +int status # zero is OK +bool streq() +errchk tbferr + +begin + call smark (sp) + call salloc (value, SZ_LINE, TY_CHAR) + call salloc (cmt, SZ_LINE, TY_CHAR) + + # Check for history or comment. + call strcpy (keyword, Memc[value], SZ_LINE) # temp + call strupr (Memc[value]) + if (streq (Memc[value], "HISTORY") || + streq (Memc[value], "COMMENT") || + streq (Memc[value], " ") || keyword[1] == EOS) { + + comment[1] = EOS + call sfree (sp) + return + } + + status = 0 + + # Get the value and comment. + call fsgkey (TB_FILE(tp), keyword, Memc[value], Memc[cmt], status) + + if (status != 0) + call tbferr (status) + + call strcpy (Memc[cmt], comment, maxch) + + call sfree (sp) +end -- cgit