fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* : : generated by proto : : */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/***********************************************************************
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* This software is part of the ast package *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Copyright (c) 1985-2010 AT&T Intellectual Property *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* and is licensed under the *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Common Public License, Version 1.0 *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* by AT&T Intellectual Property *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* A copy of the License is available at *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* http://www.opensource.org/licenses/cpl1.0.txt *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Information and Software Systems Research *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* AT&T Research *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Florham Park NJ *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Glenn Fowler <gsf@research.att.com> *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* David Korn <dgk@research.att.com> *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* Phong Vo <kpv@research.att.com> *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte* *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte***********************************************************************/
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * posix glob interface definitions with gnu extensions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _GLOB_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(__PROTO__)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <prototyped.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if !defined(__LINKAGE__)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define __LINKAGE__ /* 2004-08-11 transition */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _GLOB_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_VERSION 20060717L
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <stdlib.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct dirent;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct stat;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct _glob_;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct _globlist_;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _glob_ glob_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortetypedef struct _globlist_ globlist_t;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct _globlist_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte globlist_t* gl_next;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char* gl_begin;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char gl_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char gl_path[1];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestruct _glob_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t gl_pathc;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char** gl_pathv;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte size_t gl_offs;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte globlist_t* gl_list;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int gl_flags;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* GLOB_DISC data -- memset(&gl,0,sizeof(gl)) before using! */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const char* gl_fignore;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte const char* gl_suffix;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned char* gl_intr;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int gl_delim;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte __V_* gl_handle;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte __V_* (*gl_diropen) __PROTO__((glob_t*, const char*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char* (*gl_dirnext) __PROTO__((glob_t*, __V_*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void (*gl_dirclose) __PROTO__((glob_t*, __V_*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*gl_type) __PROTO__((glob_t*, const char*, int));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*gl_attr) __PROTO__((glob_t*, const char*, int));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* gnu extensions -- but how do you synthesize dirent and stat? */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte __V_* (*gl_opendir) __PROTO__((const char*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte struct dirent* (*gl_readdir) __PROTO__((__V_*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte void (*gl_closedir) __PROTO__((__V_*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*gl_stat) __PROTO__((const char*, struct stat*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte int (*gl_lstat) __PROTO__((const char*, struct stat*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /* ast additions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char* (*gl_nextdir) __PROTO__((glob_t*, char*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned long gl_status;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned long gl_version;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte unsigned short gl_extra;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef _GLOB_PRIVATE_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte _GLOB_PRIVATE_
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#else
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char* gl_pad[23];
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte};
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* standard interface */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_APPEND 0x0001 /* append to previous */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_DOOFFS 0x0002 /* gl_offs defines argv offset */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_ERR 0x0004 /* abort on error */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_MARK 0x0008 /* append / to directories */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOCHECK 0x0010 /* nomatch is original pattern */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOESCAPE 0x0020 /* don't treat \ specially */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOSORT 0x0040 /* don't sort the list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* extended interface */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_STARSTAR 0x0080 /* enable [/]**[/] expansion */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_BRACE 0x0100 /* enable {...} expansion */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_ICASE 0x0200 /* ignore case on match */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_COMPLETE 0x0400 /* shell file completeion */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_AUGMENTED 0x0800 /* augmented shell patterns */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_STACK 0x1000 /* allocate on current stack */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_LIST 0x2000 /* just create gl_list */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_ALTDIRFUNC 0x4000 /* gnu discipline functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_DISC 0x8000 /* discipline initialized */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* gl_status */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOTDIR 0x0001 /* last gl_dirnext() not a dir */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* gl_type return */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOTFOUND 0 /* does not exist */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_DEV 1 /* exists but not DIR EXE REG */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_DIR 2 /* directory */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_EXE 3 /* executable regular file */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_REG 4 /* regular file */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* error return values */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_ABORTED 1
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOMATCH 2
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOSPACE 3
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_INTR 4
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_APPERR 5
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define GLOB_NOSYS 6
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#if _BLD_ast && defined(__EXPORT__)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#undef __MANGLE__
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define __MANGLE__ __LINKAGE__ __EXPORT__
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern __MANGLE__ int glob __PROTO__((const char*, int, int(*)(const char*,int), glob_t*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern __MANGLE__ void globfree __PROTO__((glob_t*));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#undef __MANGLE__
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define __MANGLE__ __LINKAGE__
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _GLOB_H */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte