Previous 15994 Revisions Next

r2603 Sunday 11th May, 2008 at 04:35:10 UTC by R. Belmont
[SDLMESS] Additional 0.125 sync and Win32 fixes
[src/mess/osd/sdl]sdl.mak winutils.c* winutils.h*
[src/osd/sdl]sdlfile.c

src/osd/sdl/sdlfile.c
r2602r2603
459459//  osd_stat
460460//============================================================
461461
462#ifndef SDLMAME_WIN32
462463osd_directory_entry *osd_stat(const char *path)
463464{
464465   osd_directory_entry *result = NULL;
r2602r2603
485486   return result;
486487}
487488#endif
489#endif
src/mess/osd/sdl/winutils.c
r0r2603
1//============================================================
2//
3//   winutils.c - Generic Win32 utility code
4//
5//============================================================
6
7// Needed for better file dialog
8#ifdef _WIN32_WINNT
9#undef _WIN32_WINNT
10#endif // _WIN32_WINNT
11#define _WIN32_WINNT 0x500
12
13// standard windows headers
14#define WIN32_LEAN_AND_MEAN
15#include <windows.h>
16#include <tchar.h>
17
18// MESS headers
19#include "winutils.h"
20#include "strconv.h"
21#include "glob.h"
22
23//============================================================
24//   win_get_file_attributes_utf8
25//============================================================
26
27DWORD win_get_file_attributes_utf8(const char *filename)
28{
29   DWORD result = ~0;
30   LPTSTR t_filename;
31
32   t_filename = tstring_from_utf8(filename);
33   if (t_filename != NULL)
34   {
35      result = GetFileAttributes(t_filename);
36      free(t_filename);
37   }
38   return result;
39}
40
41void win_expand_wildcards(int *argc, char **argv[])
42{
43   int i;
44   glob_t g;
45
46   memset(&g, 0, sizeof(g));
47
48   for (i = 0; i < *argc; i++)
49      glob((*argv)[i], (g.gl_pathc > 0) ? GLOB_APPEND|GLOB_NOCHECK : GLOB_NOCHECK, NULL, &g);
50
51   *argc = g.gl_pathc;
52   *argv = g.gl_pathv;
53}
src/mess/osd/sdl/winutils.h
r0r2603
1//============================================================
2//
3//   winutils.h - Generic Win32 utility code in MESS
4//
5//============================================================
6
7#ifndef WINUTILS_H
8#define WINUTILS_H
9
10#include <windows.h>
11#include "osdcore.h"
12
13//============================================================
14//  MISC
15//============================================================
16
17DWORD win_get_file_attributes_utf8(const char *filename);
18
19/* expand wildcards so '*' can be used */
20void win_expand_wildcards(int *argc, char **argv[]);
21
22#endif // WINUTILS_H
src/mess/osd/sdl/sdl.mak
r2602r2603
2323ifeq ($(TARGETOS),win32)
2424OSDCOREOBJS += \
2525   $(MESS_SDLOBJ)/glob.o   \
26   $(MESS_SDLOBJ)/winutils.o \
2627   $(MESS_SDLOBJ)/w32util.o
2728endif
2829

Previous 15994 Revisions Next


© 1998-2018 The MESS Team