dvitomp fix from Akira
[mplib] / src / texk / kpathsea / win32lib.h
1 #ifndef _GNU_W32_H_
2 #define _GNU_W32_H_
3
4 #pragma warning( disable : 4007 4096 4018 4244 )
5
6 #include <stdlib.h>
7 /* The embedded rndnpc.h defines boolean as 'unsigned char',
8    and we do not want that. 
9    This should be safe as long as we don't use npc ourselves. */
10 #define boolean saved_boolean
11 #include <windows.h>
12 #include <winerror.h>
13 #include <winnt.h>
14 #undef boolean
15 #include <dirent.h>
16 #include <direct.h>
17
18 #if defined(WIN32)
19 # if defined(KPSEDLL)
20 #  define GNUW32DLL KPSEDLL
21 # else
22 #  if defined(GNUW32_DLL) || defined(KPSE_DLL)
23 #   if defined(MAKE_GNUW32_DLL) || defined(MAKE_KPSE_DLL)
24 #    define GNUW32DLL __declspec( dllexport)
25 #   else
26 #    define GNUW32DLL __declspec( dllimport)
27 #   endif
28 #  else
29 #   define GNUW32DLL
30 #  endif
31 # endif
32 #else /* ! WIN32 */
33 # define GNUW32DLL
34 #endif
35
36 #ifndef MAXPATHLEN
37 #define MAXPATHLEN _MAX_PATH
38 #endif
39
40 #ifndef MAX_PIPES
41 #define MAX_PIPES 128
42 #endif
43
44 /* On DOS, it's good to allow both \ and / between directories.  */
45 #ifndef IS_DIR_SEP
46 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
47 #endif
48 #ifndef IS_DEVICE_SEP
49 #define IS_DEVICE_SEP(ch) ((ch) == ':')
50 #endif
51 #ifndef NAME_BEGINS_WITH_DEVICE
52 #define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
53 #endif
54 /* On win32, UNC names are authorized */
55 #ifndef IS_UNC_NAME
56 #define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name)  \
57                             && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
58 #endif
59 #ifndef IS_UNC_NAME
60 #define IS_UNC_NAME(name) \
61   (strlen(name)>=3 && IS_DIR_SEP(*name)  \
62      && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
63 #endif
64
65 typedef struct volume_info_data {
66   struct volume_info_data * next;
67
68   /* time when info was obtained */
69   DWORD     timestamp;
70
71   /* actual volume info */
72   char *    root_dir;
73   DWORD     serialnum;
74   DWORD     maxcomp;
75   DWORD     flags;
76   char *    name;
77   char *    type;
78 } volume_info_data;
79
80 #endif