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