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/utilities/nttools/threed/tiimage/tmhc.x | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 pkg/utilities/nttools/threed/tiimage/tmhc.x (limited to 'pkg/utilities/nttools/threed/tiimage/tmhc.x') diff --git a/pkg/utilities/nttools/threed/tiimage/tmhc.x b/pkg/utilities/nttools/threed/tiimage/tmhc.x new file mode 100644 index 00000000..30ad4eb3 --- /dev/null +++ b/pkg/utilities/nttools/threed/tiimage/tmhc.x @@ -0,0 +1,57 @@ +include + +# TM_HC -- Get column name from image header and copy image into table. +# +# +# +# +# Revision history: +# ---------------- +# 30-Jan-97 - Task created (I.Busko) + + +procedure tm_hc (tp, cp, ncp, row, rflag, im) + +pointer tp # table pointer +pointer cp # column pointer array +int ncp # size of column pointer array +int row # row where to begin insertion +bool rflag # use row number in header ? +pointer im # image pointer +#-- +pointer sp, colname, cn, duma +int i, dumi +bool match + +errchk tm_header, tm_copy + +bool streq() + +begin + call smark (sp) + call salloc (colname, SZ_COLNAME, TY_CHAR) + call salloc (cn, SZ_COLNAME, TY_CHAR) + call salloc (duma, max(SZ_COLUNITS,SZ_COLFMT),TY_CHAR) + + # Get column name from image header. + call tm_header (im, Memc[colname], Memc[duma], Memc[duma]) + + # Loop over table columns. + match = false + do i = 1, ncp { + + # Get column name from table. + call tbcinf (Memi[cp+i-1], dumi, Memc[cn], Memc[duma], + Memc[duma], dumi, dumi, dumi) + + # Copy array if names match. + if (streq (Memc[colname], Memc[cn])) { + call tm_copy (tp, Memi[cp+i-1], row, rflag, im) + match = true + } + } + if (!match) + call error (1, "No column matched.") + + call sfree (sp) +end -- cgit