diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /pkg/xtools/inlfit/ingvars.gx | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
Diffstat (limited to 'pkg/xtools/inlfit/ingvars.gx')
-rw-r--r-- | pkg/xtools/inlfit/ingvars.gx | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pkg/xtools/inlfit/ingvars.gx b/pkg/xtools/inlfit/ingvars.gx new file mode 100644 index 00000000..291284a0 --- /dev/null +++ b/pkg/xtools/inlfit/ingvars.gx @@ -0,0 +1,55 @@ +include <pkg/inlfit.h> + +# ING_VARIABLES -- Write the variable numbers, names and minimum and maximum +# values to a file. + +procedure ing_variables$t (in, file, nvars) + +pointer in # pointer to the inlfit structure +char file[ARB] # output file name +int nvars # number of variables + +int i, fd +pointer sp, labels, pvnames, name, minptr, maxptr +int open(), inlstrwrd() +pointer in_getp() + +begin + if (file[1] == EOS) + return + fd = open (file, APPEND, TEXT_FILE) + + call smark (sp) + call salloc (labels, SZ_LINE, TY_CHAR) + call salloc (pvnames, SZ_LINE, TY_CHAR) + call salloc (name, SZ_LINE, TY_CHAR) + call in_gstr (in, INLVLABELS, Memc[labels], SZ_LINE) + call strcpy (Memc[labels], Memc[pvnames], SZ_LINE) + + # Print the title string. + call fprintf (fd, "\n%-10.10s %-10.10s %14.14s %14.14s\n") + call pargstr ("number") + call pargstr ("variable") + call pargstr ("minimum") + call pargstr ("maximum") + + # Print the variables. + minptr = in_getp (in, INLXMIN) + maxptr = in_getp (in, INLXMAX) + do i = 1, nvars { + if (inlstrwrd (i, Memc[name], SZ_LINE, Memc[pvnames]) == 0) { + call sprintf (Memc[name], SZ_LINE, "var %d") + call pargi (i) + } + call fprintf (fd, "%-10.2d %-10.10s ") + call pargi (i) + call pargstr (Memc[name]) + call fprintf (fd, "%14.7f %14.7f\n") + call parg$t (Mem$t[minptr+i-1]) + call parg$t (Mem$t[maxptr+i-1]) + } + call fprintf (fd, "\n") + + call close (fd) + call sfree (sp) +end |