chiark / gitweb /
draft initd status support
[userv.git] / language.i4
index 09b4a61..d660b27 100644 (file)
@@ -1,7 +1,7 @@
 dnl  userv - language.i4
 dnl  definition of the configuration language, used for tokens.h and lexer.l
 dnl
-dnl  Copyright (C)1996-1997 Ian Jackson
+dnl  Copyright (C)1996-1997,1999 Ian Jackson
 dnl
 dnl  This is free software; you can redistribute it and/or modify it
 dnl  under the terms of the GNU General Public License as published by
@@ -66,6 +66,7 @@ autovaldeftype(`readwrite')
 autovaldeftype(`string')
 autovaldeftype(`execmode')
 autovaldeftype(`ehandlemode')
+autovaldeftype(`builtinservice')
 autovaldeftype(`misc')
 autovaldeftype(`internal')
 
@@ -85,10 +86,12 @@ define(`isflagpair',`isdirectivefn(`$1',`dfg_setflag',`',
                       `lr_flag= &'makename(`$1')`; lr_flagval= 1; ')
                      isdirectivefn(`no-$1',`dfg_setflag',`',
                       `lr_flag= &'makename(`$1')`; lr_flagval= 0; ')')
+dnl `reset' is also a builtin service
 isexecmode(`reject')
-isexecmode(`execute')
+dnl `execute' is also a builtin service
 isexecmode(`execute-from-directory')
 isexecmode(`execute-from-path')
+isexecmode(`execute-builtin')
 isehandlemode(`errors-to-stderr')
 isehandlemode(`errors-to-syslog')
 isehandlemode(`errors-to-file')
@@ -101,7 +104,6 @@ isflagpair(`set-environment')
 isflagpair(`suppress-args')
 isflagpair(`disconnect-hup')
 isdirective(`cd')
-isdirective(`reset')
 isdirective(`user-rcfile')
 isdirective(`include')
 isdirectivefn(`include-ifexist',`df_include')
@@ -144,6 +146,33 @@ isparmcondition(`glob')
 isparmcondition(`range')
 isparmcondition(`grep')
 
+
+define(`builtininlist',`
+pushdef(`odiv',divnum)divert(5)dnl
+  `"$1$2"',
+divert(odiv)popdef(`odiv')')
+
+dnl builtin services
+define(`isbuiltinservice',
+ `wordtypelexexec(`$1',`tokt_builtinservice$3',
+    `lr_bispa= bispa_'makename(`$2')`; lr_bisexec= bisexec_'makename(`$1')`; $5')
+  builtininlist(`$1',`$4')')
+isbuiltinservice(`environment',`none')
+isbuiltinservice(`parameter',`parameter',`',` <parameter>')
+isbuiltinservice(`version',`none')
+isbuiltinservice(`toplevel',`none')
+isbuiltinservice(`override',`none')
+isbuiltinservice(`shutdown',`none')
+
+dnl builtin services that are also directive names
+define(`isdirectivebuiltinservice',
+   `isbuiltinservice(`$1',`$2',`|tokt_directive$3',`$4',
+                     `lr_dir= df_'makename(`$1')`; ')')
+isdirectivebuiltinservice(`reset',`none')
+isdirectivebuiltinservice(`execute',`none',`|tokt_execmode')
+
+isbuiltinservice(`help',`none')
+
 dnl parameters
 define(`isparameter',`wordtypelexexec(`$1',`tokt_parameter',
                         `lr_parameter= pf_'makename(`$1')`; ')')