Miscellaneous fixes to finish up `remove-statics'. rlogin.c had a
[u/mdw/putty] / unix / unix.h
1 #ifndef PUTTY_UNIX_H
2 #define PUTTY_UNIX_H
3
4 #include "charset.h"
5
6 typedef void *Context; /* FIXME: probably needs changing */
7
8 extern Backend pty_backend;
9
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
21 /*
22 * Under X, copying to the clipboard terminates lines with just LF.
23 */
24 #define SEL_NL { 10 }
25
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 */
30 #define CURSORBLINK 450000 /* no standard way to set this */
31
32 #define WCHAR wchar_t
33 #define BYTE unsigned char
34
35 GLOBAL void *logctx;
36
37 /* Things pty.c needs from pterm.c */
38 char *get_x_display(void *frontend);
39 int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
40
41 /* Things uxstore.c needs from pterm.c */
42 char *x_get_default(const char *key);
43
44 /* Things uxstore.c provides to pterm.c */
45 void provide_xrm_string(char *string);
46
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
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 */
62
63 #define strnicmp strncasecmp
64 #define stricmp strcasecmp
65
66 /* BSD-semantics version of signal() */
67 void (*putty_signal(int sig, void (*func)(int)))(int);
68
69 /*
70 * Exports from unicode.c.
71 */
72 struct unicode_data;
73 int init_ucs(struct unicode_data *ucsdata,
74 char *line_codepage, int font_charset);
75
76 /*
77 * Spare function exported directly from uxnet.c.
78 */
79 int sk_getxdmdata(void *sock, unsigned long *ip, int *port);
80
81 #endif