Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-10-17 21:34:56 +0400
committerCorinna Vinschen <corinna@vinschen.de>2006-10-17 21:34:56 +0400
commit733c9ed37453cd51529fa080a3376d1db1461987 (patch)
tree807c66ad8ee9b0d8a7a0eb99bac0c529b6bacafc /winsup/cygwin/include/glob.h
parentc4e12ec3592fdb40b18bc98ba3afdb59617fa84e (diff)
* glob.c: Remove.
* glob.cc: New file. Latest glob version from FreeBSD plus Cygwin specific changes (__stat64/__stat32, ignore_case_with_glob, drop collate functions). (glob3): Return GLOB_ABORTED in case directory is unreadable and GLOB_ERR is set, as demanded by SUSv3. * glob.h: Import latest version from FreeBSD.
Diffstat (limited to 'winsup/cygwin/include/glob.h')
-rw-r--r--winsup/cygwin/include/glob.h47
1 files changed, 25 insertions, 22 deletions
diff --git a/winsup/cygwin/include/glob.h b/winsup/cygwin/include/glob.h
index bfcf306f4..1a463cad1 100644
--- a/winsup/cygwin/include/glob.h
+++ b/winsup/cygwin/include/glob.h
@@ -1,5 +1,3 @@
-/* $NetBSD: glob.h,v 1.6.2.2 1997/11/04 23:38:33 thorpej Exp $ */
-
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,6 +34,7 @@
* SUCH DAMAGE.
*
* @(#)glob.h 8.1 (Berkeley) 6/2/93
+ * $FreeBSD: /repoman/r/ncvs/src/include/glob.h,v 1.10 2006/05/22 05:57:39 ache Exp $
*/
#ifndef _GLOB_H_
@@ -46,9 +45,9 @@
#include <sys/stat.h>
typedef struct {
- int gl_pathc; /* Count of total paths so far. */
- int gl_matchc; /* Count of paths matching pattern. */
- int gl_offs; /* Reserved at beginning of gl_pathv. */
+ size_t gl_pathc; /* Count of total paths so far. */
+ size_t gl_matchc; /* Count of paths matching pattern. */
+ size_t gl_offs; /* Reserved at beginning of gl_pathv. */
int gl_flags; /* Copy of flags parameter to glob. */
char **gl_pathv; /* List of paths matching pattern. */
/* Copy of errfunc parameter to glob. */
@@ -59,29 +58,33 @@ typedef struct {
* versions of closedir(3), readdir(3), opendir(3), stat(2)
* and lstat(2).
*/
- void (*gl_closedir) __P((void *));
- struct dirent *(*gl_readdir) __P((void *));
- void *(*gl_opendir) __P((const char *));
-#ifdef __LIBC12_SOURCE__
- int (*gl_lstat) __P((const char *, struct stat12 *));
- int (*gl_stat) __P((const char *, struct stat12 *));
-#else
+ void (*gl_closedir)(void *);
+ struct dirent *(*gl_readdir)(void *);
+ void *(*gl_opendir)(const char *);
#if defined (__INSIDE_CYGWIN__)
- int (*gl_lstat) ();
- int (*gl_stat) ();
+ int (*gl_lstat) __P((const char *, struct __stat64 *));
+ int (*gl_stat) __P((const char *, struct __stat64 *));
#else
+
int (*gl_lstat) __P((const char *, struct stat *));
int (*gl_stat) __P((const char *, struct stat *));
#endif
-#endif
} glob_t;
+/* Believed to have been introduced in 1003.2-1992 */
#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
#define GLOB_ERR 0x0004 /* Return on error. */
#define GLOB_MARK 0x0008 /* Append / to matching directories. */
#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
#define GLOB_NOSORT 0x0020 /* Don't sort. */
+#define GLOB_NOESCAPE 0x2000 /* Disable backslash escaping. */
+
+/* Error values returned by glob(3) */
+#define GLOB_NOSPACE (-1) /* Malloc call failed. */
+#define GLOB_ABORTED (-2) /* Unignored error. */
+#define GLOB_NOMATCH (-3) /* No match and GLOB_NOCHECK was not set. */
+#define GLOB_NOSYS (-4) /* Obsolete: source comptability only. */
#ifndef _POSIX_SOURCE
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
@@ -90,11 +93,12 @@ typedef struct {
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
-#define GLOB_LIMIT 0x1000 /* Limit memory used by matches to ARG_MAX */
-#endif
+#define GLOB_LIMIT 0x1000 /* limit number of returned paths */
-#define GLOB_NOSPACE (-1) /* Malloc call failed. */
-#define GLOB_ABEND (-2) /* Unignored error. */
+/* source compatibility, these are the old names */
+#define GLOB_MAXPATH GLOB_LIMIT
+#define GLOB_ABEND GLOB_ABORTED
+#endif /* __BSD_VISIBLE */
__BEGIN_DECLS
@@ -104,10 +108,9 @@ __BEGIN_DECLS
#else
# define DLLEXPORT __declspec(dllimport)
#endif
-int DLLEXPORT glob(const char *, int, int (*)(const char *, int), glob_t *);
-void DLLEXPORT globfree(glob_t *);
-#undef DLLEXPORT
+int DLLEXPORT glob(const char *, int, int (*)(const char *, int), glob_t *);
+void DLLEXPORT globfree(glob_t *);
__END_DECLS
#endif /* !_GLOB_H_ */