1 /*
2 ** Copyright (c) 2007 D. Richard Hipp
3 **
4 ** This program is free software; you can redistribute it and/or
5 ** modify it under the terms of the Simplified BSD License (also
6 ** known as the "2-Clause License" or "FreeBSD License".)
7 
8 ** This program is distributed in the hope that it will be useful,
9 ** but without any warranty; without even the implied warranty of
10 ** merchantability or fitness for a particular purpose.
11 **
12 ** Author contact information:
13 **   drh@hwaci.com
14 **   http://www.hwaci.com/drh/
15 **
16 *******************************************************************************
17 **
18 ** This file contains preprocessor directives used to help integrate with the
19 ** Cygwin runtime and build environment.  The intent of this file is to keep
20 ** the Cygwin-specific preprocessor directives together.
21 */
22 
23 #if defined(__CYGWIN__) && !defined(CYGSUP_H)
24 #define CYGSUP_H
25 
26 /*
27 *******************************************************************************
28 ** Include any Cygwin-specific headers here.                                 **
29 *******************************************************************************
30 */
31 
32 #include <wchar.h>
33 #include <sys/cygwin.h>
34 
35 /*
36 *******************************************************************************
37 ** Define any Cygwin-specific preprocessor macros here.  All macros defined in
38 ** this section should be wrapped with #ifndef, in order to allow them to be
39 ** externally overridden.
40 *******************************************************************************
41 */
42 
43 #ifndef CP_UTF8
44 #  define CP_UTF8            65001
45 #endif
46 
47 #ifndef WINBASEAPI
48 #  define WINBASEAPI         __declspec(dllimport)
49 #endif
50 
51 #ifndef WINADVAPI
52 #  define WINADVAPI          __declspec(dllimport)
53 #endif
54 
55 #ifndef SHSTDAPI
56 #  define SHSTDAPI           __declspec(dllimport)
57 #endif
58 
59 #ifndef STDAPI
60 #  define STDAPI             __stdcall
61 #endif
62 
63 #ifndef WINAPI
64 #  define WINAPI             __stdcall
65 #endif
66 
67 /*
68 *******************************************************************************
69 ** Declare any Cygwin-specific Win32 or other APIs here.  Functions declared in
70 ** this section should use the built-in ANSI C types in order to make sure this
71 ** header file continues to work as a self-contained unit.
72 **
73 ** On Cygwin64, "long" is 64-bit but in Win64 it's 32-bit.  That's why in the
74 ** signatures below "long" should not be used.  They now use "int" instead.
75 *******************************************************************************
76 */
77 
78 WINADVAPI extern WINAPI int RegOpenKeyExW(
79     void *,          /* HKEY */
80     const wchar_t *, /* LPCWSTR */
81     unsigned int,    /* DWORD */
82     unsigned int,    /* REGSAM */
83     void *           /* PHKEY */
84     );
85 
86 WINADVAPI extern WINAPI int RegQueryValueExW(
87     void *,          /* HKEY */
88     const wchar_t *, /* LPCWSTR */
89     unsigned int *,  /* LPDWORD */
90     unsigned int *,  /* LPDWORD */
91     unsigned char *, /* LPBYTE */
92     unsigned int *   /* LPDWORD */
93     );
94 
95 SHSTDAPI extern STDAPI void *ShellExecuteW(
96     void *,          /* HWND */
97     const wchar_t *, /* LPCWSTR */
98     const wchar_t *, /* LPCWSTR */
99     const wchar_t *, /* LPCWSTR */
100     const wchar_t *, /* LPCWSTR */
101     int              /* INT */
102     );
103 
104 WINBASEAPI extern WINAPI int WideCharToMultiByte(
105     unsigned int,    /* UINT */
106     unsigned int,    /* DWORD */
107     const wchar_t *, /* LPCWSTR */
108     int,             /* int */
109     char *,          /* LPSTR */
110     int,             /* int */
111     const char *,    /* LPCSTR */
112     int *            /* LPBOOL */
113     );
114 
115 WINBASEAPI extern WINAPI int MultiByteToWideChar(
116     unsigned int,    /* UINT */
117     unsigned int,    /* DWORD */
118     const char *,    /* LPCSTR */
119     int,             /* int */
120     wchar_t *,       /* LPWSTR */
121     int              /* int */
122     );
123 
124 #endif /* defined(__CYGWIN__) && !defined(CYGSUP_H) */
125