add check for duplicate interface/template definitions

This commit is contained in:
Chris PeBenito 2005-12-05 16:43:28 +00:00
parent d337ec9f08
commit 0176d13988
2 changed files with 38 additions and 33 deletions

View File

@ -1,3 +1,4 @@
- Add check for duplicate interface/template definitions.
- Move domain, files, and corecommands modules to kernel
layer to resolve some layering inconsistencies.
- Move policy build options out of Makefile into build.conf.

View File

@ -25,57 +25,57 @@ define(`policy_module',`
#
define(`gen_require',`
ifdef(`self_contained_policy',`',`
define(`in_gen_require_block')
require {
$1
}
undefine(`in_gen_require_block')
')
')
##############################
#
# In the future interfaces should be in loadable modules
#
# template(name,rules)
#
define(`template',`
`define(`$1',`
##### begin $1(dollarsstar)
$2
##### end $1(dollarsstar)
'')
')
# helper function, since m4 wont expand macros
# if a line is a comment (#):
define(`policy_m4_comment',`dnl
define(`policy_m4_comment',`
##### $2 depth: $1
')dnl
##############################
#
# In the future interfaces should be in loadable modules
#
# template(name,rules)
#
define(`template',` dnl
ifdef(`$1',`errprint(__file__:__line__`: duplicate definition of $1(). Original definition on '$1. __endline__)',`define(`$1',__line__)') dnl
`define(`$1',` dnl
define(`policy_temp',incr(policy_call_depth)) dnl
pushdef(`policy_call_depth',policy_temp) dnl
undefine(`policy_temp') dnl
policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar)) dnl
$2 dnl
define(`policy_temp',decr(policy_call_depth)) dnl
pushdef(`policy_call_depth',policy_temp) dnl
undefine(`policy_temp') dnl
policy_m4_comment(policy_call_depth,end `$1'(dollarsstar)) dnl
'')
')
##############################
#
# In the future interfaces should be in loadable modules
#
# interface(name,rules)
#
define(`interface',`
`define(`$1',`
define(`policy_temp',incr(policy_call_depth))
pushdef(`policy_call_depth',policy_temp)
undefine(`policy_temp')
policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar))
define(`interface',` dnl
ifdef(`$1',`errprint(__file__:__line__`: duplicate definition of $1(). Original definition on '$1. __endline__)',`define(`$1',__line__)') dnl
`define(`$1',` dnl
define(`policy_temp',incr(policy_call_depth)) dnl
pushdef(`policy_call_depth',policy_temp) dnl
undefine(`policy_temp') dnl
policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar)) dnl
$2
define(`policy_temp',decr(policy_call_depth))
pushdef(`policy_call_depth',policy_temp)
undefine(`policy_temp')
policy_m4_comment(policy_call_depth,end `$1'(dollarsstar))
define(`policy_temp',decr(policy_call_depth)) dnl
pushdef(`policy_call_depth',policy_temp) dnl
undefine(`policy_temp') dnl
policy_m4_comment(policy_call_depth,end `$1'(dollarsstar)) dnl
'')
')
@ -145,8 +145,10 @@ define(`tunable_policy',`
ifdef(`self_contained_policy',`
if (`$1') {
$2
ifelse(`$3',`',`',`
} else {
$3
')
}
',`
# structure for tunables
@ -159,8 +161,10 @@ define(`tunable_policy',`
if (`$1') {
$2
ifelse(`$3',`',`',`
} else {
$3
')
}
')
')