aboutsummaryrefslogtreecommitdiff
path: root/pkg/proto/maskexpr/megsym.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 /pkg/proto/maskexpr/megsym.x
downloadiraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz
Initial commit
Diffstat (limited to 'pkg/proto/maskexpr/megsym.x')
-rw-r--r--pkg/proto/maskexpr/megsym.x31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkg/proto/maskexpr/megsym.x b/pkg/proto/maskexpr/megsym.x
new file mode 100644
index 00000000..44a810bc
--- /dev/null
+++ b/pkg/proto/maskexpr/megsym.x
@@ -0,0 +1,31 @@
+include <ctotok.h>
+include <ctype.h>
+include "gettok.h"
+
+
+# Expression database symbol.
+define LEN_SYM 2
+define SYM_TEXT Memi[$1]
+define SYM_NARGS Memi[$1+1]
+
+
+
+# ME_GSYM -- Get symbol routine for the gettok package.
+
+pointer procedure me_gsym (st, symname, nargs)
+
+pointer st #I symbol table
+char symname[ARB] #I symbol to be looked up
+int nargs #O number of macro arguments
+
+pointer sym
+pointer strefsbuf(), stfind()
+
+begin
+ sym = stfind (st, symname)
+ if (sym == NULL)
+ return (NULL)
+
+ nargs = SYM_NARGS(sym)
+ return (strefsbuf (st, SYM_TEXT(sym)))
+end