Miscellaneous fixes to finish up `remove-statics'. rlogin.c had a
[u/mdw/putty] / unix / unix.h
CommitLineData
f7f27309 1#ifndef PUTTY_UNIX_H
2#define PUTTY_UNIX_H
3
2dc6356a 4#include "charset.h"
5
f7f27309 6typedef void *Context; /* FIXME: probably needs changing */
7
1709795f 8extern Backend pty_backend;
9
e6346999 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
0f351587 21/*
22 * Under X, copying to the clipboard terminates lines with just LF.
23 */
24#define SEL_NL { 10 }
25
f7f27309 26/* Simple wraparound timer function */
27unsigned long getticks(void); /* based on gettimeofday(2) */
28#define GETTICKCOUNT getticks
29#define TICKSPERSEC 1000000 /* gettimeofday returns microseconds */
215a9fd9 30#define CURSORBLINK 450000 /* no standard way to set this */
f7f27309 31
32#define WCHAR wchar_t
33#define BYTE unsigned char
34
a0e5ed33 35GLOBAL void *logctx;
36
e9aef757 37/* Things pty.c needs from pterm.c */
a8327734 38char *get_x_display(void *frontend);
39int font_dimension(void *frontend, int which);/* 0 for width, 1 for height */
755a6d84 40
faec60ed 41/* Things uxstore.c needs from pterm.c */
c85623f9 42char *x_get_default(const char *key);
faec60ed 43
0ac15bdc 44/* Things uxstore.c provides to pterm.c */
45void provide_xrm_string(char *string);
46
c5e438ec 47/* Things uxnet.c provides to the front end */
48int select_result(int fd, int event);
49int first_socket(int *state, int *rwx);
50int next_socket(int *state, int *rwx);
51
2dc6356a 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 */
f7f27309 62
68a49acb 63#define strnicmp strncasecmp
64#define stricmp strcasecmp
65
0f33f9d1 66/* BSD-semantics version of signal() */
67void (*putty_signal(int sig, void (*func)(int)))(int);
68
facd762c 69/*
70 * Exports from unicode.c.
71 */
21d2b241 72struct unicode_data;
73int init_ucs(struct unicode_data *ucsdata,
74 char *line_codepage, int font_charset);
facd762c 75
2f92b717 76/*
77 * Spare function exported directly from uxnet.c.
78 */
79int sk_getxdmdata(void *sock, unsigned long *ip, int *port);
80
f7f27309 81#endif