Doxygen Source Code Documentation
mcw_glob.h
Go to the documentation of this file.00001 /* 00002 * Copyright (c) 1989 The Regents of the University of California. 00003 * All rights reserved. 00004 * 00005 * This code is derived from software contributed to Berkeley by 00006 * Guido van Rossum. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 1. Redistributions of source code must retain the above copyright 00012 * notice, this list of conditions and the following disclaimer. 00013 * 2. Redistributions in binary form must reproduce the above copyright 00014 * notice, this list of conditions and the following disclaimer in the 00015 * documentation and/or other materials provided with the distribution. 00016 * 3. All advertising materials mentioning features or use of this software 00017 * must display the following acknowledgement: 00018 * This product includes software developed by the University of 00019 * California, Berkeley and its contributors. 00020 * 4. Neither the name of the University nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00025 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00027 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00030 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00031 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00032 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00033 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00034 * SUCH DAMAGE. 00035 * 00036 * @(#)glob.h 5.6 (Berkeley) 4/3/91 00037 */ 00038 00039 #ifndef _MCW_GLOB_H_ 00040 #define _MCW_GLOB_H_ 00041 00042 /** prototypes for routines added by RWCox **/ 00043 00044 extern void MCW_file_expand( int nin , char ** fin , int * nout , char *** fout ) ; 00045 extern void MCW_free_expand( int gnum , char ** gout ) ; 00046 extern void MCW_warn_expand( int www ) ; /* 13 Jul 2001 */ 00047 extern void MCW_wildcards( char *fnam , int *nout , char ***fout ) ; /* 01 Dec 2003 */ 00048 #define MCW_free_wildcards(a,b) MCW_free_expand(a,b) /* 02 Dec 2003 */ 00049 00050 typedef struct { 00051 int gl_pathc; /* count of total paths so far */ 00052 int gl_matchc; /* count of paths matching pattern */ 00053 int gl_offs; /* reserved at beginning of gl_pathv */ 00054 int gl_flags; /* copy of flags parameter to glob() */ 00055 int (*gl_errfunc)(); /* copy of errfunc parameter to glob() */ 00056 char **gl_pathv; /* list of paths matching pattern */ 00057 } glob_t; 00058 00059 #define GLOB_APPEND 0x001 /* append to output from previous call */ 00060 #define GLOB_DOOFFS 0x002 /* use gl_offs */ 00061 #define GLOB_ERR 0x004 /* return on error */ 00062 #define GLOB_MAGCHAR 0x008 /* pattern had globbing characters */ 00063 #define GLOB_MARK 0x010 /* append / to matching directories */ 00064 #define GLOB_NOCHECK 0x020 /* return pattern itself if nothing matches */ 00065 #define GLOB_NOSORT 0x040 /* don't sort */ 00066 #define GLOB_QUOTE 0x080 /* quote special chars with \ */ 00067 #define GLOB_NOMAGIC 0x100 /* like GLOB_NOCHECK but only if the pattern 00068 * did not have any magic characters */ 00069 #define GLOB_ALTNOT 0x200 /* use alternate glob character [^ not !] */ 00070 00071 #define GLOB_NOSPACE (-1) /* malloc call failed */ 00072 #define GLOB_ABEND (-2) /* unignored error */ 00073 00074 int glob (const char *, int, int (*)(char *, int), glob_t *); 00075 void globfree (glob_t *); 00076 00077 #include <string.h> 00078 00079 #include "mcw_malloc.h" 00080 00081 #endif /* !_MCW_GLOB_H_ */