1 /* Copyright (C) MariaDB Corporation Ab */
2 #ifndef __OSUTIL_H__
3 #define __OSUTIL_H__
4 
5 #if defined(UNIX) || defined(UNIV_LINUX)
6 #if defined(MARIADB)
7 #include "my_global.h"
8 #else
9 #include "mini-global.h"
10 #endif
11 #include <errno.h>
12 #include <stddef.h>
13 #include "os.h"
14 
15 #define MB_OK  0x00000000
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 int   GetLastError();
22 void  _splitpath(const char*, char*, char*, char*, char*);
23 void  _makepath(char*, const char*, const char*, const char*, const char*);
24 char *_fullpath(char *absPath, const char *relPath, size_t maxLength);
25 BOOL  MessageBeep(uint);
26 unsigned long _filelength(int fd);
27 
28 PSZ strupr(PSZ s);
29 PSZ strlwr(PSZ s);
30 
31 typedef size_t FILEPOS;
32 //pedef int    FILEHANDLE; // UNIX
33 
34 #ifdef __cplusplus
35 }
36 #endif
37 
38 #else /* WINDOWS */
39 #include <windows.h>
40 
41 typedef __int64 FILEPOS;
42 //pedef HANDLE  FILEHANDLE; // Win32
43 
44 #endif /* WINDOWS */
45 
46 #define XSTR(x) ((x)?(x):"<null>")
47 
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 my_bool CloseFileHandle(HANDLE h);
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 
58 #endif /* __OSUTIL_H__ */
59