f7f27309 |
1 | #ifndef PUTTY_UNIX_H |
2 | #define PUTTY_UNIX_H |
3 | |
2dc6356a |
4 | #include "charset.h" |
5 | |
f7f27309 |
6 | typedef void *Context; /* FIXME: probably needs changing */ |
7 | |
1709795f |
8 | extern Backend pty_backend; |
9 | |
e6346999 |
10 | /* |
11 | * Under GTK, we send MA_CLICK _and_ MA_2CLK, or MA_CLICK _and_ |
12 | * MA_3CLK, when a button is pressed for the second or third time. |
13 | */ |
14 | #define MULTICLICK_ONLY_EVENT 0 |
15 | |
16 | /* |
17 | * Under X, selection data must not be NUL-terminated. |
18 | */ |
19 | #define SELECTION_NUL_TERMINATED 0 |
20 | |
0f351587 |
21 | /* |
22 | * Under X, copying to the clipboard terminates lines with just LF. |
23 | */ |
24 | #define SEL_NL { 10 } |
25 | |
f7f27309 |
26 | /* Simple wraparound timer function */ |
27 | unsigned long getticks(void); /* based on gettimeofday(2) */ |
28 | #define GETTICKCOUNT getticks |
29 | #define TICKSPERSEC 1000000 /* gettimeofday returns microseconds */ |
215a9fd9 |
30 | #define CURSORBLINK 450000 /* no standard way to set this */ |
f7f27309 |
31 | |
32 | #define WCHAR wchar_t |
33 | #define BYTE unsigned char |
34 | |
a0e5ed33 |
35 | GLOBAL void *logctx; |
36 | |
e9aef757 |
37 | /* Things pty.c needs from pterm.c */ |
a8327734 |
38 | char *get_x_display(void *frontend); |
39 | int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */ |
755a6d84 |
40 | |
faec60ed |
41 | /* Things uxstore.c needs from pterm.c */ |
c5e438ec |
42 | char *x_get_default(char *key); |
faec60ed |
43 | |
0ac15bdc |
44 | /* Things uxstore.c provides to pterm.c */ |
45 | void provide_xrm_string(char *string); |
46 | |
c5e438ec |
47 | /* Things uxnet.c provides to the front end */ |
48 | int select_result(int fd, int event); |
49 | int first_socket(int *state, int *rwx); |
50 | int next_socket(int *state, int *rwx); |
51 | |
2dc6356a |
52 | /* |
53 | * In the Unix Unicode layer, DEFAULT_CODEPAGE is a special value |
54 | * which causes mb_to_wc and wc_to_mb to call _libc_ rather than |
55 | * libcharset. That way, we can interface the various charsets |
56 | * supported by libcharset with the one supported by mbstowcs and |
57 | * wcstombs (which will be the character set in which stuff read |
58 | * from the command line or config files is assumed to be encoded). |
59 | */ |
60 | #define DEFAULT_CODEPAGE 0xFFFF |
61 | #define CP_UTF8 CS_UTF8 /* from libcharset */ |
f7f27309 |
62 | |
68a49acb |
63 | #define strnicmp strncasecmp |
64 | #define stricmp strcasecmp |
65 | |
0f33f9d1 |
66 | /* BSD-semantics version of signal() */ |
67 | void (*putty_signal(int sig, void (*func)(int)))(int); |
68 | |
facd762c |
69 | /* |
70 | * Exports from unicode.c. |
71 | */ |
72 | void init_ucs(int font_charset); |
73 | |
f7f27309 |
74 | #endif |