annotate lib/glob-libc.h @ 40196:e63f5d3edab5

relocatable-prog: Update documentation. * doc/relocatable-maint.texi (Supporting Relocation): Update to match the recent changes.
author Bruno Haible <bruno@clisp.org>
date Sun, 24 Feb 2019 01:49:15 +0100
parents b06060465f09
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
40057
b06060465f09 maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents: 19484
diff changeset
1 /* Copyright (C) 1991-2019 Free Software Foundation, Inc.
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
2 This file is part of the GNU C Library.
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
3
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
4 The GNU C Library is free software; you can redistribute it and/or
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
5 modify it under the terms of the GNU Lesser General Public
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
6 License as published by the Free Software Foundation; either
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
7 version 2.1 of the License, or (at your option) any later version.
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
8
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
9 The GNU C Library is distributed in the hope that it will be useful,
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
12 Lesser General Public License for more details.
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
13
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
14 You should have received a copy of the GNU Lesser General Public
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
15 License along with the GNU C Library; if not, see
19190
9759915b2aca all: prefer https: URLs
Paul Eggert <eggert@cs.ucla.edu>
parents: 19084
diff changeset
16 <https://www.gnu.org/licenses/>. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
17
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
18 #ifndef _GLOB_H
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
19 #define _GLOB_H 1
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
20
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
21 #ifndef __GLOB_GNULIB
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
22 # include <sys/cdefs.h>
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
23 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
24
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
25 __BEGIN_DECLS
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
26
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
27 #define __need_size_t
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
28 #include <stddef.h>
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
29
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
30 /* Bits set in the FLAGS argument to 'glob'. */
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
31 #define GLOB_ERR (1 << 0)/* Return on read errors. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
32 #define GLOB_MARK (1 << 1)/* Append a slash to each name. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
33 #define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
34 #define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
35 #define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
36 #define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
37 #define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
38 #define GLOB_PERIOD (1 << 7)/* Leading '.' can be matched by metachars. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
39
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
40 #if !defined __USE_POSIX2 || defined __USE_MISC
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
41 # define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
42 # define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
43 # define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
44 # define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
45 # define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
46 # define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
47 # define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
48 if the user name is not available. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
49 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
50 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
51 GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
52 GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
53 #else
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
54 # define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
55 GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
56 GLOB_PERIOD)
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
57 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
58
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
59 /* Error returns from 'glob'. */
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
60 #define GLOB_NOSPACE 1 /* Ran out of memory. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
61 #define GLOB_ABORTED 2 /* Read error. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
62 #define GLOB_NOMATCH 3 /* No matches found. */
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
63 #define GLOB_NOSYS 4 /* Not implemented. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
64 #ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
65 /* Previous versions of this file defined GLOB_ABEND instead of
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
66 GLOB_ABORTED. Provide a compatibility definition here. */
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
67 # define GLOB_ABEND GLOB_ABORTED
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
68 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
69
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
70 /* Structure describing a globbing run. */
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
71 #ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
72 struct stat;
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
73 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
74 typedef struct
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
75 {
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
76 size_t gl_pathc; /* Count of paths matched by the pattern. */
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
77 char **gl_pathv; /* List of matched pathnames. */
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
78 size_t gl_offs; /* Slots to reserve in 'gl_pathv'. */
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
79 int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
80
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
81 /* If the GLOB_ALTDIRFUNC flag is set, the following functions
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
82 are used instead of the normal file access functions. */
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
83 void (*gl_closedir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
84 #ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
85 struct dirent *(*gl_readdir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
86 #else
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
87 void *(*gl_readdir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
88 #endif
6542
08a1fd25e68a * argp.h (__const): Remove macro. Use const instead.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6223
diff changeset
89 void *(*gl_opendir) (const char *);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
90 #ifdef __USE_GNU
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
91 int (*gl_lstat) (const char *__restrict, struct stat *__restrict);
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
92 int (*gl_stat) (const char *__restrict, struct stat *__restrict);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
93 #else
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
94 int (*gl_lstat) (const char *__restrict, void *__restrict);
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
95 int (*gl_stat) (const char *__restrict, void *__restrict);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
96 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
97 } glob_t;
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
98
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
99 #ifdef __USE_LARGEFILE64
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
100 # ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
101 struct stat64;
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
102 # endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
103 typedef struct
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
104 {
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
105 size_t gl_pathc;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
106 char **gl_pathv;
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
107 size_t gl_offs;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
108 int gl_flags;
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
109
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
110 /* If the GLOB_ALTDIRFUNC flag is set, the following functions
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
111 are used instead of the normal file access functions. */
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
112 void (*gl_closedir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
113 # ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
114 struct dirent64 *(*gl_readdir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
115 # else
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
116 void *(*gl_readdir) (void *);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
117 # endif
6542
08a1fd25e68a * argp.h (__const): Remove macro. Use const instead.
Paul Eggert <eggert@cs.ucla.edu>
parents: 6223
diff changeset
118 void *(*gl_opendir) (const char *);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
119 # ifdef __USE_GNU
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
120 int (*gl_lstat) (const char *__restrict, struct stat64 *__restrict);
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
121 int (*gl_stat) (const char *__restrict, struct stat64 *__restrict);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
122 # else
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
123 int (*gl_lstat) (const char *__restrict, void *__restrict);
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
124 int (*gl_stat) (const char *__restrict, void *__restrict);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
125 # endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
126 } glob64_t;
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
127 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
128
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
129 /* Do glob searching for PATTERN, placing results in PGLOB.
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
130 The bits defined above may be set in FLAGS.
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
131 If a directory cannot be opened or read and ERRFUNC is not nil,
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
132 it is called with the pathname that caused the error, and the
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
133 'errno' value from the failing call; if it returns non-zero
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
134 'glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
135 If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
136 Otherwise, 'glob' returns zero. */
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
137 #if !defined __USE_FILE_OFFSET64 || defined __GLOB_GNULIB
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
138 extern int glob (const char *__restrict __pattern, int __flags,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
139 int (*__errfunc) (const char *, int),
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
140 glob_t *__restrict __pglob) __THROW;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
141
16235
18a38c9615f0 In commentary, do not use ` to quote.
Paul Eggert <eggert@cs.ucla.edu>
parents: 16201
diff changeset
142 /* Free storage allocated in PGLOB by a previous 'glob' call. */
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
143 extern void globfree (glob_t *__pglob) __THROW;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
144 #else
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
145 extern int __REDIRECT_NTH (glob, (const char *__restrict __pattern,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
146 int __flags,
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
147 int (*__errfunc) (const char *, int),
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
148 glob_t *__restrict __pglob), glob64);
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
149
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
150 extern void __REDIRECT_NTH (globfree, (glob_t *__pglob), globfree64);
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
151 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
152
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
153 #ifdef __USE_LARGEFILE64
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
154 extern int glob64 (const char *__restrict __pattern, int __flags,
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 12002
diff changeset
155 int (*__errfunc) (const char *, int),
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
156 glob64_t *__restrict __pglob) __THROW;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
157
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
158 extern void globfree64 (glob64_t *__pglob) __THROW;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
159 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
160
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
161
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
162 #ifdef __USE_GNU
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
163 /* Return nonzero if PATTERN contains any metacharacters.
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
164 Metacharacters can be quoted with backslashes if QUOTE is nonzero.
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
165
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
166 This function is not part of the interface specified by POSIX.2
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
167 but several programs want to use it. */
19084
57cf6c9186eb glob: merge from glibc with Zanella glob changes
Paul Eggert <eggert@cs.ucla.edu>
parents: 18656
diff changeset
168 extern int glob_pattern_p (const char *__pattern, int __quote) __THROW;
6223
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
169 #endif
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
170
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
171 __END_DECLS
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
172
1c8ef7732db0 * modules/glob (Files): Add glob-libc.h.
Derek R. Price <derek@ximbiot.com>
parents:
diff changeset
173 #endif /* glob.h */