Rev 1498 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1498 | Rev 2216 | ||
---|---|---|---|
Line 7... | Line 7... | ||
7 | /****************************************************************************** |
7 | /****************************************************************************** |
8 | * |
8 | * |
9 | * 1. Copyright Notice |
9 | * 1. Copyright Notice |
10 | * |
10 | * |
11 | * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp. |
11 | * Some or all of this work - Copyright (c) 1999 - 2011, Intel Corp. |
12 | * All rights reserved. |
12 | * All rights reserved. |
13 | * |
13 | * |
14 | * 2. License |
14 | * 2. License |
15 | * |
15 | * |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
16 | * 2.1. This is your license from Intel Corp. under its intellectual property |
Line 112... | Line 112... | ||
112 | * such license, approval or letter. |
112 | * such license, approval or letter. |
113 | * |
113 | * |
114 | *****************************************************************************/ |
114 | *****************************************************************************/ |
115 | 115 | ||
Line -... | Line 116... | ||
- | 116 | #include |
|
Line 116... | Line 117... | ||
116 | 117 | ||
117 | #include |
118 | #include |
118 | #include |
119 | #include |
119 | #include |
120 | #include |
Line 120... | Line -... | ||
120 | #include |
- | |
121 | - | ||
122 | #include |
121 | #include |
123 | 122 | ||
124 | typedef struct ExternalFindInfo |
123 | typedef struct ExternalFindInfo |
125 | { |
124 | { |
126 | struct _finddata_t DosInfo; |
125 | struct _finddata_t DosInfo; |
Line 169... | Line 168... | ||
169 | 168 | ||
Line 170... | Line 169... | ||
170 | SearchInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1); |
169 | SearchInfo = calloc (sizeof (EXTERNAL_FIND_INFO), 1); |
171 | if (!SearchInfo) |
170 | if (!SearchInfo) |
172 | { |
171 | { |
173 | return NULL; |
172 | return (NULL); |
174 | } |
173 | } |
Line 175... | Line 174... | ||
175 | 174 | ||
Line 176... | Line 175... | ||
176 | /* Allocate space for the full wildcard path */ |
175 | /* Allocate space for the full wildcard path */ |
177 | 176 | ||
178 | FullWildcardSpec = calloc (strlen (DirPathname) + strlen (WildcardSpec) + 2, 1); |
177 | FullWildcardSpec = calloc (strlen (DirPathname) + strlen (WildcardSpec) + 2, 1); |
179 | if (!FullWildcardSpec) |
178 | if (!FullWildcardSpec) |
180 | { |
179 | { |
181 | printf ("Could not allocate buffer for wildcard pathname\n"); |
180 | printf ("Could not allocate buffer for wildcard pathname\n"); |
Line 182... | Line 181... | ||
182 | return NULL; |
181 | return (NULL); |
Line 183... | Line 182... | ||
183 | } |
182 | } |
Line 196... | Line 195... | ||
196 | /* Failure means that no match was found */ |
195 | /* Failure means that no match was found */ |
197 | 196 | ||
Line 198... | Line 197... | ||
198 | free (FullWildcardSpec); |
197 | free (FullWildcardSpec); |
199 | free (SearchInfo); |
198 | free (SearchInfo); |
200 | return NULL; |
199 | return (NULL); |
201 | } |
200 | } |
Line 202... | Line 201... | ||
202 | 201 | ||
Line 203... | Line 202... | ||
203 | /* Save the info in the return structure */ |
202 | /* Save the info in the return structure */ |
Line 252... | Line 251... | ||
252 | 251 | ||
Line 253... | Line 252... | ||
253 | Status = _findnext (SearchInfo->FindHandle, &SearchInfo->DosInfo); |
252 | Status = _findnext (SearchInfo->FindHandle, &SearchInfo->DosInfo); |
254 | if (Status != 0) |
253 | if (Status != 0) |
255 | { |
254 | { |
256 | return NULL; |
255 | return (NULL); |
257 | } |
256 | } |
258 | } |
257 | } |
Line 259... | Line 258... | ||
259 | 258 | ||
260 | /* |
259 | /* |
Line 286... | Line 285... | ||
286 | } |
285 | } |
287 | break; |
286 | break; |
288 | 287 | ||
Line 289... | Line 288... | ||
289 | default: |
288 | default: |
290 | return NULL; |
289 | return (NULL); |
291 | } |
290 | } |
292 | } |
291 | } |
Line 293... | Line 292... | ||
293 | 292 | ||
294 | return (SearchInfo->DosInfo.name); |
293 | return (SearchInfo->DosInfo.name); |
Line 300... | Line 299... | ||
300 | * FUNCTION: AcpiOsCloseDirectory |
299 | * FUNCTION: AcpiOsCloseDirectory |
301 | * |
300 | * |
302 | * PARAMETERS: DirHandle - Created via AcpiOsOpenDirectory |
301 | * PARAMETERS: DirHandle - Created via AcpiOsOpenDirectory |
303 | * |
302 | * |
304 | * RETURN: None. |
303 | * RETURN: None |
305 | * |
304 | * |
306 | * DESCRIPTION: Close the open directory and cleanup. |
305 | * DESCRIPTION: Close the open directory and cleanup. |
307 | * |
306 | * |
308 | ******************************************************************************/ |
307 | ******************************************************************************/ |
309 | 308 |