tentative fix for issue 3 (ex 53)
[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 #include <windows.h>
8 #include <winerror.h>
9 #include <winnt.h>
10 #include <dirent.h>
11 #include <direct.h>
12
13 #if defined(WIN32)
14 # if defined(KPSEDLL)
15 #  define GNUW32DLL KPSEDLL
16 # else
17 #  if defined(GNUW32_DLL) || defined(KPSE_DLL)
18 #   if defined(MAKE_GNUW32_DLL) || defined(MAKE_KPSE_DLL)
19 #    define GNUW32DLL __declspec( dllexport)
20 #   else
21 #    define GNUW32DLL __declspec( dllimport)
22 #   endif
23 #  else
24 #   define GNUW32DLL
25 #  endif
26 # endif
27 #else /* ! WIN32 */
28 # define GNUW32DLL
29 #endif
30
31 #ifndef MAXPATHLEN
32 #define MAXPATHLEN _MAX_PATH
33 #endif
34
35 #ifndef MAX_PIPES
36 #define MAX_PIPES 128
37 #endif
38
39 /* On DOS, it's good to allow both \ and / between directories.  */
40 #ifndef IS_DIR_SEP
41 #define IS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
42 #endif
43 #ifndef IS_DEVICE_SEP
44 #define IS_DEVICE_SEP(ch) ((ch) == ':')
45 #endif
46 #ifndef NAME_BEGINS_WITH_DEVICE
47 #define NAME_BEGINS_WITH_DEVICE(name) (*(name) && IS_DEVICE_SEP((name)[1]))
48 #endif
49 /* On win32, UNC names are authorized */
50 #ifndef IS_UNC_NAME
51 #define IS_UNC_NAME(name) (strlen(name)>=3 && IS_DIR_SEP(*name)  \
52                             && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
53 #endif
54 #ifndef IS_UNC_NAME
55 #define IS_UNC_NAME(name) \
56   (strlen(name)>=3 && IS_DIR_SEP(*name)  \
57      && IS_DIR_SEP(*(name+1)) && isalnum(*(name+2)))
58 #endif
59
60 typedef struct volume_info_data {
61   struct volume_info_data * next;
62
63   /* time when info was obtained */
64   DWORD     timestamp;
65
66   /* actual volume info */
67   char *    root_dir;
68   DWORD     serialnum;
69   DWORD     maxcomp;
70   DWORD     flags;
71   char *    name;
72   char *    type;
73 } volume_info_data;
74
75 #endif