add check for duplicate interface/template definitions
This commit is contained in:
parent
d337ec9f08
commit
0176d13988
@ -1,3 +1,4 @@
|
|||||||
|
- Add check for duplicate interface/template definitions.
|
||||||
- Move domain, files, and corecommands modules to kernel
|
- Move domain, files, and corecommands modules to kernel
|
||||||
layer to resolve some layering inconsistencies.
|
layer to resolve some layering inconsistencies.
|
||||||
- Move policy build options out of Makefile into build.conf.
|
- Move policy build options out of Makefile into build.conf.
|
||||||
|
@ -25,57 +25,57 @@ define(`policy_module',`
|
|||||||
#
|
#
|
||||||
define(`gen_require',`
|
define(`gen_require',`
|
||||||
ifdef(`self_contained_policy',`',`
|
ifdef(`self_contained_policy',`',`
|
||||||
define(`in_gen_require_block')
|
|
||||||
require {
|
require {
|
||||||
$1
|
$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
|
# helper function, since m4 wont expand macros
|
||||||
# if a line is a comment (#):
|
# if a line is a comment (#):
|
||||||
define(`policy_m4_comment',`dnl
|
define(`policy_m4_comment',`
|
||||||
##### $2 depth: $1
|
##### $2 depth: $1
|
||||||
')dnl
|
')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
|
# In the future interfaces should be in loadable modules
|
||||||
#
|
#
|
||||||
# interface(name,rules)
|
# interface(name,rules)
|
||||||
#
|
#
|
||||||
define(`interface',`
|
define(`interface',` dnl
|
||||||
`define(`$1',`
|
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))
|
define(`policy_temp',incr(policy_call_depth)) dnl
|
||||||
pushdef(`policy_call_depth',policy_temp)
|
pushdef(`policy_call_depth',policy_temp) dnl
|
||||||
undefine(`policy_temp')
|
undefine(`policy_temp') dnl
|
||||||
|
policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar)) dnl
|
||||||
policy_m4_comment(policy_call_depth,begin `$1'(dollarsstar))
|
|
||||||
|
|
||||||
$2
|
$2
|
||||||
|
define(`policy_temp',decr(policy_call_depth)) dnl
|
||||||
define(`policy_temp',decr(policy_call_depth))
|
pushdef(`policy_call_depth',policy_temp) dnl
|
||||||
pushdef(`policy_call_depth',policy_temp)
|
undefine(`policy_temp') dnl
|
||||||
undefine(`policy_temp')
|
policy_m4_comment(policy_call_depth,end `$1'(dollarsstar)) dnl
|
||||||
|
|
||||||
policy_m4_comment(policy_call_depth,end `$1'(dollarsstar))
|
|
||||||
|
|
||||||
'')
|
'')
|
||||||
')
|
')
|
||||||
|
|
||||||
@ -145,8 +145,10 @@ define(`tunable_policy',`
|
|||||||
ifdef(`self_contained_policy',`
|
ifdef(`self_contained_policy',`
|
||||||
if (`$1') {
|
if (`$1') {
|
||||||
$2
|
$2
|
||||||
|
ifelse(`$3',`',`',`
|
||||||
} else {
|
} else {
|
||||||
$3
|
$3
|
||||||
|
')
|
||||||
}
|
}
|
||||||
',`
|
',`
|
||||||
# structure for tunables
|
# structure for tunables
|
||||||
@ -159,8 +161,10 @@ define(`tunable_policy',`
|
|||||||
|
|
||||||
if (`$1') {
|
if (`$1') {
|
||||||
$2
|
$2
|
||||||
|
ifelse(`$3',`',`',`
|
||||||
} else {
|
} else {
|
||||||
$3
|
$3
|
||||||
|
')
|
||||||
}
|
}
|
||||||
')
|
')
|
||||||
')
|
')
|
||||||
|
Loading…
Reference in New Issue
Block a user