aboutsummaryrefslogtreecommitdiff
path: root/sys/clio/clgwrd.x
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-07-08 20:46:52 -0400
commitfa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch)
treebdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/clio/clgwrd.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'sys/clio/clgwrd.x')
-rw-r--r--sys/clio/clgwrd.x33
1 files changed, 33 insertions, 0 deletions
diff --git a/sys/clio/clgwrd.x b/sys/clio/clgwrd.x
new file mode 100644
index 00000000..0dd6ee49
--- /dev/null
+++ b/sys/clio/clgwrd.x
@@ -0,0 +1,33 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <syserr.h>
+
+# CLGWRD -- Get a keyword parameter from the CL, and match it against
+# a dictionary of legal keywords. Any unambiguous abbreviation is
+# accepted. The full keyword string is returned in keyword, and the
+# word index of the keyword in the dictionary is returned as the function
+# value.
+
+int procedure clgwrd (param, keyword, maxchar, dictionary)
+
+char param[ARB] # CL parameter string
+char keyword[ARB] # String matched in dictionary
+int maxchar # Maximum size of str
+char dictionary[ARB] # Dictionary string
+
+pointer sp, abbrev
+int kwindex, strdic()
+
+begin
+ call smark (sp)
+ call salloc (abbrev, SZ_FNAME, TY_CHAR)
+
+ call clgstr (param, Memc[abbrev], maxchar)
+ kwindex = strdic (Memc[abbrev], keyword, maxchar, dictionary)
+
+ if (kwindex <= 0)
+ call syserrs (SYS_CLGWRD, Memc[abbrev])
+
+ call sfree (sp)
+ return (kwindex)
+end