[Asterisk-code-review] xml: Embed module information into core XML documentation. (asterisk[18])

George Joseph asteriskteam at digium.com
Tue Mar 16 10:31:24 CDT 2021


George Joseph has submitted this change. ( https://gerrit.asterisk.org/c/asterisk/+/15603 )

Change subject: xml: Embed module information into core XML documentation.
......................................................................

xml: Embed module information into core XML documentation.

This change embeds the MODULEINFO block of modules
into the core XML documentation. This provides a shared
mechanism for use by both menuselect and Asterisk for
information and a definitive source of truth.

ASTERISK-29335

Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90
---
M Makefile
M apps/app_fax.c
M apps/app_speech_utils.c
M cdr/cdr_syslog.c
M channels/chan_dahdi.c
M codecs/codec_dahdi.c
M doc/appdocsxml.dtd
M funcs/func_periodic_hook.c
M funcs/func_pjsip_aor.c
M funcs/func_pjsip_contact.c
M funcs/func_pjsip_endpoint.c
M res/res_remb_modifier.c
12 files changed, 36 insertions(+), 11 deletions(-)

Approvals:
  Kevin Harwell: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved; Approved for Submit



diff --git a/Makefile b/Makefile
index 2a45065..9ef3486 100644
--- a/Makefile
+++ b/Makefile
@@ -490,6 +490,13 @@
 	@for x in $(MOD_SUBDIRS); do \
 		printf "$$x " ; \
 		for i in `find $$x -name '*.c'`; do \
+			MODULEINFO=$$($(AWK) -f build_tools/get_moduleinfo $$i) ; \
+			if [ -n "$$MODULEINFO" ] ; \
+			then \
+				echo "<module language=\"en_US\" name=\"`$(BASENAME) -s .c $$i`\">" >> $@ ; \
+				echo "$$MODULEINFO" >> $@ ; \
+				echo "</module>" >> $@ ; \
+			fi ; \
 			$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
 		done ; \
 	done
diff --git a/apps/app_fax.c b/apps/app_fax.c
index d9b0a35..2404773 100644
--- a/apps/app_fax.c
+++ b/apps/app_fax.c
@@ -13,9 +13,9 @@
  */
 
 /*** MODULEINFO
-	<defaultenabled>no</defaultenabled>
 	<depend>spandsp</depend>
 	<conflict>res_fax</conflict>
+	<defaultenabled>no</defaultenabled>
 	<support_level>deprecated</support_level>
 	<replacement>res_fax</replacement>
 ***/
diff --git a/apps/app_speech_utils.c b/apps/app_speech_utils.c
index 2ba297e..9af8d2a 100644
--- a/apps/app_speech_utils.c
+++ b/apps/app_speech_utils.c
@@ -26,8 +26,8 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>res_speech</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/cdr/cdr_syslog.c b/cdr/cdr_syslog.c
index 4f0a78c..932d98f 100644
--- a/cdr/cdr_syslog.c
+++ b/cdr/cdr_syslog.c
@@ -37,8 +37,8 @@
  */
 
 /*** MODULEINFO
-	<defaultenabled>no</defaultenabled>
 	<depend>syslog</depend>
+	<defaultenabled>no</defaultenabled>
 	<support_level>deprecated</support_level>
 ***/
 
diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c
index 8d5d689..2c7b673 100644
--- a/channels/chan_dahdi.c
+++ b/channels/chan_dahdi.c
@@ -43,9 +43,9 @@
  */
 
 /*** MODULEINFO
-	<use type="module">res_smdi</use>
 	<depend>dahdi</depend>
 	<depend>tonezone</depend>
+	<use type="module">res_smdi</use>
 	<use type="external">pri</use>
 	<use type="external">ss7</use>
 	<use type="external">openr2</use>
diff --git a/codecs/codec_dahdi.c b/codecs/codec_dahdi.c
index 941bb1f..4494197 100644
--- a/codecs/codec_dahdi.c
+++ b/codecs/codec_dahdi.c
@@ -27,8 +27,8 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>dahdi</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/doc/appdocsxml.dtd b/doc/appdocsxml.dtd
index 7c7e606..cf3bc4a 100644
--- a/doc/appdocsxml.dtd
+++ b/doc/appdocsxml.dtd
@@ -1,4 +1,4 @@
-  <!ELEMENT docs (application|function|agi|manager|managerEvent|info|configInfo)*>
+  <!ELEMENT docs (module|application|function|agi|manager|managerEvent|info|configInfo)*>
   <!ATTLIST docs xmlns:xi CDATA #FIXED "http://www.w3.org/2001/XInclude">
 
   <!ELEMENT xi:include (xi:fallback?) >
@@ -11,6 +11,24 @@
   accept	CDATA       #IMPLIED
   accept-language CDATA  #IMPLIED >
 
+  <!ELEMENT module (depend*,use*,conflict*,defaultenabled?,support_level?,replacement?)>
+  <!ATTLIST module name CDATA #REQUIRED>
+  <!ATTLIST module language CDATA #REQUIRED>
+
+  <!ELEMENT support_level (#PCDATA)>
+
+  <!ELEMENT depend (#PCDATA)>
+  <!ATTLIST depend type CDATA #IMPLIED>
+
+  <!ELEMENT defaultenabled (#PCDATA)>
+
+  <!ELEMENT replacement (#PCDATA)>
+
+  <!ELEMENT use (#PCDATA)>
+  <!ATTLIST use type CDATA #IMPLIED>
+
+  <!ELEMENT conflict (#PCDATA)>
+
   <!ELEMENT application (synopsis?,syntax?,description?,see-also?)>
   <!ATTLIST application name CDATA #REQUIRED>
   <!ATTLIST application language CDATA #REQUIRED>
diff --git a/funcs/func_periodic_hook.c b/funcs/func_periodic_hook.c
index e38ff3e..6b90ee3 100644
--- a/funcs/func_periodic_hook.c
+++ b/funcs/func_periodic_hook.c
@@ -26,11 +26,11 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>app_chanspy</depend>
 	<depend>func_cut</depend>
 	<depend>func_groupcount</depend>
 	<depend>func_uri</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/funcs/func_pjsip_aor.c b/funcs/func_pjsip_aor.c
index 589f667..9ae51ed 100644
--- a/funcs/func_pjsip_aor.c
+++ b/funcs/func_pjsip_aor.c
@@ -27,9 +27,9 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>pjproject</depend>
 	<depend>res_pjsip</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/funcs/func_pjsip_contact.c b/funcs/func_pjsip_contact.c
index 9d4ba68..44272e1 100644
--- a/funcs/func_pjsip_contact.c
+++ b/funcs/func_pjsip_contact.c
@@ -27,9 +27,9 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>pjproject</depend>
 	<depend>res_pjsip</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/funcs/func_pjsip_endpoint.c b/funcs/func_pjsip_endpoint.c
index e4a6aba..bc4f0dc 100644
--- a/funcs/func_pjsip_endpoint.c
+++ b/funcs/func_pjsip_endpoint.c
@@ -27,9 +27,9 @@
  */
 
 /*** MODULEINFO
-	<support_level>core</support_level>
 	<depend>pjproject</depend>
 	<depend>res_pjsip</depend>
+	<support_level>core</support_level>
  ***/
 
 #include "asterisk.h"
diff --git a/res/res_remb_modifier.c b/res/res_remb_modifier.c
index bf56391..7d50c79 100644
--- a/res/res_remb_modifier.c
+++ b/res/res_remb_modifier.c
@@ -25,8 +25,8 @@
  */
 
 /*** MODULEINFO
-	<support_level>extended</support_level>
 	<defaultenabled>no</defaultenabled>
+	<support_level>extended</support_level>
  ***/
 
 #include "asterisk.h"

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15603
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 18
Gerrit-Change-Id: Ifbfd5c700049cf320a3e45351ac65dd89bc99d90
Gerrit-Change-Number: 15603
Gerrit-PatchSet: 2
Gerrit-Owner: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210316/bbdd7f1b/attachment-0001.html>


More information about the asterisk-code-review mailing list