summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Sample/Tools/Source/GuidChk/FileSearch.h
blob: bc40265366dea99b815af00dcc7aa112441293fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/*++

Copyright (c) 2004, Intel Corporation                                                         
All rights reserved. This program and the accompanying materials                          
are licensed and made available under the terms and conditions of the BSD License         
which accompanies this distribution.  The full text of the license may be found at        
http://opensource.org/licenses/bsd-license.php                                            
                                                                                          
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             

Module Name:  

  FileSearch.h
  
Abstract:

  Header file to support file searching.
  
--*/

#ifndef _FILE_SEARCH_H_
#define _FILE_SEARCH_H_

//
// Since the file searching routines are OS dependent, put the
// necessary include paths in this header file so that the non-OS-dependent
// files don't need to include these windows-specific header files.
//
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <direct.h>
#include <windows.h>

//
// Return codes of some of the file search routines
//
#define STATUS_NOT_FOUND  0x1000

//
// Flags for what to search for. Also used in the FileFlags return field.
//
#define FILE_SEARCH_DIR   0x0001
#define FILE_SEARCH_FILE  0x0002

//
// Here's our class definition
//
typedef struct {
  HANDLE          Handle;
  WIN32_FIND_DATA FindData;
  UINT32          FileSearchFlags;    // DIRS, FILES, etc
  UINT32          FileFlags;
  INT8            FileName[MAX_PATH]; // for portability
  STRING_LIST     *ExcludeDirs;
  STRING_LIST     *ExcludeFiles;
  STRING_LIST     *ExcludeExtensions;
} FILE_SEARCH_DATA;

//
// Here's our member functions
//
STATUS
FileSearchInit (
  FILE_SEARCH_DATA    *FSData
  )
;

STATUS
FileSearchDestroy (
  FILE_SEARCH_DATA    *FSData
  )
;

STATUS
FileSearchStart (
  FILE_SEARCH_DATA    *FSData,
  char                *FileMask,
  UINT32              SearchFlags
  )
;

STATUS
FileSearchFindNext (
  FILE_SEARCH_DATA    *FSData
  )
;

STATUS
FileSearchExcludeDirs (
  FILE_SEARCH_DATA    *FSData,
  STRING_LIST         *StrList
  )
;
STATUS
FileSearchExcludeExtensions (
  FILE_SEARCH_DATA    *FSData,
  STRING_LIST         *StrList
  )
;
STATUS
FileSearchExcludeFiles (
  FILE_SEARCH_DATA    *FSData,
  STRING_LIST         *StrList
  )
;
#endif