From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- pkg/xtools/inlfit/infreer.x | 52 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pkg/xtools/inlfit/infreer.x (limited to 'pkg/xtools/inlfit/infreer.x') diff --git a/pkg/xtools/inlfit/infreer.x b/pkg/xtools/inlfit/infreer.x new file mode 100644 index 00000000..55136dfd --- /dev/null +++ b/pkg/xtools/inlfit/infreer.x @@ -0,0 +1,52 @@ +include "inlfitdef.h" + + +# IN_FREE -- Free INLFIT parameter structure, substructures, and auxiliary +# buffers. + +procedure in_freer (in) + +pointer in # INLFIT pointer + +begin + +# # Debug. +# call eprintf ("in_free: in=%d\n") +# call pargi (in) + + # Free only if it's not NULL. + if (in != NULL) { + + # Free parameter values, changes, and list. + call mfree (IN_PARAM (in), TY_REAL) + call mfree (IN_DPARAM (in), TY_REAL) + call mfree (IN_PLIST (in), TY_INT) + + # Free string space. + call mfree (IN_LABELS (in), TY_CHAR) + call mfree (IN_UNITS (in), TY_CHAR) + call mfree (IN_PLABELS (in), TY_CHAR) + call mfree (IN_PUNITS (in), TY_CHAR) + call mfree (IN_VLABELS (in), TY_CHAR) + call mfree (IN_VUNITS (in), TY_CHAR) + call mfree (IN_USERLABELS (in), TY_CHAR) + call mfree (IN_USERUNITS (in), TY_CHAR) + call mfree (IN_HELP (in), TY_CHAR) + call mfree (IN_PROMPT (in), TY_CHAR) + + # Free rejected point list, and limit values for variables. + if (IN_REJPTS (in) != NULL) + call mfree (IN_REJPTS (in), TY_INT) + if (IN_XMIN (in) != NULL) + call mfree (IN_XMIN (in), TY_REAL) + if (IN_XMAX (in) != NULL) + call mfree (IN_XMAX (in), TY_REAL) + + # Free substructures. + call mfree (IN_SFLOAT (in), TY_REAL) + call mfree (IN_SGAXES (in), TY_INT) + + # Free structure. + call mfree (in, TY_STRUCT) + } +end -- cgit