[asterisk-commits] trunk r26283 - /trunk/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed May 10 00:45:14 MST 2006


Author: rizzo
Date: Wed May 10 02:45:14 2006
New Revision: 26283

URL: http://svn.digium.com/view/asterisk?rev=26283&view=rev
Log:
document special character interpretation.


Modified:
    trunk/pbx.c

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=26283&r1=26282&r2=26283&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Wed May 10 02:45:14 2006
@@ -560,6 +560,33 @@
 	free(p);
 }
 
+/*
+ * Special characters used in patterns:
+ *	'_'	underscore is the leading character of a pattern.
+ *		In other position it is treated as a regular char.
+ *	' ' '-'	space and '-' are separator and ignored.
+ *	.	one or more of any character. Only allowed at the end of
+ *		a pattern.
+ *	!	zero or more of anything. Also impacts the result of CANMATCH
+ *		and MATCHMORE. Only allowed at the end of a pattern.
+ *	/	should not appear as it is considered the separator of the CID info.
+ *		XXX at the moment we may stop on this char.
+ *
+ *	X Z N	match ranges 0-9, 1-9, 2-9 respectively.
+ *	[	denotes the start of a set of character. Everything inside
+ *		is considered literally. We can have ranges a-d and individual
+ *		characters. A '[' and '-' can be considered literally if they
+ *		are just before ']'.
+ *		XXX currently there is no way to specify ']' in a range, nor \ is
+ *		considered specially.
+ *
+ * When we compare a pattern with a specific extension, all characters in the extension
+ * itself are considered literally with the only exception of '-' which is considered
+ * as a separator and thus ignored.
+ * XXX do we want to consider space as a separator as well ?
+ * XXX do we want to consider the separators in non-patterns as well ?
+ */
+
 /*!
  * \brief helper functions to sort extensions and patterns in the desired way,
  * so that more specific patterns appear first.
@@ -722,6 +749,10 @@
 			return 0;
 	}
 	pattern++; /* skip leading _ */
+	/*
+	 * XXX below we stop at '/' which is a separator for the CID info. However we should
+	 * not store '/' in the pattern at all. When we insure it, we can remove the checks.
+	 */
 	while (*data && *pattern && *pattern != '/') {
 		const char *end;
 



More information about the asterisk-commits mailing list