aboutsummaryrefslogtreecommitdiff
path: root/posix/glob.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-12-09 10:00:22 +0000
committerRoland McGrath <roland@gnu.org>1995-12-09 10:00:22 +0000
commit787e4db95ce0de5195bc066b4682f840bec7baaf (patch)
tree07076e97588c63a8d94b74c83603e5ddc071592e /posix/glob.h
parentc994299d50b9fae6fdd735a9c7bd183f89981d78 (diff)
downloadglibc-787e4db95ce0de5195bc066b4682f840bec7baaf.zip
glibc-787e4db95ce0de5195bc066b4682f840bec7baaf.tar.gz
glibc-787e4db95ce0de5195bc066b4682f840bec7baaf.tar.bz2
Fri Dec 8 13:04:51 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-951210cvs/libc-951209
* locale/error.c, locale/error.h: Files removed. * locale/Makefile (distribute): Remove error.h. (lib-modules): Remove error. * hurd/hurdlookup.c (__hurd_file_name_lookup_retry): For "tty" magic, return ENXIO if no ctty. * sysdeps/mach/hurd/mmap.c: For MAP_FIXED, deallocate a previous mapping if vm_map fails for that reason. * posix/glob.c: Implement new options GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_TILDE, GLOB_NOMAGIC. (glob): Use stat instead of lstat to determine directoriness. * posix/glob.h (GLOB_ALTDIRFUNC, GLOB_BRACE, GLOB_NOMAGIC, GLOB_TILDE): New flag bits. (__GLOB_FLAGS): Include them. (glob_t): New members gl_closedir, gl_readdir, gl_opendir, gl_lstat, gl_stat. * elf/elf.h (ET_NUM, SHT_NUM, STB_NUM, STT_NUM, PT_NUM): New macros. * sysdeps/unix/sysv/linux/sys/mman.h: Include <linux/mman.h> to define all the bit values. (MAP_*, MCL_*): Macros removed.
Diffstat (limited to 'posix/glob.h')
-rw-r--r--posix/glob.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/posix/glob.h b/posix/glob.h
index 05ad47f..6eea062 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -47,10 +47,16 @@ extern "C"
#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
- GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD)
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
+ GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
+ GLOB_NOMAGIC|GLOB_TILDE)
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+#define GLOB_ALTDIRFUNC (1 << 9)/* Use gl_opendir et al functions. */
+#define GLOB_BRACE (1 << 10)/* Expand "{a,b}" to "a" "b". */
+#define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
+#define GLOB_TILDE (1 <<12)/* Expand ~user and ~ to home directories. */
#endif
/* Error returns from `glob'. */
@@ -59,12 +65,21 @@ extern "C"
#define GLOB_NOMATCH 3 /* No matches found. */
/* Structure describing a globbing run. */
+struct stat;
typedef struct
{
int gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */
int gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+
+ /* If the GLOB_ALTDIRFUNC flag is set, the following functions
+ are used instead of the normal file access functions. */
+ void (*gl_closedir) __P ((void *));
+ struct dirent *(*gl_readdir) __P ((void *));
+ __ptr_t (*gl_opendir) __P ((const char *));
+ int (*gl_lstat) __P ((const char *, struct stat *));
+ int (*gl_stat) __P ((const char *, struct stat *));
} glob_t;
/* Do glob searching for PATTERN, placing results in PGLOB.