1<glob.h>(0P) POSIX Programmer's Manual <glob.h>(0P)
2
3
4
6 glob.h - pathname pattern-matching types
7
9 #include <glob.h>
10
12 The <glob.h> header shall define the structures and symbolic constants
13 used by the glob() function.
14
15 The structure type glob_t shall contain at least the following members:
16
17
18 size_t gl_pathc Count of paths matched by pattern.
19 char **gl_pathv Pointer to a list of matched pathnames.
20 size_t gl_offs Slots to reserve at the beginning of gl_pathv.
21
22 The following constants shall be provided as values for the flags argu‐
23 ment:
24
25 GLOB_APPEND
26 Append generated pathnames to those previously obtained.
27
28 GLOB_DOOFFS
29 Specify how many null pointers to add to the beginning of
30 gl_pathv.
31
32 GLOB_ERR
33 Cause glob() to return on error.
34
35 GLOB_MARK
36 Each pathname that is a directory that matches pattern has a
37 slash appended.
38
39 GLOB_NOCHECK
40 If pattern does not match any pathname, then return a list con‐
41 sisting of only pattern.
42
43 GLOB_NOESCAPE
44 Disable backslash escaping.
45
46 GLOB_NOSORT
47 Do not sort the pathnames returned.
48
49
50 The following constants shall be defined as error return values:
51
52 GLOB_ABORTED
53 The scan was stopped because GLOB_ERR was set or (*errfunc)()
54 returned non-zero.
55
56 GLOB_NOMATCH
57 The pattern does not match any existing pathname, and
58 GLOB_NOCHECK was not set in flags.
59
60 GLOB_NOSPACE
61 An attempt to allocate memory failed.
62
63 GLOB_NOSYS
64 Reserved.
65
66
67 The following shall be declared as functions and may also be defined as
68 macros. Function prototypes shall be provided.
69
70
71 int glob(const char *restrict, int, int (*)(const char *, int),
72 glob_t *restrict);
73 void globfree (glob_t *);
74
75 The implementation may define additional macros or constants using
76 names beginning with GLOB_.
77
78 The following sections are informative.
79
81 None.
82
84 None.
85
87 None.
88
90 The System Interfaces volume of IEEE Std 1003.1-2001, glob(), the Shell
91 and Utilities volume of IEEE Std 1003.1-2001
92
94 Portions of this text are reprinted and reproduced in electronic form
95 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
96 -- Portable Operating System Interface (POSIX), The Open Group Base
97 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
98 Electrical and Electronics Engineers, Inc and The Open Group. In the
99 event of any discrepancy between this version and the original IEEE and
100 The Open Group Standard, the original IEEE and The Open Group Standard
101 is the referee document. The original Standard can be obtained online
102 at http://www.opengroup.org/unix/online.html .
103
104
105
106IEEE/The Open Group 2003 <glob.h>(0P)