chiark / gitweb /
cleanup: All the whitespace fixes, all at once.
[mLib] / man / str.3
index e91fc13c8ac52aad2d3fb6d7ad4f6b5a1d7d5c21..13bc18fbd6dac55b3a7d775b1988efc2b41ff46a 100644 (file)
--- a/man/str.3
+++ b/man/str.3
 .sp 1
 .fi
 ..
-.TH str 3 "20 June 1999" mLib
+.TH str 3 "20 June 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH NAME
 str \- small string utilities
 .\" @str_qword
 .\" @str_qsplit
 .\" @str_getword
 .\" @str_split
+.\" @str_matchx
 .\" @str_match
 .\" @str_sanitize
 .SH SYNOPSIS
@@ -29,6 +30,7 @@ str \- small string utilities
 .BI "                  char **" rest ", unsigned " f );
 .BI "char *str_getword(char **" pp );
 .BI "size_t str_split(char *" p ", char *" v "[], size_t " c ", char **" rest );
+.BI "int str_matchx(const char *" p ", const char *" s ", unsigned " f );
 .BI "int str_match(const char *" p ", const char *" s );
 .BI "void str_sanitize(char *" d ", const char *" p ", size_t " sz );
 .fi
@@ -36,7 +38,7 @@ str \- small string utilities
 The header file
 .B <mLib/str.h>
 contains a few small utility functions for manipulating null-terminated
-strings.  
+strings.
 .PP
 The function
 .B str_qword
@@ -107,7 +109,7 @@ respectively; they are equivalent to calls to the latter functions with
 flags words of zero.
 .PP
 The
-.B str_match
+.B str_matchx
 function does simple wildcard matching.  The first argument is a
 pattern, which may contain metacharacters:
 .RB ` * '
@@ -134,7 +136,17 @@ of the set.  The return value is nonzero if the pattern
 .I p
 matches the given string
 .IR s ,
-or zero if the pattern doesn't match.
+or zero if the pattern doesn't match.  If the flag
+.B STRF_PREFIX
+is passed,
+.B str_matchx
+returns true if it reaches the end of the target string before finding a
+mismatch \(en i.e., if the target string is a prefix of a string which
+might match the pattern.  The function
+.B str_match
+is a convenient wrapper for
+.B str_matchx
+with a zero flags word, which is the normal case.
 .PP
 The function
 .B str_sanitize
@@ -195,4 +207,4 @@ will be null.
 .SH "SEE ALSO"
 .BR mLib (3).
 .SH AUTHOR
-Mark Wooding, <mdw@nsict.org>
+Mark Wooding, <mdw@distorted.org.uk>