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.6 (Berkeley) 04/03/91 11 */ 12 13 #ifndef _GLOB_H_ 14 #define _GLOB_H_ 15 16 typedef struct { 17 int gl_pathc; /* count of total paths so far */ 18 int gl_matchc; /* count of paths matching pattern */ 19 int gl_offs; /* reserved at beginning of gl_pathv */ 20 int gl_flags; /* copy of flags parameter to glob() */ 21 int (*gl_errfunc)(); /* copy of errfunc parameter to glob() */ 22 char **gl_pathv; /* list of paths matching pattern */ 23 } glob_t; 24 25 #define GLOB_APPEND 0x01 /* append to output from previous call */ 26 #define GLOB_DOOFFS 0x02 /* use gl_offs */ 27 #define GLOB_ERR 0x04 /* return on error */ 28 #ifndef _POSIX_SOURCE 29 #define GLOB_MAGCHAR 0x08 /* pattern had globbing characters */ 30 #endif 31 #define GLOB_MARK 0x10 /* append / to matching directories */ 32 #define GLOB_NOCHECK 0x20 /* return pattern itself if nothing matches */ 33 #define GLOB_NOSORT 0x40 /* don't sort */ 34 #ifndef _POSIX_SOURCE 35 #define GLOB_QUOTE 0x80 /* quote special chars with \ */ 36 #endif 37 38 #define GLOB_NOSPACE (-1) /* malloc call failed */ 39 #define GLOB_ABEND (-2) /* unignored error */ 40 41 #include <sys/cdefs.h> 42 43 __BEGIN_DECLS 44 int glob __P((const char *, int, int (*)(char *, int), glob_t *)); 45 void globfree __P((glob_t *)); 46 __END_DECLS 47 48 #endif /* !_GLOB_H_ */ 49