chiark / gitweb /
buf.h: Spurious `\' prevents declaration of `buf_putstr*'.
[mLib] / str.h
diff --git a/str.h b/str.h
index c7bd87b1950e88438354fe7bc082d2522b2898d5..9d3192e1064cd99edf698bcccf6a47bb82b0940b 100644 (file)
--- a/str.h
+++ b/str.h
@@ -7,7 +7,7 @@
  * (c) 1999 Straylight/Edgeware
  */
 
-/*----- Licensing notice --------------------------------------------------* 
+/*----- Licensing notice --------------------------------------------------*
  *
  * This file is part of the mLib utilities library.
  *
  * it under the terms of the GNU Library General Public License as
  * published by the Free Software Foundation; either version 2 of the
  * License, or (at your option) any later version.
- * 
+ *
  * mLib is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU Library General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Library General Public
  * License along with mLib; if not, write to the Free
  * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
@@ -110,10 +110,11 @@ extern char *str_getword(char **/*pp*/);
 extern size_t str_split(char */*p*/, char */*v*/[],
                        size_t /*c*/, char **/*rest*/);
 
-/* --- @str_match@ --- *
+/* --- @str_matchx@ --- *
  *
  * Arguments:  @const char *p@ = pointer to pattern string
  *             @const char *s@ = string to compare with
+ *             @unsigned f@ = various flags
  *
  * Returns:    Nonzero if the pattern matches the string.
  *
@@ -122,6 +123,22 @@ extern size_t str_split(char */*p*/, char */*v*/[],
  *             '['.
  */
 
+#define STRF_PREFIX 1u                 /* Accept if @s@ is exhausted during
+                                        *   the attempted match */
+
+extern int str_matchx(const char */*p*/, const char */*s*/, unsigned /*f*/);
+
+/* --- @str_match@ --- *
+ *
+ * Arguments:  @const char *p@ = pointer to pattern string
+ *             @const char *s@ = string to compare with
+ *
+ * Returns:    Nonzero if the pattern matches the string.
+ *
+ * Use:                Does simple wildcard matching.  Equivalent to @str_matchx@
+ *             with zero flags word.
+ */
+
 extern int str_match(const char */*p*/, const char */*s*/);
 
 /* --- @str_sanitize@ --- *