gpgme-tool: Fix chain_id -> chain-id in KEYLIST XML.
[gpgme.git] / src / w32-ce.h
1 /* w32-ce.h
2    Copyright (C) 2010 g10 Code GmbH
3
4    This file is part of GPGME.
5
6    GPGME is free software; you can redistribute it and/or modify it
7    under the terms of the GNU Lesser General Public License as
8    published by the Free Software Foundation; either version 2.1 of
9    the License, or (at your option) any later version.
10
11    GPGME is distributed in the hope that it will be useful, but
12    WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
19    02111-1307, USA.  */
20
21 #ifndef GPGME_W32_CE_H
22 #define GPGME_W32_CE_H
23
24 #include <time.h>
25 #include <stdarg.h>
26
27 #ifdef _MSC_VER
28 typedef int pid_t;
29 #define strdup _strdup
30 #define strcasecmp _stricmp
31 #endif
32
33 #include <winsock2.h>
34 #include <ws2tcpip.h> /* For getaddrinfo.  */
35 #include <windows.h>
36
37 #define getenv _gpgme_wince_getenv
38 char *getenv (const char *name);
39
40 #include <io.h>
41 #define isatty(fd) 0
42
43
44 /* Windows CE is missing some Windows functions that we want.  */
45
46 #define GetSystemTimeAsFileTime _gpgme_wince_GetSystemTimeAsFileTime
47 void GetSystemTimeAsFileTime (LPFILETIME ftp);
48
49 #define DeleteFileA _gpgme_wince_DeleteFileA
50 BOOL DeleteFileA(LPCSTR);
51
52 #define CreateFileA _gpgme_wince_CreateFileA
53 HANDLE CreateFileA (LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES,
54                     DWORD, DWORD, HANDLE);
55
56 #define CreateProcessA _gpgme_wince_CreateProcessA
57 BOOL CreateProcessA(LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,PVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
58
59 #define RegOpenKeyExA _gpgme_wince_RegOpenKeyExA
60 LONG RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
61
62 #define RegQueryValueExA _gpgme_wince_RegQueryValueExA
63 LONG WINAPI RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
64
65 #define GetTempPathA _gpgme_wince_GetTempPathA
66 DWORD GetTempPathA(DWORD,LPSTR);
67
68 #define SHGetSpecialFolderPathA _gpgme_wince_SHGetSpecialFolderPathA
69 BOOL SHGetSpecialFolderPathA(HWND,LPSTR,int,BOOL);
70
71 int _gpgme_wince_access (const char *fname, int mode);
72 #define access(a,b) _gpgme_wince_access ((a), (b))
73
74 void *_gpgme_wince_bsearch (const void *key, const void *base,
75                             size_t nmemb, size_t size,
76                             int (*compar) (const void *, const void *));
77 #define bsearch(a,b,c,d,e) _gpgme_wince_bsearch ((a),(b),(c),(d),(e))
78
79 #if defined(_MSC_VER)
80   /* Remove the redefined __leave keyword.  It is defined by MSC for
81      W32 in excpt.h and not in sehmap.h as for the plain windows
82      version.  */
83 # undef leave
84 # define HKEY_PERFORMANCE_DATA ((HKEY)0x80000004)
85 # define HKEY_CURRENT_CONFIG  ((HKEY)0x80000005)
86   /* Replace the Mingw32CE provided abort function.  */
87 # define abort() do { TerminateProcess (GetCurrentProcess(), 8); } while (0)
88 # define _IOLBF 0x40
89 #endif
90
91 #endif /* GPGME_W32_CE_H */