aboutsummaryrefslogtreecommitdiff
path: root/sys/clio/clputc.x
diff options
context:
space:
mode:
Diffstat (limited to 'sys/clio/clputc.x')
-rw-r--r--sys/clio/clputc.x36
1 files changed, 36 insertions, 0 deletions
diff --git a/sys/clio/clputc.x b/sys/clio/clputc.x
new file mode 100644
index 00000000..333160fe
--- /dev/null
+++ b/sys/clio/clputc.x
@@ -0,0 +1,36 @@
+# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.
+
+include <ctype.h>
+
+# CLPUTC -- Put a character constant type parameter to the CL.
+
+procedure clputc (param, cval)
+
+char param[ARB]
+char cval
+
+pointer sp, value, pname
+pointer clc_find()
+
+begin
+ call smark (sp)
+ call salloc (value, SZ_FNAME, TY_CHAR)
+ call salloc (pname, SZ_FNAME, TY_CHAR)
+
+ # Character constants are stored as strings in the CL. Add single
+ # quotes about the character value to deimit the string. The
+ # character may be represented as a single character or as an escape
+ # sequence.
+
+ call sprintf (Memc[value], SZ_FNAME, "'%c'")
+ call pargc (cval)
+ call fprintf (CLOUT, "%s = %s\n")
+ call pargstr (param)
+ call pargstr (Memc[value])
+
+ # If the parameter is in the cache, update the cached value as well.
+ if (clc_find (param, Memc[pname], SZ_FNAME) != NULL)
+ call clc_enter (Memc[pname], Memc[value])
+
+ call sfree (sp)
+end