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