5 # include "uxconfig.h" /* Space to hide it from mkfiles.pl */
8 #include <stdio.h> /* for FILENAME_MAX */
9 #include <stdint.h> /* C99 int types */
11 #include <dlfcn.h> /* Dynamic library loading */
18 FILE *f_open(const struct Filename
*, char const *, int);
21 char *name
; /* may be "" to indicate no selected font at all */
23 struct FontSpec
*fontspec_new(const char *name
);
25 typedef void *Context
; /* FIXME: probably needs changing */
28 #define OSSOCKET_DEFINED /* stop network.h using its default */
30 extern Backend pty_backend
;
32 typedef uint32_t uint32
; /* C99: uint32_t defined in stdint.h */
33 #define PUTTY_UINT32_DEFINED
36 * Under GTK, we send MA_CLICK _and_ MA_2CLK, or MA_CLICK _and_
37 * MA_3CLK, when a button is pressed for the second or third time.
39 #define MULTICLICK_ONLY_EVENT 0
42 * Under GTK, there is no context help available.
44 #define HELPCTX(x) P(NULL)
45 #define FILTER_KEY_FILES NULL /* FIXME */
46 #define FILTER_DYNLIB_FILES NULL /* FIXME */
49 * Under X, selection data must not be NUL-terminated.
51 #define SELECTION_NUL_TERMINATED 0
54 * Under X, copying to the clipboard terminates lines with just LF.
58 /* Simple wraparound timer function */
59 unsigned long getticks(void); /* based on gettimeofday(2) */
60 #define GETTICKCOUNT getticks
61 #define TICKSPERSEC 1000 /* we choose to use milliseconds */
62 #define CURSORBLINK 450 /* no standard way to set this */
65 #define BYTE unsigned char
68 * Unix-specific global flag
70 * FLAG_STDERR_TTY indicates that standard error might be a terminal and
71 * might get its configuration munged, so anything trying to output plain
72 * text (i.e. with newlines in it) will need to put it back into cooked
73 * mode first. Applications setting this flag should also call
74 * stderr_tty_init() before messing with any terminal modes, and can call
75 * premsg() before outputting text to stderr and postmsg() afterwards.
77 #define FLAG_STDERR_TTY 0x1000
79 /* Things pty.c needs from pterm.c */
80 char *get_x_display(void *frontend
);
81 int font_dimension(void *frontend
, int which
);/* 0 for width, 1 for height */
82 long get_windowid(void *frontend
);
84 /* Things gtkdlg.c needs from pterm.c */
85 void *get_window(void *frontend
); /* void * to avoid depending on gtk.h */
87 /* Things pterm.c needs from gtkdlg.c */
88 int do_config_box(const char *title
, Conf
*conf
,
89 int midsession
, int protcfginfo
);
90 void fatal_message_box(void *window
, char *msg
);
91 void nonfatal_message_box(void *window
, char *msg
);
92 void about_box(void *window
);
93 void *eventlogstuff_new(void);
94 void showeventlog(void *estuff
, void *parentwin
);
95 void logevent_dlg(void *estuff
, const char *string
);
96 int reallyclose(void *frontend
);
97 #ifdef MAY_REFER_TO_GTK_IN_HEADERS
98 int messagebox(GtkWidget
*parentwin
, char *title
, char *msg
, int minwid
, ...);
99 int string_width(char *text
);
102 /* Things pterm.c needs from {ptermm,uxputty}.c */
103 char *make_default_wintitle(char *hostname
);
104 int process_nonoption_arg(char *arg
, Conf
*conf
, int *allow_launch
);
106 /* pterm.c needs this special function in xkeysym.c */
107 int keysym_to_unicode(int keysym
);
109 /* Things uxstore.c needs from pterm.c */
110 char *x_get_default(const char *key
);
112 /* Things uxstore.c provides to pterm.c */
113 void provide_xrm_string(char *string
);
115 /* Things provided by uxcons.c */
117 void stderr_tty_init(void);
118 void premsg(struct termios
*);
119 void postmsg(struct termios
*);
121 /* The interface used by uxsel.c */
122 void uxsel_init(void);
123 typedef int (*uxsel_callback_fn
)(int fd
, int event
);
124 void uxsel_set(int fd
, int rwx
, uxsel_callback_fn callback
);
125 void uxsel_del(int fd
);
126 int select_result(int fd
, int event
);
127 int first_fd(int *state
, int *rwx
);
128 int next_fd(int *state
, int *rwx
);
129 /* The following are expected to be provided _to_ uxsel.c by the frontend */
130 int uxsel_input_add(int fd
, int rwx
); /* returns an id */
131 void uxsel_input_remove(int id
);
135 void unix_setup_config_box(struct controlbox
*b
, int midsession
, int protocol
);
138 void gtk_setup_config_box(struct controlbox
*b
, int midsession
, void *window
);
141 * In the Unix Unicode layer, DEFAULT_CODEPAGE is a special value
142 * which causes mb_to_wc and wc_to_mb to call _libc_ rather than
143 * libcharset. That way, we can interface the various charsets
144 * supported by libcharset with the one supported by mbstowcs and
145 * wcstombs (which will be the character set in which stuff read
146 * from the command line or config files is assumed to be encoded).
148 #define DEFAULT_CODEPAGE 0xFFFF
149 #define CP_UTF8 CS_UTF8 /* from libcharset */
151 #define strnicmp strncasecmp
152 #define stricmp strcasecmp
154 /* BSD-semantics version of signal(), and another helpful function */
155 void (*putty_signal(int sig
, void (*func
)(int)))(int);
156 void block_signal(int sig
, int block_it
);
160 void noncloexec(int);
162 int no_nonblock(int);
165 * Exports from unicode.c.
168 int init_ucs(struct unicode_data
*ucsdata
, char *line_codepage
,
169 int utf8_override
, int font_charset
, int vtmode
);
172 * Spare function exported directly from uxnet.c.
174 void *sk_getxdmdata(void *sock
, int *lenp
);
177 * Function provided by front ends, and called by uxnet.c to indicate
178 * that net_pending_errors() would like to be called back when the
179 * front end has a spare moment and isn't deep in any other recursion.
181 void frontend_net_error_pending(void);
184 * General helpful Unix stuff: more helpful version of the FD_SET
185 * macro, which also handles maxfd.
187 #define FD_SET_MAX(fd, max, set) do { \
189 if (max < fd + 1) max = fd + 1; \
193 * Exports from winser.c.
195 extern Backend serial_backend
;