Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/string mdoc'ify



details:   https://anonhg.NetBSD.org/src/rev/4a5d7eb1b61d
branches:  trunk
changeset: 508229:4a5d7eb1b61d
user:      wiz <wiz%NetBSD.org@localhost>
date:      Mon Apr 09 12:07:57 2001 +0000

description:
mdoc'ify

diffstat:

 lib/libc/string/bm.3 |  103 +++++++++++++++++++++++++-------------------------
 1 files changed, 52 insertions(+), 51 deletions(-)

diffs (142 lines):

diff -r fbec3721d969 -r 4a5d7eb1b61d lib/libc/string/bm.3
--- a/lib/libc/string/bm.3      Mon Apr 09 11:52:27 2001 +0000
+++ b/lib/libc/string/bm.3      Mon Apr 09 12:07:57 2001 +0000
@@ -1,3 +1,5 @@
+.\" $NetBSD: bm.3,v 1.4 2001/04/09 12:07:57 wiz Exp $
+.\"
 .\" Copyright (c) 1994
 .\"    The Regents of the University of California.  All rights reserved.
 .\"
@@ -33,82 +35,81 @@
 .\" SUCH DAMAGE.
 .\"
 .\"    from: @(#)bm.3  8.4 (Berkeley) 6/21/94
-.\"    $NetBSD: bm.3,v 1.3 1997/10/09 10:08:23 lukem Exp $
 .\"
-.TH BM 3
-.SH NAME
-bm_comp, bm_exec, bm_free \- Boyer-Moore string search
-.SH SYNOPSIS
-.ft B
-#include <sys/types.h>
-.br
-#include <bm.h>
-.sp
-bm_pat *
-.br
-bm_comp(u_char *pattern, size_t patlen, u_char freq[256]);
-.sp
-u_char *
-.br
-bm_exec(bm_pat *pdesc, u_char *text, size_t len);
-.sp
-void
-.br
-bm_free(bm_pat *pdesc);
-.SH DESCRIPTION
+.Dd April 8, 2001
+.Dt BM 3
+.Os
+.Sh NAME
+.Nm bm_comp ,
+.Nm bm_exec ,
+.Nm bm_free
+.Nd Boyer-Moore string search
+.Sh LIBRARY
+.Lb libc
+.Sh SYNOPSIS
+.Fd #include <sys/types.h>
+.Fd #include <bm.h>
+.Ft bm_pat *
+.Fn bm_comp "u_char *pattern" "size_t patlen" "u_char freq[256]"
+.Ft u_char *
+.Fn bm_exec "bm_pat *pdesc" "u_char *text" "size_t len"
+.Ft void
+.Fn bm_free "bm_pat *pdesc"
+.Sh DESCRIPTION
 These routines implement an efficient mechanism to find an
 occurrence of a byte string within another byte string.
-.PP
-.I Bm_comp
+.Pp
+.Fn bm_comp
 evaluates the
-.I patlen
+.Fa patlen
 bytes starting at
-.IR pattern ,
+.Fa pattern ,
 and returns a pointer to a structure describing them.
 The bytes referenced by
-.I pattern
+.Fa pattern
 may be of any value.
-.PP
+.Pp
 The search takes advantage of the frequency distribution of the
 bytes in the text to be searched.
 If specified,
-.I freq
+.Fa freq
 should be an array of 256 values,
 with higher values indicating that the corresponding character occurs
 more frequently.
 (A less than optimal frequency distribution can only result in less
 than optimal performance, not incorrect results.)
 If
-.I freq
+.Fa freq
 is NULL,
 a system default table is used.
-.PP
-.I Bm_exec
+.Pp
+.Fn bm_exec
 returns a pointer to the leftmost occurrence of the string given to
-.I bm_comp
+.Fn bm_comp
 within
-.IR text ,
+.Fa text ,
 or NULL if none occurs.
 The number of bytes in
-.I text
+.Fa text
 must be specified by
-.IR len .
-.PP
+.Fa len .
+.Pp
 Space allocated for the returned description is discarded
 by calling
-.I bm_free
+.Fn bm_free
 with the returned description as an argument.
-.PP
+.Pp
 The asymptotic speed of
-.I bm_exec
-is
-.RI O( len / patlen ).
-.PP
-.SH "SEE ALSO"
-.IR regexp (3),
-.IR strstr (3)
-.sp
-.IR "Fast String Searching" ,
-Hume and Sunday,
-Software Practice and Experience,
-Vol. 21, 11 (November 1991) pp. 1221-48.
+.Fn bm_exec
+is O(len/patlen).
+.Sh SEE ALSO
+.Xr regexp 3 ,
+.Xr strstr 3
+.Rs
+.%A Hume and Sunday
+.%D November 1991
+.%J "Software Practice and Experience"
+.%P pp. 1221-48
+.%T "Fast String Searching"
+.%V Vol. 21, 11
+.Re



Home | Main Index | Thread Index | Old Index