4 #include <stdio.h> /* for FILENAME_MAX */
8 char path[FILENAME_MAX];
10 #define f_open(filename, mode) ( fopen((filename).path, (mode)) )
16 typedef void *Context; /* FIXME: probably needs changing */
19 #define OSSOCKET_DEFINED /* stop network.h using its default */
21 extern Backend pty_backend;
24 * Under GTK, we send MA_CLICK _and_ MA_2CLK, or MA_CLICK _and_
25 * MA_3CLK, when a button is pressed for the second or third time.
27 #define MULTICLICK_ONLY_EVENT 0
30 * Under GTK, there is no context help available.
32 #define HELPCTX(x) P(NULL)
33 #define FILTER_KEY_FILES NULL /* FIXME */
36 * Under X, selection data must not be NUL-terminated.
38 #define SELECTION_NUL_TERMINATED 0
41 * Under X, copying to the clipboard terminates lines with just LF.
45 /* Simple wraparound timer function */
46 unsigned long getticks(void); /* based on gettimeofday(2) */
47 #define GETTICKCOUNT getticks
48 #define TICKSPERSEC 1000 /* we choose to use milliseconds */
49 #define CURSORBLINK 450 /* no standard way to set this */
50 /* getticks() works using gettimeofday(), so it's vulnerable to system clock
51 * changes causing chaos. Therefore, we provide a compensation mechanism. */
53 #define TIMING_SYNC_ANOW
54 extern long tickcount_offset;
57 #define BYTE unsigned char
59 /* Things pty.c needs from pterm.c */
60 char *get_x_display(void *frontend);
61 int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
62 long get_windowid(void *frontend);
64 /* Things gtkdlg.c needs from pterm.c */
65 void *get_window(void *frontend); /* void * to avoid depending on gtk.h */
67 /* Things pterm.c needs from gtkdlg.c */
68 int do_config_box(const char *title, Config *cfg,
69 int midsession, int protcfginfo);
70 void fatal_message_box(void *window, char *msg);
71 void about_box(void *window);
72 void *eventlogstuff_new(void);
73 void showeventlog(void *estuff, void *parentwin);
74 void logevent_dlg(void *estuff, const char *string);
75 int reallyclose(void *frontend);
77 /* Things pterm.c needs from {ptermm,uxputty}.c */
78 char *make_default_wintitle(char *hostname);
79 int process_nonoption_arg(char *arg, Config *cfg);
81 /* pterm.c needs this special function in xkeysym.c */
82 int keysym_to_unicode(int keysym);
84 /* Things uxstore.c needs from pterm.c */
85 char *x_get_default(const char *key);
87 /* Things uxstore.c provides to pterm.c */
88 void provide_xrm_string(char *string);
90 /* The interface used by uxsel.c */
91 void uxsel_init(void);
92 typedef int (*uxsel_callback_fn)(int fd, int event);
93 void uxsel_set(int fd, int rwx, uxsel_callback_fn callback);
94 void uxsel_del(int fd);
95 int select_result(int fd, int event);
96 int first_fd(int *state, int *rwx);
97 int next_fd(int *state, int *rwx);
98 /* The following are expected to be provided _to_ uxsel.c by the frontend */
99 int uxsel_input_add(int fd, int rwx); /* returns an id */
100 void uxsel_input_remove(int id);
104 void unix_setup_config_box(struct controlbox *b, int midsession);
107 void gtk_setup_config_box(struct controlbox *b, int midsession, void *window);
110 * In the Unix Unicode layer, DEFAULT_CODEPAGE is a special value
111 * which causes mb_to_wc and wc_to_mb to call _libc_ rather than
112 * libcharset. That way, we can interface the various charsets
113 * supported by libcharset with the one supported by mbstowcs and
114 * wcstombs (which will be the character set in which stuff read
115 * from the command line or config files is assumed to be encoded).
117 #define DEFAULT_CODEPAGE 0xFFFF
118 #define CP_UTF8 CS_UTF8 /* from libcharset */
120 #define strnicmp strncasecmp
121 #define stricmp strcasecmp
123 /* BSD-semantics version of signal(), and another helpful function */
124 void (*putty_signal(int sig, void (*func)(int)))(int);
125 void block_signal(int sig, int block_it);
128 * Exports from unicode.c.
131 int init_ucs(struct unicode_data *ucsdata, char *line_codepage,
132 int utf8_override, int font_charset, int vtmode);
135 * Spare function exported directly from uxnet.c.
137 void *sk_getxdmdata(void *sock, int *lenp);
140 * General helpful Unix stuff: more helpful version of the FD_SET
141 * macro, which also handles maxfd.
143 #define FD_SET_MAX(fd, max, set) do { \
145 if (max < fd + 1) max = fd + 1; \