[svn-commits] bkruse: branch group/appdocsxml r129154 - /team/group/appdocsxml/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Jul 8 15:33:04 CDT 2008
Author: bkruse
Date: Tue Jul 8 15:33:03 2008
New Revision: 129154
URL: http://svn.digium.com/view/asterisk?view=rev&rev=129154
Log:
Added a patch to optimize the search without
languages and non-essential checks.
Added:
team/group/appdocsxml/optimze_search.patch (with props)
Added: team/group/appdocsxml/optimze_search.patch
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/optimze_search.patch?view=auto&rev=129154
==============================================================================
--- team/group/appdocsxml/optimze_search.patch (added)
+++ team/group/appdocsxml/optimze_search.patch Tue Jul 8 15:33:03 2008
@@ -1,0 +1,252 @@
+Index: apps/app_dial.c
+===================================================================
+--- apps/app_dial.c (revision 129110)
++++ apps/app_dial.c (working copy)
+@@ -411,15 +411,6 @@
+ Some format as arguments providet to the Dial application
+ </option>
+ </application>
+- <application name="RetryDial" language="es">
+- <synopsis>
+- (THIS SHOULD BE SOME SPANISH !!!!!!!!!!!!!!!)
+- No hablo Espanol
+- </synopsis>
+- <description>
+- Si signor, No Hablo Espanol
+- </description>
+- </application>
+ ***/
+
+ static char *app = "Dial";
+Index: apps/app_chanisavail.c
+===================================================================
+--- apps/app_chanisavail.c (revision 129110)
++++ apps/app_chanisavail.c (working copy)
+@@ -70,32 +70,6 @@
+ Simply checks if specified channels exist in the channel list
+ </option>
+ </application>
+- <application name="ChanIsAvail" language="nl">
+- <synopsis>
+- Kontroleer beschikbaarheid van een kanaal
+- </synopsis>
+- <description>
+- Deze applicatie kontroleerd of een kanaal beschikbaar is.
+- </description>
+- <variable name="AVAILCHAN">
+- De naam van het beschikbare kanaal, indien voorhanden
+- </variable>
+- <variable name="AVAILORIGCHAN">
+- De volledige naam die gebruikt is om het kanaal op te zetten
+- </variable>
+- <variable name="AVAILSTATUS">
+- De status code van het beschikbare kanaal
+- </variable>
+- <option name="a">
+- Kontroleer alle kanalen ipv alleen het eerste kanaal
+- </option>
+- <option name="s">
+- Als het kanaal in gebruik is, neem aan dat het niet beschikbaar is
+- </option>
+- <option name="t" implies="s">
+- Kontroleer alleen of het kanaal in de kanaallijst bestaat
+- </option>
+- </application>
+
+ ***/
+
+Index: optimze_search.patch
+===================================================================
+--- optimze_search.patch (revision 0)
++++ optimze_search.patch (revision 0)
+@@ -0,0 +1,57 @@
++Index: apps/app_dial.c
++===================================================================
++--- apps/app_dial.c (revision 129110)
+++++ apps/app_dial.c (working copy)
++@@ -411,15 +411,6 @@
++ Some format as arguments providet to the Dial application
++ </option>
++ </application>
++- <application name="RetryDial" language="es">
++- <synopsis>
++- (THIS SHOULD BE SOME SPANISH !!!!!!!!!!!!!!!)
++- No hablo Espanol
++- </synopsis>
++- <description>
++- Si signor, No Hablo Espanol
++- </description>
++- </application>
++ ***/
++
++ static char *app = "Dial";
++Index: apps/app_chanisavail.c
++===================================================================
++--- apps/app_chanisavail.c (revision 129110)
+++++ apps/app_chanisavail.c (working copy)
++@@ -70,32 +70,6 @@
++ Simply checks if specified channels exist in the channel list
++ </option>
++ </application>
++- <application name="ChanIsAvail" language="nl">
++- <synopsis>
++- Kontroleer beschikbaarheid van een kanaal
++- </synopsis>
++- <description>
++- Deze applicatie kontroleerd of een kanaal beschikbaar is.
++- </description>
++- <variable name="AVAILCHAN">
++- De naam van het beschikbare kanaal, indien voorhanden
++- </variable>
++- <variable name="AVAILORIGCHAN">
++- De volledige naam die gebruikt is om het kanaal op te zetten
++- </variable>
++- <variable name="AVAILSTATUS">
++- De status code van het beschikbare kanaal
++- </variable>
++- <option name="a">
++- Kontroleer alle kanalen ipv alleen het eerste kanaal
++- </option>
++- <option name="s">
++- Als het kanaal in gebruik is, neem aan dat het niet beschikbaar is
++- </option>
++- <option name="t" implies="s">
++- Kontroleer alleen of het kanaal in de kanaallijst bestaat
++- </option>
++- </application>
++
++ ***/
++
+Index: Makefile
+===================================================================
+--- Makefile (revision 129110)
++++ Makefile (working copy)
+@@ -485,14 +485,12 @@
+ documentation:
+ @echo -n "Building Documentation For: "
+ @echo "<?xml version="1.0" encoding="UTF-8"?>" > documentation.xml
+- @echo "<docs>" >> documentation.xml
+ @for x in $(MOD_SUBDIRS); do \
+ echo -n "$$x " ; \
+ for i in $$x/*.c; do \
+ $(AWK) -f build_tools/get_documentation $$i >> documentation.xml ; \
+ done ; \
+ done
+- @echo "</docs>" >> documentation.xml
+ @echo -e "\ndocumentation.xml --> $(ASTVARLIBDIR)/documentation.xml"
+
+ update:
+Index: main/pbx.c
+===================================================================
+--- main/pbx.c (revision 129111)
++++ main/pbx.c (working copy)
+@@ -338,7 +338,6 @@
+ static void __ast_internal_context_destroy( struct ast_context *con);
+ #ifdef XML_DOCUMENTATION
+ mxml_node_t *documentation_tree = NULL;
+-static char *ast_mxml_get_field(const char *type, const char *name, const char *var);
+ void _mxml_error(const char *cb);
+ #endif
+
+@@ -2601,48 +2600,9 @@
+ return cur ? 0 : -1;
+ }
+
+-static char *ast_mxml_get_field(const char *type, const char *name, const char *var) {
+-
+- const char *tmp = NULL;
+- mxml_node_t *node, *ret;
+-
+- node = ret = NULL;
+-
+- if(ast_strlen_zero(type) || ast_strlen_zero(name)) {
+- ast_log(LOG_WARNING, "Tried to look in XML tree with faulty values.\n");
+- return NULL;
+- }
+-
+- /* not fully initted yet */
+- if(documentation_tree == NULL) {
+- ast_log(LOG_DEBUG, "Parsing XML Tree Error\n");
+- return NULL;
+- }
+-
+- for (node = mxmlFindElement(documentation_tree, documentation_tree, type, "name", name, MXML_DESCEND); node != NULL && node->child != NULL; node = mxmlFindElement(node, documentation_tree, type, "name", name, MXML_DESCEND)) {
+- tmp = mxmlElementGetAttr(node, "language");
+- if (!strcmp(tmp, documentation_language)) {
+- ret = mxmlFindElement(node, documentation_tree, var, NULL, NULL, MXML_DESCEND_FIRST);
+- break;
+- }
+- }
+-
+- /* If we still could not find the language, chose the first one found (english) */
+- if (!ret) {
+- node = mxmlFindElement(documentation_tree, documentation_tree, type, "name", name, MXML_DESCEND);
+- ret = mxmlFindElement(node, documentation_tree, var, NULL, NULL, MXML_DESCEND);
+- }
+-
+- if (!ret || !ret->child) {
+- ast_log(LOG_WARNING, "Cannot find varible '%s' in tree '%s'\n", name, var);
+- return NULL;
+- }
+-
+- return ret->child->value.opaque;
+-}
+-
+ int __ast_custom_function_register(struct ast_custom_function *acf, struct ast_module *mod)
+ {
++ mxml_node_t *node, *ret;
+ struct ast_custom_function *cur;
+ char tmps[80];
+
+@@ -2650,13 +2610,20 @@
+ return -1;
+
+ acf->mod = mod;
++ node = ret = NULL;
+
+ /* Let's try to find it in the Documentation XML */
+ if (ast_strlen_zero(acf->desc) && ast_strlen_zero(acf->synopsis)) {
+
+- acf->synopsis = ast_mxml_get_field("function", acf->name, "synopsis");
+- acf->desc = ast_mxml_get_field("function", acf->name, "description");
+-
++ if(documentation_tree == NULL) {
++ ast_log(LOG_DEBUG, "Parsing XML Tree Error\n");
++ } else {
++ node = mxmlFindElement(documentation_tree, documentation_tree, "function", "name", acf->name, MXML_DESCEND);
++ ret = mxmlFindElement(node, documentation_tree, "synopsis", NULL, NULL, MXML_DESCEND);
++ acf->synopsis = ret->child->value.opaque;
++ ret = mxmlFindElement(node, documentation_tree, "description", NULL, NULL, MXML_DESCEND);
++ acf->desc = ret->child->value.opaque;
++ }
+ }
+
+ AST_RWLIST_WRLOCK(&acf_root);
+@@ -4344,7 +4311,9 @@
+ struct ast_app *tmp, *cur = NULL;
+ char tmps[80];
+ int length, res;
++ mxml_node_t *node, *ret;
+
++ node = ret = NULL;
+ AST_RWLIST_WRLOCK(&apps);
+ AST_RWLIST_TRAVERSE(&apps, tmp, list) {
+ if (!(res = strcasecmp(app, tmp->name))) {
+@@ -4364,8 +4333,15 @@
+
+ /* Try to lookup the docs in our XML documentation database */
+ if (ast_strlen_zero(synopsis) && ast_strlen_zero(description)) {
+- tmp->synopsis = ast_mxml_get_field("application", app, "synopsis");
+- tmp->description = ast_mxml_get_field("application", app, "description");
++ if(documentation_tree == NULL) {
++ ast_log(LOG_DEBUG, "Parsing XML Tree Error\n");
++ } else {
++ node = mxmlFindElement(documentation_tree, documentation_tree, "application", "name", app, MXML_DESCEND);
++ ret = mxmlFindElement(node, documentation_tree, "synopsis", NULL, NULL, MXML_DESCEND);
++ tmp->synopsis = ret->child->value.opaque;
++ ret = mxmlFindElement(node, documentation_tree, "description", NULL, NULL, MXML_DESCEND);
++ tmp->description = ret->child->value.opaque;
++ }
+ } else {
+ tmp->synopsis = synopsis;
+ tmp->description = description;
Propchange: team/group/appdocsxml/optimze_search.patch
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: team/group/appdocsxml/optimze_search.patch
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: team/group/appdocsxml/optimze_search.patch
------------------------------------------------------------------------------
svn:mime-type = text/plain
More information about the svn-commits
mailing list