support for global booleans

This commit is contained in:
Chris PeBenito 2005-07-08 14:22:17 +00:00
parent acb668edf1
commit c11958bd0f
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<!ENTITY % inline.class "pre|p|ul|li"> <!ENTITY % inline.class "pre|p|ul|li">
<!ELEMENT policy (layer+,tunable*)> <!ELEMENT policy (layer+,(tunable|boolean)*)>
<!ELEMENT layer (summary,module+)> <!ELEMENT layer (summary,module+)>
<!ATTLIST layer <!ATTLIST layer
name CDATA #REQUIRED> name CDATA #REQUIRED>
@ -14,6 +14,10 @@
<!ATTLIST tunable <!ATTLIST tunable
name CDATA #REQUIRED name CDATA #REQUIRED
dftval CDATA #REQUIRED> dftval CDATA #REQUIRED>
<!ELEMENT boolean (#PCDATA)>
<!ATTLIST boolean
name CDATA #REQUIRED
dftval CDATA #REQUIRED>
<!ELEMENT summary (#PCDATA)> <!ELEMENT summary (#PCDATA)>
<!ELEMENT interface (summary?,desc?,secdesc?,param+,infoflow?)> <!ELEMENT interface (summary?,desc?,secdesc?,param+,infoflow?)>
<!ATTLIST interface name CDATA #REQUIRED> <!ATTLIST interface name CDATA #REQUIRED>

View File

@ -279,20 +279,22 @@ def getTunableXML(file_name):
# Get the parameters of a TUNABLE style line. # Get the parameters of a TUNABLE style line.
params = getParams(line,TUNABLE) params = getParams(line,TUNABLE)
tag = "tunable"
# If the line is not a TUNABLE style declaration, try BOOLEAN. # If the line is not a TUNABLE style declaration, try BOOLEAN.
if not params: if not params:
params = getParams(line,BOOLEAN) params = getParams(line,BOOLEAN)
tag = "boolean"
# If the line is one of the two styles above, add a tunable tag # If the line is one of the two styles above, add a tunable tag
# and give it the data from the temprorary buffer. # and give it the data from the temprorary buffer.
if params: if params:
tunable_buf.append\ tunable_buf.append\
("<tunable name=\"%s\" dftval=\"%s\">\n" ("<%s name=\"%s\" dftval=\"%s\">\n"
% (params[0], params[1])) % (tag, params[0], params[1]))
tunable_buf += temp_buf tunable_buf += temp_buf
temp_buf = [] temp_buf = []
tunable_buf.append("</tunable>\n") tunable_buf.append("</%s>\n" % tag)
# If there are XML comments at the end of the file, they arn't # If there are XML comments at the end of the file, they arn't
# attributed to anything. These are ignored. # attributed to anything. These are ignored.