| Previous | 15994 Revisions | Next |
| r2140 Saturday 29th March, 2008 at 14:26:14 UTC by Firewave |
|---|
| Renamed expand_wildcards() back to win_expand_wildcards() and moved from utils to winutils |
| [src/mess] | utils.c utils.h |
| [src/mess/osd/windows] | winutils.c winutils.h |
| [src/mess/tools/imgtool] | main.c |
| [src/mess/tools/messtest] | main.c |
| r2139 | r2140 | |
|---|---|---|
| 1 | 1 | #include <stdio.h> |
| 2 | 2 | #include <ctype.h> |
| 3 | 3 | #include <stdlib.h> |
| 4 | #include "glob.h" | |
| 5 | 4 | #include "utils.h" |
| 6 | 5 | |
| 7 | 6 | char *strncpyz(char *dest, const char *source, size_t len) |
| r2139 | r2140 | |
| 364 | 363 | |
| 365 | 364 | return error; |
| 366 | 365 | } |
| 367 | ||
| 368 | void expand_wildcards(int *argc, char **argv[]) | |
| 369 | { | |
| 370 | int i; | |
| 371 | glob_t g; | |
| 372 | ||
| 373 | memset(&g, 0, sizeof(g)); | |
| 374 | ||
| 375 | for (i = 0; i < *argc; i++) | |
| 376 | glob((*argv)[i], (g.gl_pathc > 0) ? GLOB_APPEND|GLOB_NOCHECK : GLOB_NOCHECK, NULL, &g); | |
| 377 | ||
| 378 | *argc = g.gl_pathc; | |
| 379 | *argv = g.gl_pathv; | |
| 380 | } |
| r2139 | r2140 | |
|---|---|---|
| 201 | 201 | /* validity checks */ |
| 202 | 202 | int utils_validitychecks(void); |
| 203 | 203 | |
| 204 | /* expand wildcards so '*' can be used */ | |
| 205 | void expand_wildcards(int *argc, char **argv[]); | |
| 206 | ||
| 207 | 204 | #endif /* UTILS_H */ |
| r2139 | r2140 | |
|---|---|---|
| 12 | 12 | #include "hashfile.h" |
| 13 | 13 | #include "emuopts.h" |
| 14 | 14 | #include "../imgtool/imgtool.h" |
| 15 | #ifdef WIN32 | |
| 16 | #include "winutils.h" | |
| 17 | #endif | |
| 15 | 18 | |
| 16 | 19 | extern int mame_validitychecks(int game); |
| 17 | 20 | |
| r2139 | r2140 | |
| 82 | 85 | |
| 83 | 86 | #ifdef WIN32 |
| 84 | 87 | /* expand wildcards so '*' can be used */ |
| 85 | expand_wildcards(&argc, &argv); | |
| 88 | win_expand_wildcards(&argc, &argv); | |
| 86 | 89 | #endif |
| 87 | 90 | |
| 88 | 91 | test_count = 0; |
| r2139 | r2140 | |
|---|---|---|
| 13 | 13 | #include <time.h> |
| 14 | 14 | #include <assert.h> |
| 15 | 15 | #include "imgtool.h" |
| 16 | #include "utils.h" | |
| 17 | 16 | #include "mess.h" |
| 18 | 17 | #include "main.h" |
| 19 | 18 | #include "fileio.h" |
| 20 | 19 | #include "modules.h" |
| 20 | #ifdef WIN32 | |
| 21 | #include "winutils.h" | |
| 22 | #endif | |
| 21 | 23 | |
| 22 | 24 | /* ---------------------------------------------------------------------- */ |
| 23 | 25 | |
| r2139 | r2140 | |
| 906 | 908 | #endif /* MAME_DEBUG */ |
| 907 | 909 | |
| 908 | 910 | #ifdef WIN32 |
| 909 | expand_wildcards(&argc, &argv); | |
| 911 | win_expand_wildcards(&argc, &argv); | |
| 910 | 912 | #endif /* WIN32 */ |
| 911 | 913 | |
| 912 | 914 | putchar('\n'); |
| r2139 | r2140 | |
|---|---|---|
| 19 | 19 | // MESS headers |
| 20 | 20 | #include "winutils.h" |
| 21 | 21 | #include "strconv.h" |
| 22 | #include "glob.h" | |
| 22 | 23 | |
| 23 | 24 | |
| 24 | 25 | //============================================================ |
| r2139 | r2140 | |
| 232 | 233 | } |
| 233 | 234 | return result; |
| 234 | 235 | } |
| 236 | ||
| 237 | void win_expand_wildcards(int *argc, char **argv[]) | |
| 238 | { | |
| 239 | int i; | |
| 240 | glob_t g; | |
| 241 | ||
| 242 | memset(&g, 0, sizeof(g)); | |
| 243 | ||
| 244 | for (i = 0; i < *argc; i++) | |
| 245 | glob((*argv)[i], (g.gl_pathc > 0) ? GLOB_APPEND|GLOB_NOCHECK : GLOB_NOCHECK, NULL, &g); | |
| 246 | ||
| 247 | *argc = g.gl_pathc; | |
| 248 | *argv = g.gl_pathv; | |
| 249 | } |
| r2139 | r2140 | |
|---|---|---|
| 49 | 49 | void win_scroll_window(HWND window, WPARAM wparam, int scroll_bar, int scroll_delta_line); |
| 50 | 50 | DWORD win_get_file_attributes_utf8(const char *filename); |
| 51 | 51 | |
| 52 | /* expand wildcards so '*' can be used */ | |
| 53 | void win_expand_wildcards(int *argc, char **argv[]); | |
| 54 | ||
| 52 | 55 | #endif // WINUTILS_H |
| Previous | 15994 Revisions | Next |