[asterisk-commits] eliel: branch group/appdocsxml r145477 - /team/group/appdocsxml/funcs/func_env.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 1 12:08:51 CDT 2008


Author: eliel
Date: Wed Oct  1 12:08:50 2008
New Revision: 145477

URL: http://svn.digium.com/view/asterisk?view=rev&rev=145477
Log:
Introduce STAT(), FILE() and ENV() functions XML documentation.

Modified:
    team/group/appdocsxml/funcs/func_env.c

Modified: team/group/appdocsxml/funcs/func_env.c
URL: http://svn.digium.com/view/asterisk/team/group/appdocsxml/funcs/func_env.c?view=diff&rev=145477&r1=145476&r2=145477
==============================================================================
--- team/group/appdocsxml/funcs/func_env.c (original)
+++ team/group/appdocsxml/funcs/func_env.c Wed Oct  1 12:08:50 2008
@@ -32,6 +32,59 @@
 #include "asterisk/pbx.h"
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
+
+/*** DOCUMENTATION
+	<function name="ENV" language="en_US">
+		<synopsis>
+			Gets or sets the environment variable specified.
+		</synopsis>
+		<syntax>
+			<parameter name="varname" required="true">
+				<para>Enviroment variable name</para>
+			</parameter>
+		</syntax>
+		<description>
+		</description>
+	</function>
+	<function name="STAT" language="en_US">
+		<synopsis>
+			Does a check on the specified file.
+		</synopsis>
+		<syntax>
+			<parameter name="flag" required="true">
+				<para>Flag may be one of the following:</para>
+				<para>d - Checks if the file is a directory.</para>
+				<para>e - Checks if the file exists.</para>
+				<para>f - Checks if the file is a regular file.</para>
+				<para>m - Returns the file mode (in octal)</para>
+				<para>s - Returns the size (in bytes) of the file</para>
+				<para>A - Returns the epoch at which the file was last accessed.</para>
+				<para>C - Returns the epoch at which the inode was last changed.</para>
+				<para>M - Returns the epoch at which the file was last modified.</para>
+			</parameter>
+			<parameter name="filename" required="true" />
+		</syntax>
+		<description>
+		</description>
+	</function>
+	<function name="FILE" language="en_US">
+		<synopsis>
+			Obtains the contents of a file.
+		</synopsis>
+		<syntax>
+			<parameter name="filename" required="true" />
+			<parameter name="offset" required="true">
+				<para>Maybe specified as any number. if negative <replaceable>offset</replaceable> specifies the number
+				of bytes back from the end of the file.</para>
+			</parameter>
+			<parameter name="length" required="true">
+				<para>If specified, will limit the length of the data read to that size.</para>
+			</parameter>
+		</syntax>
+		<description>
+		</description>
+	</function>
+ ***/
 
 static int env_read(struct ast_channel *chan, const char *cmd, char *data,
 		    char *buf, size_t len)
@@ -151,43 +204,23 @@
 
 static struct ast_custom_function env_function = {
 	.name = "ENV",
-	.synopsis = "Gets or sets the environment variable specified",
-	.syntax = "ENV(<envname>)",
 	.read = env_read,
-	.write = env_write,
+	.write = env_write
 };
 
 static struct ast_custom_function stat_function = {
 	.name = "STAT",
-	.synopsis = "Does a check on the specified file",
-	.syntax = "STAT(<flag>,<filename>)",
-	.read = stat_read,
-	.desc =
-		"flag may be one of the following:\n"
-		"  d - Checks if the file is a directory\n"
-		"  e - Checks if the file exists\n"
-		"  f - Checks if the file is a regular file\n"
-		"  m - Returns the file mode (in octal)\n"
-		"  s - Returns the size (in bytes) of the file\n"
-		"  A - Returns the epoch at which the file was last accessed\n"
-		"  C - Returns the epoch at which the inode was last changed\n"
-		"  M - Returns the epoch at which the file was last modified\n",
+	.read = stat_read
 };
 
 static struct ast_custom_function file_function = {
 	.name = "FILE",
-	.synopsis = "Obtains the contents of a file",
-	.syntax = "FILE(<filename>,<offset>,<length>)",
-	.read = file_read,
+	.read = file_read
 	/*
 	 * Some enterprising programmer could probably add write functionality
 	 * to FILE(), although I'm not sure how useful it would be.  Hence why
 	 * it's called FILE and not READFILE (like the app was).
 	 */
-	.desc =
-"<offset> may be specified as any number.  If negative, <offset> specifies\n"
-"    the number of bytes back from the end of the file.\n"
-"<length>, if specified, will limit the length of the data read to that size.\n",
 };
 
 static int unload_module(void)




More information about the asterisk-commits mailing list