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