1 |
werner |
37 |
/* wptErrors.h - Errors headerfile |
2 |
twoaday |
329 |
* Copyright (C) 2000-2006, 2009 Timo Schulz |
3 |
werner |
37 |
* |
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 |
twoaday |
339 |
WPTERR_SUCESS = 0, |
28 |
werner |
37 |
WPTERR_GENERAL = 1, |
29 |
|
|
WPTERR_FILE_OPEN = 2, |
30 |
|
|
WPTERR_FILE_CREAT = 3, |
31 |
|
|
WPTERR_FILE_READ = 4, |
32 |
|
|
WPTERR_FILE_WRITE = 5, |
33 |
|
|
WPTERR_FILE_CLOSE = 6, |
34 |
|
|
WPTERR_FILE_EXIST = 7, |
35 |
|
|
WPTERR_FILE_REMOVE = 8, |
36 |
|
|
WPTERR_CLIP_OPEN = 10, |
37 |
|
|
WPTERR_CLIP_CLOSE = 11, |
38 |
|
|
WPTERR_CLIP_EMPTY = 12, |
39 |
|
|
WPTERR_CLIP_SET = 13, |
40 |
|
|
WPTERR_CLIP_GET = 14, |
41 |
|
|
WPTERR_CLIP_ISEMPTY = 15, |
42 |
|
|
WPTERR_CLIP = 16, |
43 |
|
|
WPTERR_CLIP_SECURED = 17, |
44 |
|
|
WPTERR_WINSOCK_INIT = 18, |
45 |
|
|
WPTERR_WINSOCK_RESOLVE= 19, |
46 |
|
|
WPTERR_WINSOCK_SOCKET = 20, |
47 |
|
|
WPTERR_WINSOCK_CONNECT= 21, |
48 |
|
|
WPTERR_WINSOCK_SENDKEY= 22, |
49 |
|
|
WPTERR_WINSOCK_RECVKEY= 23, |
50 |
|
|
WPTERR_WINSOCK_TIMEOUT= 50, |
51 |
twoaday |
271 |
WPTERR_WINSOCK_PROXY = 51, /* general error for proxy problems. */ |
52 |
werner |
37 |
WPTERR_KEYSERVER_NOTFOUND= 24, |
53 |
|
|
WPTERR_REGISTRY = 26, |
54 |
|
|
WPTERR_HOTKEY = 28, |
55 |
|
|
WPTERR_DIR_OPEN = 33, |
56 |
|
|
WPTERR_DIR_CREAT = 34, |
57 |
|
|
WPTERR_CURR_WND = 35, |
58 |
|
|
WPTERR_CONFIG_FILE = 36, |
59 |
twoaday |
161 |
WPTERR_NODATA = 37, |
60 |
twoaday |
271 |
WPTERR_GPG_EXEFILE = 38, |
61 |
|
|
WPTERR_GPG_KEYRINGS = 39, |
62 |
|
|
WPTERR_GPG_OPT_KEYRINGS= 40, |
63 |
werner |
37 |
WPTERR_NOCARD = 100, |
64 |
|
|
WPTERR_NOREADER = 101, |
65 |
|
|
WPTERR_NOPGPCARD = 102, |
66 |
|
|
}; |
67 |
|
|
|
68 |
|
|
void debug_end (void); |
69 |
|
|
const char * winpt_strerror (int errid); |
70 |
|
|
void winpt_errmsg (const char * name, int is_file); |
71 |
|
|
void debug_box (const char * msg, const char * file, int line); |
72 |
|
|
void debug_f (const char * msg, const char * file, int line); |
73 |
|
|
void log_debug (const char * format, ...); |
74 |
twoaday |
133 |
int printf_box (const char * title, int style, const char * format, ...); |
75 |
|
|
#define log_box printf_box |
76 |
werner |
37 |
|
77 |
twoaday |
329 |
/*-- wptTrayPop.cpp --*/ |
78 |
werner |
37 |
int msg_box (HWND hwnd, const char * text, const char * title, int mode); |
79 |
|
|
int show_msg (HWND hWnd, int millis, LPCTSTR string); |
80 |
|
|
#define status_box(hwnd, text, title) msg_box (hwnd, text, title, MB_OK) |
81 |
|
|
|
82 |
twoaday |
329 |
void balloon_msg_disable (void); |
83 |
|
|
void show_balloon_msg (HWND hparwnd, LPCTSTR string, LPCTSTR icon_name); |
84 |
|
|
HWND show_balloon_msg_pos (HWND hparwnd, int millis, int x, int y, |
85 |
|
|
LPCTSTR string, LPCTSTR icon_name); |
86 |
|
|
|
87 |
werner |
37 |
#endif /* WPT_ERRORS_H */ |