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 123... | Line 123... | ||
123 | #include |
123 | #include |
124 | 124 | ||
Line 125... | Line 125... | ||
125 | #include "acpisrc.h" |
125 | #include "acpisrc.h" |
Line -... | Line 126... | ||
- | 126 | ||
- | 127 | /* |
|
- | 128 | * Allocated structure returned from OsOpenDirectory |
|
126 | 129 | */ |
|
127 | typedef struct ExternalFindInfo |
130 | typedef struct ExternalFindInfo |
128 | { |
131 | { |
129 | char *DirPathname; |
132 | char *DirPathname; |
130 | DIR *DirPtr; |
133 | DIR *DirPtr; |
Line 215... | Line 218... | ||
215 | { |
218 | { |
216 | if (!fnmatch (ExternalInfo->WildcardSpec, dir_entry->d_name, 0)) |
219 | if (!fnmatch (ExternalInfo->WildcardSpec, dir_entry->d_name, 0)) |
217 | { |
220 | { |
218 | if (dir_entry->d_name[0] == '.') |
221 | if (dir_entry->d_name[0] == '.') |
219 | continue; |
222 | { |
- | 223 | continue; |
|
220 | 224 | } |
|
- | 225 | ||
Line 221... | Line 226... | ||
221 | str_len = strlen (dir_entry->d_name) + |
226 | str_len = strlen (dir_entry->d_name) + |
222 | strlen (ExternalInfo->DirPathname) + 2; |
227 | strlen (ExternalInfo->DirPathname) + 2; |
Line 223... | Line 228... | ||
223 | 228 | ||
224 | temp_str = calloc (str_len, 1); |
229 | temp_str = calloc (str_len, 1); |
225 | if (!temp_str) |
230 | if (!temp_str) |
226 | { |
231 | { |
227 | printf ("Could not allocate buffer for temporary string\n"); |
232 | printf ("Could not allocate buffer for temporary string\n"); |
228 | return NULL; |
233 | return (NULL); |
Line 229... | Line 234... | ||
229 | } |
234 | } |
230 | 235 | ||
231 | strcpy (temp_str, ExternalInfo->DirPathname); |
236 | strcpy (temp_str, ExternalInfo->DirPathname); |
Line 236... | Line 241... | ||
236 | free (temp_str); |
241 | free (temp_str); |
237 | if (err == -1) |
242 | if (err == -1) |
238 | { |
243 | { |
239 | printf ("stat() error - should not happen\n"); |
244 | printf ("stat() error - should not happen\n"); |
240 | return NULL; |
245 | return (NULL); |
241 | } |
246 | } |
242 | 247 | ||
Line 243... | Line 248... | ||
243 | if ((S_ISDIR (temp_stat.st_mode) |
248 | if ((S_ISDIR (temp_stat.st_mode) |
244 | && (ExternalInfo->RequestedFileType == REQUEST_DIR_ONLY)) |
249 | && (ExternalInfo->RequestedFileType == REQUEST_DIR_ONLY)) |
245 | || |
250 | || |
Line 253... | Line 258... | ||
253 | } |
258 | } |
254 | } |
259 | } |
255 | } |
260 | } |
256 | 261 | ||
Line 257... | Line 262... | ||
257 | return NULL; |
262 | return (NULL); |
258 | } |
263 | } |
Line 259... | Line 264... | ||
259 | 264 | ||
260 | 265 | ||
Line 282... | Line 287... | ||
282 | closedir (ExternalInfo->DirPtr); |
287 | closedir (ExternalInfo->DirPtr); |
283 | free (DirHandle); |
288 | free (DirHandle); |
284 | } |
289 | } |
Line -... | Line 290... | ||
- | 290 | ||
285 | 291 | ||
Line -... | Line 292... | ||
- | 292 | /* Other functions acpisrc uses but that aren't standard on Unix */ |
|
- | 293 | ||
- | 294 | /******************************************************************************* |
|
- | 295 | * |
|
- | 296 | * FUNCTION: strlwr |
|
- | 297 | * |
|
- | 298 | * PARAMETERS: str - String to be lowercased. |
|
- | 299 | * |
|
286 | /* Other functions acpisrc uses but that aren't standard on Unix */ |
300 | * RETURN: str. |
- | 301 | * |
|
- | 302 | * DESCRIPTION: Lowercase a string in-place. |
|
- | 303 | * |
|
287 | 304 | ******************************************************************************/ |
|
288 | /* lowercase a string */ |
305 | |
289 | char* |
306 | char * |
290 | strlwr ( |
307 | strlwr ( |
291 | char *str) |
308 | char *str) |