/************************************************************************* * * * Copyright 2004 Hewlett-Packard Development Company, L.P. * * * * Confidential computer software. Valid license from HP and/or * * its subsidiaries required for possession, use, or copying. * * * * Consistent with FAR 12.211 and 12.212, Commercial Computer Software, * * Computer Software Documentation, and Technical Data for Commercial * * Items are licensed to the U.S. Government under vendor's standard * * commercial license. * * * * Neither HP nor any of its subsidiaries shall be liable for technical * * or editorial errors or omissions contained herein. The information * * in this document is provided "as is" without warranty of any kind and * * is subject to change without notice. The warranties for HP products * * are set forth in the express limited warranty statements accompanying * * such products. Nothing herein should be construed as constituting an * * additional warranty. * * * *************************************************************************/ /* * HISTORY * * @(#)$RCSfile: glob.h,v $ $Revision: 1.1.6.2 $ (DEC) $Date: 1993/06/08 01:01:39 $ * * (c) Copyright 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC. * ALL RIGHTS RESERVED * * OSF/1 1.2 */ #ifndef __H_GLOB #define __H_GLOB /* * POSIX implies that you don't have to include with glob.h. * (compare with regex.h, where explicit decl is required....) */ /* * COMPONENT_NAME: (LIBCPAT) Standard C Library Pattern Matching * * FUNCTIONS: * * * (C) COPYRIGHT International Business Machines Corp. 1991 * All Rights Reserved * Licensed Materials - Property of IBM * * US Government Users Restricted Rights - Use, duplication or * disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * com/inc/glob.h, bos320 2/26/91 17:33:08 */ #include /* glob() flags */ #define GLOB_APPEND 0x01 /* append to end of gl_pathv */ #define GLOB_DOOFFS 0x02 /* first allocate gl_offs NULL ptrs */ #define GLOB_ERR 0x04 /* return on error */ #define GLOB_MARK 0x08 /* add / to end of directory name */ #define GLOB_NOCHECK 0x10 /* return pattern if no matches */ #define GLOB_NOSORT 0x20 /* do not sort matched filenames */ #ifdef _OSF_SOURCE /* Deprecate - GLOB_QUOTE is now default*/ #define GLOB_QUOTE 0x40 /* protects next character */ #endif #define GLOB_NOESCAPE 0x80 /* disable backlash escaping */ /* Pathname Matching error codes - large so not confused with errno.h */ #define GLOB_ABORTED 0x1000 /* error detected */ #define GLOB_NOSPACE 0x2000 /* memory allocation failure */ #define GLOB_NOMATCH 0x4000 /* do not match pathname */ #ifdef _XOPEN_SOURCE #define GLOB_NOSYS -1 /* function not implemented */ #endif /* _XOPEN_SOURCE */ #pragma __member_alignment __save #pragma __member_alignment /* Use this macro in all glob_t structure definitions */ #define __GLOB_T_MEMBERS \ __size_t gl_pathc; /* matched pathname count (not gl_offs) */ \ char **gl_pathv; /* ptr to list of matched pathnames */ \ __size_t gl_offs; /* # of gl_pathv reserved slots */ \ /* The following structure members are internal to the C Run-Time */\ void *gl_padr; /* ptr to pathname address structure */ \ void *gl_ptx; /* ptr to first pathname text buffer */ #if __INITIAL_POINTER_SIZE # pragma __pointer_size __save # pragma __pointer_size 32 typedef struct __glob_t32 { __GLOB_T_MEMBERS } __glob_t32; # pragma __pointer_size 64 typedef struct __glob_t64 { __GLOB_T_MEMBERS } __glob_t64; # pragma __pointer_size __restore #endif /* /POINTER used */ #if __INITIAL_POINTER_SIZE == 32 typedef __glob_t32 glob_t; #elif __INITIAL_POINTER_SIZE == 64 typedef __glob_t64 glob_t; #else typedef struct glob_t { __GLOB_T_MEMBERS } glob_t; #endif #pragma __member_alignment __restore #if __CRTL_VER >= 70320000 #if defined(__cplusplus) extern "C" { #endif /* ** Pathname Matching function prototypes */ #if __INITIAL_POINTER_SIZE #pragma __pointer_size __save #pragma __pointer_size 64 #endif /* ** Use 64 bit pointers, so they can be passed to these functions, including ** the user supplied errfunc function. Note that the C Run-Time should ** only pass a 32 bit pointers to the errfunc function. */ #if __INITIAL_POINTER_SIZE /* These pointer specific functions require /POINTER to be visible */ int _glob32 (const char *, int, int(*)(__const_char_ptr32,int), __glob_t32 *); void _globfree32 (__glob_t32 *); int _glob64 (const char *, int, int(*)(__const_char_ptr32,int), __glob_t64 *); void _globfree64 (__glob_t64 *); #endif /* /POINTER_SIZE check */ int glob (const char *, int, int(*)(__const_char_ptr32,int), glob_t *); void globfree (glob_t *); #if __INITIAL_POINTER_SIZE #pragma __pointer_size __restore #endif #if defined(__cplusplus) } #endif #endif /* __CRTL_VER */ #endif /* __H_GLOB */