1 /*++ 2 3 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> 4 This program and the accompanying materials 5 are licensed and made available under the terms and conditions of the BSD License 6 which accompanies this distribution. The full text of the license may be found at 7 http://opensource.org/licenses/bsd-license.php 8 9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 12 Module Name: 13 14 FileSearch.h 15 16 Abstract: 17 18 Header file to support file searching. 19 20 --*/ 21 22 #ifndef _FILE_SEARCH_H_ 23 #define _FILE_SEARCH_H_ 24 25 // 26 // Since the file searching routines are OS dependent, put the 27 // necessary include paths in this header file so that the non-OS-dependent 28 // files don't need to include these windows-specific header files. 29 // 30 #include <stdio.h> 31 #include <string.h> 32 #include <ctype.h> 33 #include <direct.h> 34 #include <windows.h> 35 36 // 37 // Return codes of some of the file search routines 38 // 39 #define STATUS_NOT_FOUND 0x1000 40 41 // 42 // Flags for what to search for. Also used in the FileFlags return field. 43 // 44 #define FILE_SEARCH_DIR 0x0001 45 #define FILE_SEARCH_FILE 0x0002 46 47 // 48 // Here's our class definition 49 // 50 typedef struct { 51 HANDLE Handle; 52 WIN32_FIND_DATA FindData; 53 UINT32 FileSearchFlags; // DIRS, FILES, etc 54 UINT32 FileFlags; 55 INT8 FileName[MAX_PATH]; // for portability 56 STRING_LIST *ExcludeDirs; 57 STRING_LIST *ExcludeFiles; 58 STRING_LIST *ExcludeExtensions; 59 } FILE_SEARCH_DATA; 60 61 // 62 // Here's our member functions 63 // 64 STATUS 65 FileSearchInit ( 66 FILE_SEARCH_DATA *FSData 67 ); 68 69 STATUS 70 FileSearchDestroy ( 71 FILE_SEARCH_DATA *FSData 72 ); 73 74 STATUS 75 FileSearchStart ( 76 FILE_SEARCH_DATA *FSData, 77 char *FileMask, 78 UINT32 SearchFlags 79 ); 80 81 STATUS 82 FileSearchFindNext ( 83 FILE_SEARCH_DATA *FSData 84 ); 85 86 STATUS 87 FileSearchExcludeDirs ( 88 FILE_SEARCH_DATA *FSData, 89 STRING_LIST *StrList 90 ); 91 STATUS 92 FileSearchExcludeExtensions ( 93 FILE_SEARCH_DATA *FSData, 94 STRING_LIST *StrList 95 ); 96 STATUS 97 FileSearchExcludeFiles ( 98 FILE_SEARCH_DATA *FSData, 99 STRING_LIST *StrList 100 ); 101 #endif 102