klish.xsd 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://clish.sourceforge.net/XMLSchema" targetNamespace="http://clish.sourceforge.net/XMLSchema">
  3. <xs:annotation>
  4. <xs:appinfo>XML schema for klish configuration files</xs:appinfo>
  5. <xs:documentation xml:lang="en">
  6. The klish utility uses XML files for configuration. This schema
  7. allows to validate klish XML files. To check XML files use the
  8. following command:
  9. 'xmllint --schema /path/to/klish.xsd --noout *.xml'
  10. </xs:documentation>
  11. <xs:documentation xml:lang="ru">
  12. Утилита klish использует формат XML для своих конфигурационных
  13. файлов. Схема позволяет проверить эти конфигурационные XML файлы
  14. на правильность. Следующая команда выполнит проверку:
  15. 'xmllint --schema /path/to/klish.xsd --noout *.xml'
  16. </xs:documentation>
  17. </xs:annotation>
  18. <xs:element name="KLISH" type="klish_t"/>
  19. <xs:element name="ENTRY" type="entry_t"/>
  20. <xs:element name="VIEW" type="view_t"/> <!-- Wrapper -->
  21. <xs:element name="COMMAND" type="command_t"/> <!-- Wrapper -->
  22. <xs:element name="FILTER" type="command_t"/> <!-- Wrapper -->
  23. <xs:element name="STARTUP" type="startup_t"/>
  24. <xs:element name="ACTION" type="action_t"/>
  25. <xs:element name="OVERVIEW" type="overview_t"/>
  26. <xs:element name="DETAIL" type="detail_t"/>
  27. <xs:element name="PTYPE" type="ptype_t"/> <!-- Wrapper -->
  28. <xs:element name="PARAM" type="param_t"/> <!-- Wrapper -->
  29. <xs:element name="NAMESPACE" type="namespace_t"/> <!-- Wrapper -->
  30. <xs:element name="VAR" type="var_t"/>
  31. <xs:element name="WATCHDOG" type="wdog_t"/>
  32. <xs:element name="HOTKEY" type="hotkey_t"/>
  33. <xs:element name="PLUGIN" type="plugin_t"/>
  34. <xs:element name="HOOK" type="hook_t"/>
  35. <xs:complexType name="klish_t">
  36. <xs:annotation>
  37. <xs:documentation xml:lang="en">
  38. 'KLISH' is the top level container. Any object (command,
  39. type, var) which are defined within this tag are global
  40. in scope i.e. it is visible from all 'VIEW's.
  41. </xs:documentation>
  42. <xs:documentation xml:lang="ru">
  43. Тег 'KLISH' - контейнер верхнего уровня. Все остальные
  44. теги должны быть вложенными. Любой объект (команда,
  45. тип, переменная т.д.), заданный внутри этого тега,
  46. считается глобальным, т.е. видимым их любых 'VIEW".
  47. </xs:documentation>
  48. </xs:annotation>
  49. <xs:sequence>
  50. <xs:element ref="PLUGIN" minOccurs="0" maxOccurs="unbounded"/>
  51. <xs:element ref="HOOK" minOccurs="0" maxOccurs="unbounded"/>
  52. <xs:element ref="HOTKEY" minOccurs="0" maxOccurs="unbounded"/>
  53. <xs:element ref="WATCHDOG" minOccurs="0" maxOccurs="1"/>
  54. <xs:element ref="PTYPE" minOccurs="0" maxOccurs="unbounded"/>
  55. <xs:element ref="OVERVIEW" minOccurs="0"/>
  56. <xs:element ref="STARTUP" minOccurs="0"/>
  57. <xs:element ref="VAR" minOccurs="0" maxOccurs="unbounded"/>
  58. <xs:element ref="VIEW" minOccurs="0" maxOccurs="unbounded"/>
  59. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  60. </xs:sequence>
  61. </xs:complexType>
  62. <!--
  63. *******************************************************
  64. * <PTYPE> is used to define the syntax for a parameter type.
  65. *
  66. * name="<string>" - A textual name for this type. This name can be used to
  67. * reference this type within a PARAM's ptype attribute.
  68. *
  69. * help="<string>" - Help string.
  70. *
  71. ********************************************************
  72. -->
  73. <xs:complexType name="ptype_t">
  74. <xs:sequence>
  75. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  76. </xs:sequence>
  77. <xs:attribute name="name" type="xs:string" use="required"/>
  78. <xs:attribute name="help" type="xs:string" use="required"/>
  79. </xs:complexType>
  80. <!--
  81. *******************************************************
  82. * <ENTRY> This tag is used to define wide class of elements.
  83. *
  84. * name - A text name for entry.
  85. *
  86. * help - A text string which describes the purpose of the entry.
  87. *
  88. * ptype - Reference to a PTYPE name. This parameter will be
  89. * validated against the syntax specified for that type.
  90. * The special value of "" indicates the parameter is a boolean flag.
  91. * The verbatim presence of the texual name on the command line
  92. * simply controls the conditional variable expansion for this
  93. * parameter.
  94. *
  95. * [mode] - Parameter mode. It can be "common", "switch", "subcommand", "multi".
  96. *
  97. * [prefix] - defines the prefix for an optional parameter. A prefix
  98. * with this value on the command line will signify the presence
  99. * of an additional argument which will be validated as the
  100. * value of this parameter.
  101. *
  102. * [optional] - Specify whether parameter is optional. The allowed values
  103. * is "true" or "false". It's false by default.
  104. *
  105. * [order] - Used only together with "optional=true" field.
  106. * If order="true" then user can't enter previously declared
  107. * optional parameters after current validated parameter.
  108. * The allowed values is "true" or "false". It's false by default.
  109. *
  110. * [default] - defines a default value for a parameter. Any parameters
  111. * at the end of command line which have default values need
  112. * not explicitly be entered.
  113. *
  114. * [value] - defines the user's value for subcommand. If this option
  115. * is defined the entered parameter will be compared to this
  116. * value instead the "name" field. If this field is defined
  117. * the mode of PARAM will be forced to "subcommand". The
  118. * feature is implemented to support subcommands with the
  119. * same names.
  120. *
  121. * [hidden] - define the visibility of the parameter while ${__line}
  122. * and ${__params} auto variables expanding. The allowed values
  123. * is "true" and "false".
  124. *
  125. * [test] - define the condition (see the description of 'test'
  126. * utility) to process this parameter.
  127. *
  128. * [access] - access rights
  129. *
  130. * [filter="true/false"] - Developer can define 'filter' command to filter stdout
  131. * of piped ("|") commands. Filter can't contain 'sync' ACTIONs. It will be
  132. * always fork()-ed. Only filters can be on the right hand to pipe "|".
  133. * Consider filters as a special type of commands.
  134. *
  135. ********************************************************
  136. -->
  137. <xs:simpleType name="entry_mode_t">
  138. <xs:restriction base="xs:string">
  139. <xs:enumeration value="sequence"/>
  140. <xs:enumeration value="switch"/>
  141. <xs:enumeration value="empty"/>
  142. </xs:restriction>
  143. </xs:simpleType>
  144. <xs:simpleType name="entry_purpose_t">
  145. <xs:restriction base="xs:string">
  146. <xs:enumeration value="common"/>
  147. <xs:enumeration value="ptype"/>
  148. <xs:enumeration value="prompt"/>
  149. <xs:enumeration value="cond"/>
  150. <xs:enumeration value="completion"/>
  151. <xs:enumeration value="help"/>
  152. </xs:restriction>
  153. </xs:simpleType>
  154. <xs:group name="entry_group_t">
  155. <xs:choice>
  156. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  157. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  158. </xs:choice>
  159. </xs:group>
  160. <xs:complexType name="entry_t">
  161. <!-- Any order of tags and any number -->
  162. <xs:sequence>
  163. <xs:group ref="entry_group_t" minOccurs="0" maxOccurs="unbounded"/>
  164. </xs:sequence>
  165. <xs:attribute name="name" type="xs:string" use="required"/>
  166. <xs:attribute name="help" type="xs:string" use="optional"/>
  167. <xs:attribute name="container" type="xs:boolean" use="optional" default="false"/>
  168. <xs:attribute name="mode" type="param_mode_t" use="optional" default="switch"/>
  169. <xs:attribute name="purpose" type="param_purpose_t" use="optional" default="common"/>
  170. <xs:attribute name="min" type="xs:string" use="optional" default="1"/>
  171. <xs:attribute name="max" type="xs:string" use="optional" default="1"/>
  172. <xs:attribute name="ptype" type="xs:string" use="optional"/>
  173. <xs:attribute name="ref" type="xs:string" use="optional"/>
  174. <xs:attribute name="value" type="xs:string" use="optional"/>
  175. <xs:attribute name="restore" type="xs:boolean" use="optional" default="false"/>
  176. <xs:attribute name="order" type="xs:boolean" use="optional" default="false"/>
  177. <xs:attribute name="filter" type="xs:boolean" use="optional" default="false"/>
  178. </xs:complexType>
  179. <!--
  180. *******************************************************
  181. * <VIEW> defines the contents of a specific CLI view.
  182. *
  183. * name - a textual name for the view
  184. *
  185. * prompt - a textual definition of the prompt to be
  186. * used whilst in this view.
  187. * NB. The prompt may contain environment
  188. * or dynamic variables which are expanded
  189. * before display.
  190. *
  191. * [access] - access rights
  192. *
  193. ********************************************************
  194. -->
  195. <xs:complexType name="view_t">
  196. <xs:sequence>
  197. <xs:element ref="NAMESPACE" minOccurs="0" maxOccurs="unbounded"/>
  198. <xs:element ref="COMMAND" minOccurs="0" maxOccurs="unbounded"/>
  199. <xs:element ref="HOTKEY" minOccurs="0" maxOccurs="unbounded"/>
  200. <xs:element ref="ENTRY" minOccurs="0" maxOccurs="unbounded"/>
  201. </xs:sequence>
  202. <xs:attribute name="name" type="xs:string" use="required"/>
  203. <xs:attribute name="prompt" type="xs:string" use="optional"/>
  204. <xs:attribute name="access" type="xs:string" use="optional"/>
  205. </xs:complexType>
  206. <!--
  207. *******************************************************
  208. * <STARTUP> is used to define what happens when the CLI
  209. * is started. Any text held in a <DETAIL> sub-element will
  210. * be used as banner text, then any defined <ACTION> will be
  211. * executed. This action may provide Message Of The Day (MOTD)
  212. * type behaviour.
  213. *
  214. * view - defines the view which will be transitioned to, on
  215. * successful execution of any <ACTION> tag.
  216. *
  217. * [viewid] - defined the new value of the ${VIEWID} variable to
  218. * be used if a transition to a new view occurs.
  219. *
  220. * [default_shebang] - The default shebang for all commands.
  221. *
  222. * [timeout] - The idle timeout. The clish will exit if user
  223. * have not press any key while this timeout.
  224. *
  225. * [lock] - The same as lock for COMMAND tag.
  226. *
  227. * [interrupt] - The same as interrupt for COMMAND tag.
  228. *
  229. * [default_plugin] - Use (or don't use) default plugin.
  230. * It can be true or false.
  231. ********************************************************
  232. -->
  233. <xs:complexType name="startup_t">
  234. <xs:sequence>
  235. <xs:element ref="DETAIL" minOccurs="0"/>
  236. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  237. </xs:sequence>
  238. <xs:attribute name="view" type="xs:string" use="required"/>
  239. <xs:attribute name="viewid" type="xs:string" use="optional"/>
  240. <xs:attribute name="default_shebang" type="xs:string" use="optional"/>
  241. <xs:attribute name="timeout" type="xs:string" use="optional"/>
  242. <xs:attribute name="default_plugin" type="xs:boolean" use="optional" default="true"/>
  243. </xs:complexType>
  244. <!--
  245. *******************************************************
  246. * <PARAM> This tag is used to define a parameter for a command.
  247. *
  248. * name - a textual name for this parameter.
  249. *
  250. * help - a textual string which describes the purpose of the
  251. * parameter.
  252. *
  253. * ptype - Reference to a PTYPE name. This parameter will be
  254. * validated against the syntax specified for that type.
  255. * The special value of "" indicates the parameter is a boolean flag.
  256. * The verbatim presence of the texual name on the command line
  257. * simply controls the conditional variable expansion for this
  258. * parameter.
  259. *
  260. * [mode] - Parameter mode. It can be "common", "switch", "subcommand", "multi".
  261. *
  262. * [prefix] - defines the prefix for an optional parameter. A prefix
  263. * with this value on the command line will signify the presence
  264. * of an additional argument which will be validated as the
  265. * value of this parameter.
  266. *
  267. * [optional] - Specify whether parameter is optional. The allowed values
  268. * is "true" or "false". It's false by default.
  269. *
  270. * [order] - Used only together with "optional=true" field.
  271. * If order="true" then user can't enter previously declared
  272. * optional parameters after current validated parameter.
  273. * The allowed values is "true" or "false". It's false by default.
  274. *
  275. * [default] - defines a default value for a parameter. Any parameters
  276. * at the end of command line which have default values need
  277. * not explicitly be entered.
  278. *
  279. * [value] - defines the user's value for subcommand. If this option
  280. * is defined the entered parameter will be compared to this
  281. * value instead the "name" field. If this field is defined
  282. * the mode of PARAM will be forced to "subcommand". The
  283. * feature is implemented to support subcommands with the
  284. * same names.
  285. *
  286. * [hidden] - define the visibility of the parameter while ${__line}
  287. * and ${__params} auto variables expanding. The allowed values
  288. * is "true" and "false".
  289. *
  290. * [test] - define the condition (see the description of 'test'
  291. * utility) to process this parameter.
  292. *
  293. * [access] - access rights
  294. *
  295. ********************************************************
  296. -->
  297. <xs:group name="param_group_t">
  298. <xs:choice>
  299. <xs:element ref="PARAM"/>
  300. <xs:element ref="ENTRY"/>
  301. </xs:choice>
  302. </xs:group>
  303. <xs:complexType name="param_t">
  304. <!-- Any order of tags and any number -->
  305. <xs:sequence>
  306. <xs:group ref="param_group_t" minOccurs="0" maxOccurs="unbounded"/>
  307. </xs:sequence>
  308. <xs:attribute name="name" type="xs:string" use="required"/>
  309. <xs:attribute name="help" type="xs:string" use="required"/>
  310. <xs:attribute name="ptype" type="xs:string" use="required"/>
  311. <xs:attribute name="mode" type="entry_mode_t" use="optional" default="common"/>
  312. <xs:attribute name="order" type="xs:boolean" use="optional" default="false"/>
  313. <xs:attribute name="value" type="xs:string" use="optional"/>
  314. </xs:complexType>
  315. <!--
  316. ********************************************************
  317. * <ACTION> specifies the action to be taken for
  318. * a command.
  319. *
  320. * In addition the optional 'sym' attribute can specify
  321. * the name of an internal command which will be invoked
  322. * to handle script.
  323. *
  324. * [sym="<symbol>"] - specify the name of an internally registered
  325. * function. The content of the ACTION tag is
  326. * taken as the arguments to this builtin function.
  327. *
  328. * [lock="<name>"] - Named lock. It will use special lockfile while
  329. * action execution.
  330. *
  331. * [interrupt="true/false"] - The boolean field that specify that action can be
  332. * be interrupted by Ctrl^C. Default is false. Ignored for non-interactive
  333. * actions.
  334. *
  335. * [interactive="true/false"] - Is action interactive.
  336. *
  337. * [exec_on="fail/success/always/never"] - ACTION's execution depends on
  338. * return code of previous elements of ACTION chain. If the
  339. * condition is not met then ACTION will not be executed. The "always"
  340. * value means that ACTION will be always executed and chain return
  341. * code will be ignored. Default is "success".
  342. *
  343. * [update_retcode="true/false"] - The chain return value can be updated
  344. * by current ACTION's return code or ACTION's return code can be ignored.
  345. * Default is "true".
  346. *
  347. * [permanent="true/false"] - The klish can be invoked with --dry-run option. In
  348. * this case all ACTIONs will be not actually executed but will always
  349. * return success. But some actions like navigation is necessary to be
  350. * executed in any case. Permanent flag will inform engine to always
  351. * execute ACTION.
  352. *
  353. * [sync="true/false"] - Common behaviour is to fork() process before ACTION
  354. * execution. But ACTION may be executed in-place (without fork()) if sync
  355. * flag is set to true. It's not recommended to use sync ACTIONs widely.
  356. * It's usefull for small fast functions only.
  357. *
  358. ********************************************************
  359. -->
  360. <xs:simpleType name="action_cond_t">
  361. <xs:restriction base="xs:string">
  362. <xs:enumeration value="fail"/>
  363. <xs:enumeration value="success"/>
  364. <xs:enumeration value="always"/>
  365. <xs:enumeration value="never"/>
  366. </xs:restriction>
  367. </xs:simpleType>
  368. <xs:complexType name="action_t">
  369. <xs:simpleContent>
  370. <xs:extension base="xs:string">
  371. <xs:attribute name="sym" type="xs:string" use="optional"/>
  372. <xs:attribute name="lock" type="xs:string" use="optional"/>
  373. <xs:attribute name="interrupt" type="xs:boolean" use="optional" default="false"/>
  374. <xs:attribute name="interactive" type="xs:boolean" use="optional" default="false"/>
  375. <xs:attribute name="exec_on" type="action_cond_t" use="optional" default="success"/>
  376. <xs:attribute name="update_retcode" type="xs:boolean" use="optional" default="true"/>
  377. <xs:attribute name="permanent" type="xs:boolean" use="optional" default="false"/>
  378. <xs:attribute name="sync" type="xs:boolean" use="optional" default="false"/>
  379. </xs:extension>
  380. </xs:simpleContent>
  381. </xs:complexType>
  382. <!--
  383. *******************************************************
  384. * <COMMAND> is used to define a command within the CLI.
  385. *
  386. * name="<string>" - A textual name for this command. (This may contain
  387. * spaces e.g. "display acl")
  388. *
  389. * help="<string>" - Help for command.
  390. *
  391. * [view] - defines the view which will be transitioned to, on
  392. * successful execution of any <ACTION> tag. By default the
  393. * current view stays in scope.
  394. *
  395. * [viewid] - defined the new value of the ${VIEWID} variable to
  396. * be used if a transition to a new view occurs. By default
  397. * the viewid will retain it's current value.
  398. *
  399. * [access] - defines the user group/level to which execution of this
  400. * command is restricted. By default there is no restriction.
  401. * The exact interpretation of this field is dependant on the
  402. * client of libclish but for example the clish and tclish
  403. * applications map this to the UNIX user groups.
  404. *
  405. * [escape_chars] - defines the characters which will be escaped (e.g. \$) before
  406. * being expanded as a variable. By default the following
  407. * characters will be escaped `|$<>&()#
  408. *
  409. * [args] - defines a parameter name to be used to gather the rest of the
  410. * command line after the formally defined parameters
  411. * (PARAM elements). The formatting of this parameter is a raw
  412. * string containing as many words as there are on the rest of the
  413. * command line.
  414. *
  415. * [args_help] - a textual string which describes the purpose of the 'args'
  416. * parameter. If the "args" attribute is given then this MUST be
  417. * given also.
  418. *
  419. ********************************************************
  420. -->
  421. <xs:complexType name="command_t">
  422. <xs:sequence>
  423. <xs:element ref="DETAIL" minOccurs="0"/>
  424. <!-- Any order of PARAM tags and any number -->
  425. <xs:group ref="param_group_t" minOccurs="0" maxOccurs="unbounded"/>
  426. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  427. <xs:element ref="COMMAND" minOccurs="0" maxOccurs="unbounded"/>
  428. </xs:sequence>
  429. <xs:attribute name="name" type="xs:string" use="required"/>
  430. <xs:attribute name="help" type="xs:string" use="required"/>
  431. <xs:attribute name="ref" type="xs:string" use="optional"/>
  432. <xs:attribute name="view" type="xs:string" use="optional"/>
  433. <xs:attribute name="viewid" type="xs:string" use="optional"/>
  434. <xs:attribute name="access" type="xs:string" use="optional"/>
  435. <xs:attribute name="args" type="xs:string" use="optional"/>
  436. <xs:attribute name="args_help" type="xs:string" use="optional"/>
  437. <xs:attribute name="escape_chars" type="xs:string" use="optional"/>
  438. </xs:complexType>
  439. <!--
  440. ********************************************************
  441. * <OVERVIEW> specifies a textual description of the shell.
  442. *
  443. * This should provide instructions about key bindings and
  444. * escape sequences which can be used in the CLI.
  445. *
  446. ********************************************************
  447. -->
  448. <xs:simpleType name="overview_t">
  449. <xs:restriction base="xs:string">
  450. <xs:whiteSpace value="preserve"/>
  451. </xs:restriction>
  452. </xs:simpleType>
  453. <!--
  454. ********************************************************
  455. * <DETAIL> specifies a textual description.
  456. *
  457. * This may be used within the scope of a <COMMAND>
  458. * element, in which case it would typically contain
  459. * detailed usage instructions including examples.
  460. *
  461. * This may also be used within the scope of a <STARTUP>
  462. * element, in which case the text is used as the banner
  463. * details which are displayed on shell startup. This is
  464. * shown before any specified <ACTION> is executed.
  465. *
  466. * This text may also be used in the production of user manuals.
  467. ********************************************************
  468. -->
  469. <xs:simpleType name="detail_t">
  470. <xs:restriction base="xs:string">
  471. <xs:whiteSpace value="preserve"/>
  472. </xs:restriction>
  473. </xs:simpleType>
  474. <!--
  475. *******************************************************
  476. * <NAMESPACE> import commands from specific view to current view.
  477. *
  478. * ref - the view to import commands from
  479. *
  480. * [prefix] - the prefix for imported commands
  481. *
  482. * [prefix_help] - the help for namespace prefix
  483. *
  484. * [help] - a boolean flag to use imported
  485. * commands while help
  486. *
  487. * [completion] - a boolean flag to use imported
  488. * commands while completion
  489. *
  490. * [context_help] - a boolean flag to use imported
  491. * commands while context help
  492. *
  493. * [inherit] - a boolean flag to inherit nested
  494. * namespace commands recursively
  495. *
  496. * [access] - access rights
  497. *
  498. ********************************************************
  499. -->
  500. <xs:complexType name="namespace_t">
  501. <xs:attribute name="ref" type="xs:string" use="required"/>
  502. <xs:attribute name="prefix" type="xs:string" use="optional"/>
  503. <xs:attribute name="prefix_help" type="xs:string" use="optional"/>
  504. <xs:attribute name="help" type="xs:boolean" use="optional" default="false"/>
  505. <xs:attribute name="completion" type="xs:boolean" use="optional" default="true"/>
  506. <xs:attribute name="context_help" type="xs:boolean" use="optional" default="false"/>
  507. <xs:attribute name="inherit" type="xs:boolean" use="optional" default="true"/>
  508. <xs:attribute name="access" type="xs:string" use="optional"/>
  509. </xs:complexType>
  510. <!--
  511. *******************************************************
  512. * <VAR> Specify the variable.
  513. *
  514. *
  515. *
  516. ********************************************************
  517. -->
  518. <xs:complexType name="var_t">
  519. <xs:sequence>
  520. <xs:element ref="ACTION" minOccurs="0" maxOccurs="unbounded"/>
  521. </xs:sequence>
  522. <xs:attribute name="name" type="xs:string" use="required"/>
  523. <xs:attribute name="help" type="xs:string" use="optional"/>
  524. <xs:attribute name="value" type="xs:string" use="optional"/>
  525. <xs:attribute name="dynamic" type="xs:boolean" use="optional" default="false"/>
  526. </xs:complexType>
  527. <!--
  528. *******************************************************
  529. * <WATCHDOG> is used to recover system after errors.
  530. *
  531. ********************************************************
  532. -->
  533. <xs:complexType name="wdog_t">
  534. <xs:sequence>
  535. <xs:element ref="ACTION" minOccurs="1" maxOccurs="unbounded"/>
  536. </xs:sequence>
  537. </xs:complexType>
  538. <!--
  539. *******************************************************
  540. * <HOTKEY> is used to define hotkey actions
  541. *
  542. ********************************************************
  543. -->
  544. <xs:complexType name="hotkey_t">
  545. <xs:attribute name="key" type="xs:string" use="required"/>
  546. <xs:attribute name="cmd" type="xs:string" use="required"/>
  547. </xs:complexType>
  548. <!--
  549. *******************************************************
  550. * <PLUGIN> is used to dynamically load plugins.
  551. * Plugin contains symbols that can be used for ACTIONs.
  552. *
  553. * name - Plugin name. If "file" attribute is not specified then plugin's
  554. * filename is autogenerated as "klish-plugin-<name>.so".
  555. * [id] - Internal plugin name. Can be the same as "name".
  556. * [file] - File name if standard autogenerated filename (using "name" field)
  557. * is not appropriate.
  558. ********************************************************
  559. -->
  560. <xs:complexType name="plugin_t">
  561. <xs:simpleContent>
  562. <xs:extension base="xs:string">
  563. <xs:attribute name="name" type="xs:string" use="required"/>
  564. <xs:attribute name="id" type="xs:string" use="optional"/>
  565. <xs:attribute name="file" type="xs:string" use="optional"/>
  566. </xs:extension>
  567. </xs:simpleContent>
  568. </xs:complexType>
  569. <!--
  570. *******************************************************
  571. * <HOOK> is used to redefine internal hooks
  572. *
  573. * name - The name of internal hook (init, fini, access, log).
  574. *
  575. * [builtin] - specify the name of an internally registered
  576. * function.
  577. *
  578. ********************************************************
  579. -->
  580. <xs:simpleType name="hook_list_e">
  581. <xs:restriction base="xs:string">
  582. <xs:enumeration value="init"/>
  583. <xs:enumeration value="fini"/>
  584. <xs:enumeration value="access"/>
  585. <xs:enumeration value="log"/>
  586. </xs:restriction>
  587. </xs:simpleType>
  588. <xs:complexType name="hook_t">
  589. <xs:attribute name="name" type="hook_list_e"/>
  590. <xs:attribute name="builtin" type="xs:string" use="optional"/>
  591. </xs:complexType>
  592. </xs:schema>