1 |
/* wptErrors.h - Errors headerfile |
2 |
* Copyright (C) 2000-2006, 2009 Timo Schulz |
3 |
* |
4 |
* This file is part of WinPT. |
5 |
* |
6 |
* WinPT is free software; you can redistribute it and/or |
7 |
* modify it under the terms of the GNU General Public License |
8 |
* as published by the Free Software Foundation; either version 2 |
9 |
* of the License, or (at your option) any later version. |
10 |
* |
11 |
* WinPT is distributed in the hope that it will be useful, |
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 |
* General Public License for more details. |
15 |
*/ |
16 |
|
17 |
#ifndef WPT_ERRORS_H |
18 |
#define WPT_ERRORS_H |
19 |
|
20 |
#define w32_errno ((int)GetLastError ()) |
21 |
|
22 |
#define DEBUG(MSG) debug (MSG, __FILE__, __LINE__) |
23 |
#define DEBUG_F(MSG) debug_f (MSG, __FILE__, __LINE__) |
24 |
|
25 |
/* Error constants. */ |
26 |
enum winpt_err_t { |
27 |
WPTERR_GENERAL = 1, |
28 |
WPTERR_FILE_OPEN = 2, |
29 |
WPTERR_FILE_CREAT = 3, |
30 |
WPTERR_FILE_READ = 4, |
31 |
WPTERR_FILE_WRITE = 5, |
32 |
WPTERR_FILE_CLOSE = 6, |
33 |
WPTERR_FILE_EXIST = 7, |
34 |
WPTERR_FILE_REMOVE = 8, |
35 |
WPTERR_CLIP_OPEN = 10, |
36 |
WPTERR_CLIP_CLOSE = 11, |
37 |
WPTERR_CLIP_EMPTY = 12, |
38 |
WPTERR_CLIP_SET = 13, |
39 |
WPTERR_CLIP_GET = 14, |
40 |
WPTERR_CLIP_ISEMPTY = 15, |
41 |
WPTERR_CLIP = 16, |
42 |
WPTERR_CLIP_SECURED = 17, |
43 |
WPTERR_WINSOCK_INIT = 18, |
44 |
WPTERR_WINSOCK_RESOLVE= 19, |
45 |
WPTERR_WINSOCK_SOCKET = 20, |
46 |
WPTERR_WINSOCK_CONNECT= 21, |
47 |
WPTERR_WINSOCK_SENDKEY= 22, |
48 |
WPTERR_WINSOCK_RECVKEY= 23, |
49 |
WPTERR_WINSOCK_TIMEOUT= 50, |
50 |
WPTERR_WINSOCK_PROXY = 51, /* general error for proxy problems. */ |
51 |
WPTERR_KEYSERVER_NOTFOUND= 24, |
52 |
WPTERR_REGISTRY = 26, |
53 |
WPTERR_HOTKEY = 28, |
54 |
WPTERR_DIR_OPEN = 33, |
55 |
WPTERR_DIR_CREAT = 34, |
56 |
WPTERR_CURR_WND = 35, |
57 |
WPTERR_CONFIG_FILE = 36, |
58 |
WPTERR_NODATA = 37, |
59 |
WPTERR_GPG_EXEFILE = 38, |
60 |
WPTERR_GPG_KEYRINGS = 39, |
61 |
WPTERR_GPG_OPT_KEYRINGS= 40, |
62 |
WPTERR_NOCARD = 100, |
63 |
WPTERR_NOREADER = 101, |
64 |
WPTERR_NOPGPCARD = 102, |
65 |
}; |
66 |
|
67 |
void debug_end (void); |
68 |
const char * winpt_strerror (int errid); |
69 |
void winpt_errmsg (const char * name, int is_file); |
70 |
void debug_box (const char * msg, const char * file, int line); |
71 |
void debug_f (const char * msg, const char * file, int line); |
72 |
void log_debug (const char * format, ...); |
73 |
int printf_box (const char * title, int style, const char * format, ...); |
74 |
#define log_box printf_box |
75 |
|
76 |
/*-- wptTrayPop.cpp --*/ |
77 |
int msg_box (HWND hwnd, const char * text, const char * title, int mode); |
78 |
int show_msg (HWND hWnd, int millis, LPCTSTR string); |
79 |
#define status_box(hwnd, text, title) msg_box (hwnd, text, title, MB_OK) |
80 |
|
81 |
void balloon_msg_disable (void); |
82 |
void show_balloon_msg (HWND hparwnd, LPCTSTR string, LPCTSTR icon_name); |
83 |
HWND show_balloon_msg_pos (HWND hparwnd, int millis, int x, int y, |
84 |
LPCTSTR string, LPCTSTR icon_name); |
85 |
|
86 |
#endif /* WPT_ERRORS_H */ |