1 --- glob.3.orig 2011-01-26 13:57:29.000000000 -0800
2 +++ glob.3 2011-01-26 14:02:29.000000000 -0800
4 .\" @(#)glob.3 8.3 (Berkeley) 4/16/94
5 .\" $FreeBSD: src/lib/libc/gen/glob.3,v 1.32 2007/01/09 00:27:54 imp Exp $
13 +#ifdef UNIFDEF_BLOCKS
17 .Nd generate pathnames matching a pattern
23 -.Fn glob "const char *pattern" "int flags" "int (*errfunc)(const char *, int)" "glob_t *pglob"
25 +.Fa "const char *restrict pattern"
27 +.Fa "int (*errfunc)(const char *epath, int errno)"
28 +.Fa "glob_t *restrict pglob"
30 +#ifdef UNIFDEF_BLOCKS
33 +.Fa "const char *restrict pattern"
35 +.Fa "int (^errblk)(const char *epath, int errno)"
36 +.Fa "glob_t *restrict pglob"
40 -.Fn globfree "glob_t *pglob"
50 size_t gl_pathc; /* count of total paths so far */
51 - size_t gl_matchc; /* count of paths matching pattern */
52 + int gl_matchc; /* count of paths matching pattern */
53 size_t gl_offs; /* reserved at beginning of gl_pathv */
54 int gl_flags; /* returned flags */
55 char **gl_pathv; /* list of paths matching pattern */
59 returns zero, the error is ignored.
60 +#ifdef UNIFDEF_BLOCKS
66 +except that the error callback is a block pointer instead of a function
72 function frees any space associated with
74 from a previous call(s) to
75 +#ifdef UNIFDEF_BLOCKS
83 On successful completion,
85 +#ifdef UNIFDEF_BLOCKS
91 -In addition the fields of
93 +In addition, the fields of
95 contain the values described below:
96 .Bl -tag -width GLOB_NOCHECK
98 contains the total number of matched pathnames so far.
99 This includes other matches from previous invocations of
101 +#ifdef UNIFDEF_BLOCKS
109 contains the number of matched pathnames in the current invocation of
110 +#ifdef UNIFDEF_BLOCKS
118 contains a copy of the
124 +#ifdef UNIFDEF_BLOCKS
128 terminates due to an error, it sets errno and returns one of the
129 following non-zero constants, which are defined in the include
132 g.gl_pathv[1] = "-l";
133 execvp("ls", g.gl_pathv);
138 +#ifdef UNIFDEF_BLOCKS
145 +will not match filenames that begin with a period
146 +unless this is specifically requested (e.g., by ".*").
152 functions first appeared in
154 +#ifdef UNIFDEF_BLOCKS
157 +function first appeared in Mac OS X 10.6.
167 +#ifdef UNIFDEF_BLOCKS
174 may fail and set errno for any of the errors specified for the