5 # include "uxconfig.h" /* Space to hide it from mkfiles.pl */
\r
8 #include <stdio.h> /* for FILENAME_MAX */
\r
9 #include <stdint.h> /* C99 int types */
\r
11 #include <dlfcn.h> /* Dynamic library loading */
\r
12 #endif /* NO_LIBDL */
\r
13 #include "charset.h"
\r
16 char path[FILENAME_MAX];
\r
18 FILE *f_open(struct Filename, char const *, int);
\r
24 typedef void *Context; /* FIXME: probably needs changing */
\r
26 typedef int OSSocket;
\r
27 #define OSSOCKET_DEFINED /* stop network.h using its default */
\r
29 extern Backend pty_backend;
\r
31 typedef uint32_t uint32; /* C99: uint32_t defined in stdint.h */
\r
32 #define PUTTY_UINT32_DEFINED
\r
35 * Under GTK, we send MA_CLICK _and_ MA_2CLK, or MA_CLICK _and_
\r
36 * MA_3CLK, when a button is pressed for the second or third time.
\r
38 #define MULTICLICK_ONLY_EVENT 0
\r
41 * Under GTK, there is no context help available.
\r
43 #define HELPCTX(x) P(NULL)
\r
44 #define FILTER_KEY_FILES NULL /* FIXME */
\r
45 #define FILTER_DYNLIB_FILES NULL /* FIXME */
\r
48 * Under X, selection data must not be NUL-terminated.
\r
50 #define SELECTION_NUL_TERMINATED 0
\r
53 * Under X, copying to the clipboard terminates lines with just LF.
\r
55 #define SEL_NL { 10 }
\r
57 /* Simple wraparound timer function */
\r
58 unsigned long getticks(void); /* based on gettimeofday(2) */
\r
59 #define GETTICKCOUNT getticks
\r
60 #define TICKSPERSEC 1000 /* we choose to use milliseconds */
\r
61 #define CURSORBLINK 450 /* no standard way to set this */
\r
62 /* getticks() works using gettimeofday(), so it's vulnerable to system clock
\r
63 * changes causing chaos. Therefore, we provide a compensation mechanism. */
\r
65 #define TIMING_SYNC_ANOW
\r
66 extern long tickcount_offset;
\r
68 #define WCHAR wchar_t
\r
69 #define BYTE unsigned char
\r
72 * Unix-specific global flag
\r
74 * FLAG_STDERR_TTY indicates that standard error might be a terminal and
\r
75 * might get its configuration munged, so anything trying to output plain
\r
76 * text (i.e. with newlines in it) will need to put it back into cooked
\r
77 * mode first. Applications setting this flag should also call
\r
78 * stderr_tty_init() before messing with any terminal modes, and can call
\r
79 * premsg() before outputting text to stderr and postmsg() afterwards.
\r
81 #define FLAG_STDERR_TTY 0x1000
\r
83 /* Things pty.c needs from pterm.c */
\r
84 char *get_x_display(void *frontend);
\r
85 int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
\r
86 long get_windowid(void *frontend);
\r
88 /* Things gtkdlg.c needs from pterm.c */
\r
89 void *get_window(void *frontend); /* void * to avoid depending on gtk.h */
\r
91 /* Things pterm.c needs from gtkdlg.c */
\r
92 int do_config_box(const char *title, Config *cfg,
\r
93 int midsession, int protcfginfo);
\r
94 void fatal_message_box(void *window, char *msg);
\r
95 void about_box(void *window);
\r
96 void *eventlogstuff_new(void);
\r
97 void showeventlog(void *estuff, void *parentwin);
\r
98 void logevent_dlg(void *estuff, const char *string);
\r
99 int reallyclose(void *frontend);
\r
101 /* Things pterm.c needs from {ptermm,uxputty}.c */
\r
102 char *make_default_wintitle(char *hostname);
\r
103 int process_nonoption_arg(char *arg, Config *cfg, int *allow_launch);
\r
105 /* pterm.c needs this special function in xkeysym.c */
\r
106 int keysym_to_unicode(int keysym);
\r
108 /* Things uxstore.c needs from pterm.c */
\r
109 char *x_get_default(const char *key);
\r
111 /* Things uxstore.c provides to pterm.c */
\r
112 void provide_xrm_string(char *string);
\r
114 /* Things provided by uxcons.c */
\r
116 void stderr_tty_init(void);
\r
117 void premsg(struct termios *);
\r
118 void postmsg(struct termios *);
\r
120 /* The interface used by uxsel.c */
\r
121 void uxsel_init(void);
\r
122 typedef int (*uxsel_callback_fn)(int fd, int event);
\r
123 void uxsel_set(int fd, int rwx, uxsel_callback_fn callback);
\r
124 void uxsel_del(int fd);
\r
125 int select_result(int fd, int event);
\r
126 int first_fd(int *state, int *rwx);
\r
127 int next_fd(int *state, int *rwx);
\r
128 /* The following are expected to be provided _to_ uxsel.c by the frontend */
\r
129 int uxsel_input_add(int fd, int rwx); /* returns an id */
\r
130 void uxsel_input_remove(int id);
\r
134 void unix_setup_config_box(struct controlbox *b, int midsession, int protocol);
\r
137 void gtk_setup_config_box(struct controlbox *b, int midsession, void *window);
\r
140 * In the Unix Unicode layer, DEFAULT_CODEPAGE is a special value
\r
141 * which causes mb_to_wc and wc_to_mb to call _libc_ rather than
\r
142 * libcharset. That way, we can interface the various charsets
\r
143 * supported by libcharset with the one supported by mbstowcs and
\r
144 * wcstombs (which will be the character set in which stuff read
\r
145 * from the command line or config files is assumed to be encoded).
\r
147 #define DEFAULT_CODEPAGE 0xFFFF
\r
148 #define CP_UTF8 CS_UTF8 /* from libcharset */
\r
150 #define strnicmp strncasecmp
\r
151 #define stricmp strcasecmp
\r
153 /* BSD-semantics version of signal(), and another helpful function */
\r
154 void (*putty_signal(int sig, void (*func)(int)))(int);
\r
155 void block_signal(int sig, int block_it);
\r
161 * Exports from unicode.c.
\r
163 struct unicode_data;
\r
164 int init_ucs(struct unicode_data *ucsdata, char *line_codepage,
\r
165 int utf8_override, int font_charset, int vtmode);
\r
168 * Spare function exported directly from uxnet.c.
\r
170 void *sk_getxdmdata(void *sock, int *lenp);
\r
173 * General helpful Unix stuff: more helpful version of the FD_SET
\r
174 * macro, which also handles maxfd.
\r
176 #define FD_SET_MAX(fd, max, set) do { \
\r
177 FD_SET(fd, &set); \
\r
178 if (max < fd + 1) max = fd + 1; \
\r
182 * Exports from winser.c.
\r
184 extern Backend serial_backend;
\r