glob.h revision 1
/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* posix glob interface definitions with gnu extensions
*/
#ifndef _GLOB_H
#define _GLOB_H
#define GLOB_VERSION 20060717L
#include <stdlib.h>
struct dirent;
struct stat;
struct _glob_;
struct _globlist_;
typedef struct _globlist_ globlist_t;
struct _globlist_
{
char* gl_begin;
unsigned char gl_flags;
char gl_path[1];
};
struct _glob_
{
char** gl_pathv;
int gl_flags;
/* GLOB_DISC data -- memset(&gl,0,sizeof(gl)) before using! */
const char* gl_fignore;
const char* gl_suffix;
unsigned char* gl_intr;
int gl_delim;
void* gl_handle;
void* (*gl_diropen)(glob_t*, const char*);
char* (*gl_dirnext)(glob_t*, void*);
void (*gl_dirclose)(glob_t*, void*);
/* gnu extensions -- but how do you synthesize dirent and stat? */
void* (*gl_opendir)(const char*);
struct dirent* (*gl_readdir)(void*);
void (*gl_closedir)(void*);
/* ast additions */
char* (*gl_nextdir)(glob_t*, char*);
unsigned long gl_status;
unsigned long gl_version;
unsigned short gl_extra;
#ifdef _GLOB_PRIVATE_
#else
char* gl_pad[23];
#endif
};
/* standard interface */
/* extended interface */
/* gl_status */
/* gl_type return */
#define GLOB_NOTFOUND 0 /* does not exist */
/* error return values */
#define GLOB_ABORTED 1
#define GLOB_NOMATCH 2
#define GLOB_NOSPACE 3
#define GLOB_INTR 4
#define GLOB_APPERR 5
#define GLOB_NOSYS 6
#if _BLD_ast && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#undef extern
#endif /* _GLOB_H */