2 /* : : generated by proto : : */
3 /***********************************************************************
5 * This software is part of the ast package *
6 * Copyright (c) 1985-2010 AT&T Intellectual Property *
7 * and is licensed under the *
8 * Common Public License, Version 1.0 *
9 * by AT&T Intellectual Property *
11 * A copy of the License is available at *
12 * http://www.opensource.org/licenses/cpl1.0.txt *
13 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
15 * Information and Software Systems Research *
19 * Glenn Fowler <gsf@research.att.com> *
20 * David Korn <dgk@research.att.com> *
21 * Phong Vo <kpv@research.att.com> *
23 ***********************************************************************/
26 * posix glob interface definitions with gnu extensions
30 #if !defined(__PROTO__)
31 #include <prototyped.h>
33 #if !defined(__LINKAGE__)
34 #define __LINKAGE__ /* 2004-08-11 transition */
39 #define GLOB_VERSION 20060717L
49 typedef struct _glob_ glob_t
;
50 typedef struct _globlist_ globlist_t
;
56 unsigned char gl_flags
;
68 /* GLOB_DISC data -- memset(&gl,0,sizeof(gl)) before using! */
70 const char* gl_fignore
;
71 const char* gl_suffix
;
72 unsigned char* gl_intr
;
77 __V_
* (*gl_diropen
) __PROTO__((glob_t
*, const char*));
78 char* (*gl_dirnext
) __PROTO__((glob_t
*, __V_
*));
79 void (*gl_dirclose
) __PROTO__((glob_t
*, __V_
*));
80 int (*gl_type
) __PROTO__((glob_t
*, const char*, int));
81 int (*gl_attr
) __PROTO__((glob_t
*, const char*, int));
83 /* gnu extensions -- but how do you synthesize dirent and stat? */
85 __V_
* (*gl_opendir
) __PROTO__((const char*));
86 struct dirent
* (*gl_readdir
) __PROTO__((__V_
*));
87 void (*gl_closedir
) __PROTO__((__V_
*));
88 int (*gl_stat
) __PROTO__((const char*, struct stat
*));
89 int (*gl_lstat
) __PROTO__((const char*, struct stat
*));
93 char* (*gl_nextdir
) __PROTO__((glob_t
*, char*));
94 unsigned long gl_status
;
95 unsigned long gl_version
;
96 unsigned short gl_extra
;
106 /* standard interface */
107 #define GLOB_APPEND 0x0001 /* append to previous */
108 #define GLOB_DOOFFS 0x0002 /* gl_offs defines argv offset */
109 #define GLOB_ERR 0x0004 /* abort on error */
110 #define GLOB_MARK 0x0008 /* append / to directories */
111 #define GLOB_NOCHECK 0x0010 /* nomatch is original pattern */
112 #define GLOB_NOESCAPE 0x0020 /* don't treat \ specially */
113 #define GLOB_NOSORT 0x0040 /* don't sort the list */
115 /* extended interface */
116 #define GLOB_STARSTAR 0x0080 /* enable [/]**[/] expansion */
117 #define GLOB_BRACE 0x0100 /* enable {...} expansion */
118 #define GLOB_ICASE 0x0200 /* ignore case on match */
119 #define GLOB_COMPLETE 0x0400 /* shell file completeion */
120 #define GLOB_AUGMENTED 0x0800 /* augmented shell patterns */
121 #define GLOB_STACK 0x1000 /* allocate on current stack */
122 #define GLOB_LIST 0x2000 /* just create gl_list */
123 #define GLOB_ALTDIRFUNC 0x4000 /* gnu discipline functions */
124 #define GLOB_DISC 0x8000 /* discipline initialized */
127 #define GLOB_NOTDIR 0x0001 /* last gl_dirnext() not a dir */
130 #define GLOB_NOTFOUND 0 /* does not exist */
131 #define GLOB_DEV 1 /* exists but not DIR EXE REG */
132 #define GLOB_DIR 2 /* directory */
133 #define GLOB_EXE 3 /* executable regular file */
134 #define GLOB_REG 4 /* regular file */
136 /* error return values */
137 #define GLOB_ABORTED 1
138 #define GLOB_NOMATCH 2
139 #define GLOB_NOSPACE 3
141 #define GLOB_APPERR 5
144 #if _BLD_ast && defined(__EXPORT__)
146 #define __MANGLE__ __LINKAGE__ __EXPORT__
149 extern __MANGLE__
int glob
__PROTO__((const char*, int, int(*)(const char*,int), glob_t
*));
150 extern __MANGLE__
void globfree
__PROTO__((glob_t
*));
153 #define __MANGLE__ __LINKAGE__