xref: /original-bsd/include/glob.h (revision 454fcdce)
1 /*
2  * Copyright (c) 1989 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Guido van Rossum.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)glob.h	5.4 (Berkeley) 03/07/91
11  */
12 
13 typedef struct {
14 	int gl_pathc;		/* count of paths matching pattern */
15 	int gl_offs;		/* reserved at beginning of gl_pathv */
16 	int gl_flags;		/* copy of flags parameter to glob() */
17 	int (*gl_errfunc)();	/* copy of errfunc parameter to glob() */
18 	char **gl_pathv;	/* list of paths matching pattern */
19 } glob_t;
20 
21 #define	GLOB_ERR	0x01	/* return on error */
22 #define	GLOB_MARK	0x02	/* append / to matching directories */
23 #define	GLOB_NOSORT	0x04	/* don't sort */
24 #define	GLOB_NOCHECK	0x08	/* return pattern itself if nothing matches */
25 #define	GLOB_DOOFFS	0x10	/* use gl_offs */
26 #define	GLOB_APPEND	0x20	/* append to output from previous call */
27 
28 #ifndef _POSIX_SOURCE
29 #define	GLOB_QUOTE	0x40	/* quote special chars with \ */
30 #endif
31 
32 #define	GLOB_NOSPACE	(-1)	/* malloc call failed */
33 #define	GLOB_ABEND	(-2)	/* unignored error */
34 
35 #include <sys/cdefs.h>
36 
37 __BEGIN_DECLS
38 int glob __P((const char *, int, int (*)(char *, int), glob_t *));
39 void globfree __P((glob_t *));
40 __END_DECLS
41