mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Colin's const-fixing Patch Of Death. Seems to build fine on Windows
as well as Unix, so it can go in. [originally from svn r3162]
This commit is contained in:
parent
0bfe876b57
commit
6bb121ecb9
@ -270,7 +270,7 @@ void console_provide_logctx(void *logctx)
|
||||
console_logctx = logctx;
|
||||
}
|
||||
|
||||
void logevent(void *frontend, char *string)
|
||||
void logevent(void *frontend, const char *string)
|
||||
{
|
||||
if (console_logctx)
|
||||
log_eventlog(console_logctx, string);
|
||||
|
@ -43,7 +43,7 @@ void logtraffic(void *handle, unsigned char c, int logmode)
|
||||
* platforms. Platforms which don't have a meaningful stderr can
|
||||
* just avoid defining FLAG_STDERR.
|
||||
*/
|
||||
void log_eventlog(void *handle, char *event)
|
||||
void log_eventlog(void *handle, const char *event)
|
||||
{
|
||||
struct LogContext *ctx = (struct LogContext *)handle;
|
||||
if ((flags & FLAG_STDERR) && (flags & FLAG_VERBOSE)) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: macevlog.c,v 1.7 2003/04/12 21:06:34 ben Exp $ */
|
||||
/* $Id: macevlog.c,v 1.8 2003/05/04 14:18:18 simon Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2003 Ben Harris
|
||||
* All rights reserved.
|
||||
@ -101,7 +101,7 @@ void mac_freeeventlog(Session *s)
|
||||
}
|
||||
}
|
||||
|
||||
void logevent(void *frontend, char *str)
|
||||
void logevent(void *frontend, const char *str)
|
||||
{
|
||||
Session *s = frontend;
|
||||
ListBounds bounds, visible;
|
||||
|
@ -144,7 +144,7 @@ Socket sk_newlistener(char *srcaddr, int port, Plug plug, int local_host_only)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *sk_addr_error(SockAddr addr)
|
||||
const char *sk_addr_error(SockAddr addr)
|
||||
{
|
||||
|
||||
if (stack != NULL)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $Id: macterm.c,v 1.74 2003/04/12 21:07:25 ben Exp $ */
|
||||
/* $Id: macterm.c,v 1.75 2003/05/04 14:18:18 simon Exp $ */
|
||||
/*
|
||||
* Copyright (c) 1999 Simon Tatham
|
||||
* Copyright (c) 1999, 2002 Ben Harris
|
||||
@ -105,7 +105,7 @@ void post_paint(Session *s);
|
||||
|
||||
void mac_startsession(Session *s)
|
||||
{
|
||||
char *errmsg;
|
||||
const char *errmsg;
|
||||
int i;
|
||||
WinInfo *wi;
|
||||
|
||||
|
@ -217,7 +217,7 @@ static int mactcp_write(Socket, char const *, int);
|
||||
static int mactcp_write_oob(Socket, char const*, int);
|
||||
static void mactcp_set_private_ptr(Socket, void *);
|
||||
static void *mactcp_get_private_ptr(Socket);
|
||||
static char *mactcp_socket_error(Socket);
|
||||
static const char *mactcp_socket_error(Socket);
|
||||
static void mactcp_set_frozen(Socket, int);
|
||||
|
||||
static void mactcp_recv(Actual_Socket s, size_t len);
|
||||
@ -714,7 +714,7 @@ char *mactcp_addr_error(SockAddr addr)
|
||||
}
|
||||
}
|
||||
|
||||
static char *mactcp_socket_error(Socket sock)
|
||||
static const char *mactcp_socket_error(Socket sock)
|
||||
{
|
||||
static char buf[64];
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
|
@ -185,7 +185,7 @@ static int ot_tcp_write_oob(Socket s, char const *data, int len);
|
||||
static void ot_tcp_set_private_ptr(Socket s, void *ptr);
|
||||
static void *ot_tcp_get_private_ptr(Socket s);
|
||||
static void ot_tcp_set_frozen(Socket s, int is_frozen);
|
||||
static char *ot_tcp_socket_error(Socket s);
|
||||
static const char *ot_tcp_socket_error(Socket s);
|
||||
static void ot_recv(Actual_Socket s);
|
||||
void ot_poll(void);
|
||||
|
||||
@ -420,7 +420,7 @@ char *ot_addr_error(SockAddr addr)
|
||||
sprintf(buf, "error %d", addr->error);
|
||||
return buf;
|
||||
}
|
||||
static char *ot_tcp_socket_error(Socket sock)
|
||||
static const char *ot_tcp_socket_error(Socket sock)
|
||||
{
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
static char buf[128];
|
||||
|
@ -38,12 +38,12 @@ struct socket_function_table {
|
||||
void *(*get_private_ptr) (Socket s);
|
||||
void (*set_frozen) (Socket s, int is_frozen);
|
||||
/* ignored by tcp, but vital for ssl */
|
||||
char *(*socket_error) (Socket s);
|
||||
const char *(*socket_error) (Socket s);
|
||||
};
|
||||
|
||||
struct plug_function_table {
|
||||
int (*closing)
|
||||
(Plug p, char *error_msg, int error_code, int calling_back);
|
||||
(Plug p, const char *error_msg, int error_code, int calling_back);
|
||||
/* error_msg is NULL iff it is not an error (ie it closed normally) */
|
||||
/* calling_back != 0 iff there is a Plug function */
|
||||
/* currently running (would cure the fixme in try_send()) */
|
||||
@ -130,7 +130,7 @@ Socket sk_register(void *sock, Plug plug);
|
||||
* if there's a problem. These functions extract an error message,
|
||||
* or return NULL if there's no problem.
|
||||
*/
|
||||
char *sk_addr_error(SockAddr addr);
|
||||
const char *sk_addr_error(SockAddr addr);
|
||||
#define sk_socket_error(s) (((*s)->socket_error) (s))
|
||||
|
||||
/*
|
||||
|
2
plink.c
2
plink.c
@ -558,7 +558,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
netevent = CreateEvent(NULL, FALSE, FALSE, NULL);
|
||||
{
|
||||
char *error;
|
||||
const char *error;
|
||||
char *realhost;
|
||||
/* nodelay is only useful if stdin is a character device (console) */
|
||||
int nodelay = cfg.tcp_nodelay &&
|
||||
|
17
portfwd.c
17
portfwd.c
@ -86,7 +86,7 @@ struct PFwdPrivate {
|
||||
int buflen;
|
||||
};
|
||||
|
||||
static int pfd_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int pfd_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
struct PFwdPrivate *pr = (struct PFwdPrivate *) plug;
|
||||
@ -331,8 +331,8 @@ static void pfd_sent(Plug plug, int bufsize)
|
||||
/*
|
||||
* Called when receiving a PORT OPEN from the server
|
||||
*/
|
||||
char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
|
||||
const Config *cfg)
|
||||
const char *pfd_newconnect(Socket *s, char *hostname, int port,
|
||||
void *c, const Config *cfg)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
pfd_closing,
|
||||
@ -342,7 +342,8 @@ char *pfd_newconnect(Socket *s, char *hostname, int port, void *c,
|
||||
};
|
||||
|
||||
SockAddr addr;
|
||||
char *err, *dummy_realhost;
|
||||
const char *err;
|
||||
char *dummy_realhost;
|
||||
struct PFwdPrivate *pr;
|
||||
|
||||
/*
|
||||
@ -390,7 +391,7 @@ static int pfd_accepting(Plug p, void *sock)
|
||||
};
|
||||
struct PFwdPrivate *pr, *org;
|
||||
Socket s;
|
||||
char *err;
|
||||
const char *err;
|
||||
|
||||
org = (struct PFwdPrivate *)p;
|
||||
pr = snew(struct PFwdPrivate);
|
||||
@ -437,8 +438,8 @@ static int pfd_accepting(Plug p, void *sock)
|
||||
/* Add a new forwarding from port -> desthost:destport
|
||||
sets up a listener on the local machine on (srcaddr:)port
|
||||
*/
|
||||
char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
|
||||
void *backhandle, const Config *cfg)
|
||||
const char *pfd_addforward(char *desthost, int destport, char *srcaddr,
|
||||
int port, void *backhandle, const Config *cfg)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
pfd_closing,
|
||||
@ -447,7 +448,7 @@ char *pfd_addforward(char *desthost, int destport, char *srcaddr, int port,
|
||||
pfd_accepting
|
||||
};
|
||||
|
||||
char *err;
|
||||
const char *err;
|
||||
struct PFwdPrivate *pr;
|
||||
Socket s;
|
||||
|
||||
|
8
proxy.c
8
proxy.c
@ -173,7 +173,7 @@ static void sk_proxy_set_frozen (Socket s, int is_frozen)
|
||||
sk_set_frozen(ps->sub_socket, is_frozen);
|
||||
}
|
||||
|
||||
static char * sk_proxy_socket_error (Socket s)
|
||||
static const char * sk_proxy_socket_error (Socket s)
|
||||
{
|
||||
Proxy_Socket ps = (Proxy_Socket) s;
|
||||
if (ps->error != NULL || ps->sub_socket == NULL) {
|
||||
@ -184,7 +184,7 @@ static char * sk_proxy_socket_error (Socket s)
|
||||
|
||||
/* basic proxy plug functions */
|
||||
|
||||
static int plug_proxy_closing (Plug p, char *error_msg,
|
||||
static int plug_proxy_closing (Plug p, const char *error_msg,
|
||||
int error_code, int calling_back)
|
||||
{
|
||||
Proxy_Plug pp = (Proxy_Plug) p;
|
||||
@ -377,7 +377,7 @@ Socket new_connection(SockAddr addr, char *hostname,
|
||||
Proxy_Socket ret;
|
||||
Proxy_Plug pplug;
|
||||
SockAddr proxy_addr;
|
||||
char *proxy_canonical_name, *err;
|
||||
char *proxy_canonical_name;
|
||||
|
||||
ret = snew(struct Socket_proxy_tag);
|
||||
ret->fn = &socket_fn_table;
|
||||
@ -421,7 +421,7 @@ Socket new_connection(SockAddr addr, char *hostname,
|
||||
/* look-up proxy */
|
||||
proxy_addr = sk_namelookup(cfg->proxy_host,
|
||||
&proxy_canonical_name);
|
||||
if ((err = sk_addr_error(proxy_addr)) != NULL) {
|
||||
if (sk_addr_error(proxy_addr) != NULL) {
|
||||
ret->error = "Proxy error: Unable to resolve proxy host name";
|
||||
return (Socket)ret;
|
||||
}
|
||||
|
2
proxy.h
2
proxy.h
@ -64,7 +64,7 @@ struct Socket_proxy_tag {
|
||||
*/
|
||||
|
||||
/* closing */
|
||||
char *closing_error_msg;
|
||||
const char *closing_error_msg;
|
||||
int closing_error_code;
|
||||
int closing_calling_back;
|
||||
|
||||
|
2
psftp.c
2
psftp.c
@ -1691,7 +1691,7 @@ static void usage(void)
|
||||
static int psftp_connect(char *userhost, char *user, int portnumber)
|
||||
{
|
||||
char *host, *realhost;
|
||||
char *err;
|
||||
const char *err;
|
||||
|
||||
/* Separate host and username */
|
||||
host = userhost;
|
||||
|
9
putty.h
9
putty.h
@ -266,8 +266,9 @@ enum {
|
||||
};
|
||||
|
||||
struct backend_tag {
|
||||
char *(*init) (void *frontend_handle, void **backend_handle, Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay);
|
||||
const char *(*init) (void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay);
|
||||
void (*free) (void *handle);
|
||||
/* back->reconfig() passes in a replacement configuration. */
|
||||
void (*reconfig) (void *handle, Config *cfg);
|
||||
@ -643,7 +644,7 @@ void log_reconfig(void *logctx, Config *cfg);
|
||||
void logfopen(void *logctx);
|
||||
void logfclose(void *logctx);
|
||||
void logtraffic(void *logctx, unsigned char c, int logmode);
|
||||
void log_eventlog(void *logctx, char *string);
|
||||
void log_eventlog(void *logctx, const char *string);
|
||||
enum { PKT_INCOMING, PKT_OUTGOING };
|
||||
void log_packet(void *logctx, int direction, int type,
|
||||
char *texttype, void *data, int len);
|
||||
@ -778,7 +779,7 @@ int wc_unescape(char *output, const char *wildcard);
|
||||
/*
|
||||
* Exports from windlg.c
|
||||
*/
|
||||
void logevent(void *frontend, char *);
|
||||
void logevent(void *frontend, const char *);
|
||||
void verify_ssh_host_key(void *frontend, char *host, int port, char *keytype,
|
||||
char *keystr, char *fingerprint);
|
||||
void askcipher(void *frontend, char *ciphername, int cs);
|
||||
|
10
raw.c
10
raw.c
@ -29,7 +29,7 @@ static void c_write(Raw raw, char *buf, int len)
|
||||
sk_set_frozen(raw->s, backlog > RAW_MAX_BACKLOG);
|
||||
}
|
||||
|
||||
static int raw_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int raw_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
Raw raw = (Raw) plug;
|
||||
@ -67,9 +67,9 @@ static void raw_sent(Plug plug, int bufsize)
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static char *raw_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
static const char *raw_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
raw_closing,
|
||||
@ -77,7 +77,7 @@ static char *raw_init(void *frontend_handle, void **backend_handle,
|
||||
raw_sent
|
||||
};
|
||||
SockAddr addr;
|
||||
char *err;
|
||||
const char *err;
|
||||
Raw raw;
|
||||
|
||||
raw = snew(struct raw_backend_data);
|
||||
|
11
rlogin.c
11
rlogin.c
@ -32,7 +32,7 @@ static void c_write(Rlogin rlogin, char *buf, int len)
|
||||
sk_set_frozen(rlogin->s, backlog > RLOGIN_MAX_BACKLOG);
|
||||
}
|
||||
|
||||
static int rlogin_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int rlogin_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
Rlogin rlogin = (Rlogin) plug;
|
||||
@ -97,9 +97,10 @@ static void rlogin_sent(Plug plug, int bufsize)
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static char *rlogin_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
static const char *rlogin_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost,
|
||||
int nodelay)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
rlogin_closing,
|
||||
@ -107,7 +108,7 @@ static char *rlogin_init(void *frontend_handle, void **backend_handle,
|
||||
rlogin_sent
|
||||
};
|
||||
SockAddr addr;
|
||||
char *err;
|
||||
const char *err;
|
||||
Rlogin rlogin;
|
||||
|
||||
rlogin = snew(struct rlogin_tag);
|
||||
|
3
scp.c
3
scp.c
@ -476,7 +476,8 @@ static void bump(char *fmt, ...)
|
||||
*/
|
||||
static void do_cmd(char *host, char *user, char *cmd)
|
||||
{
|
||||
char *err, *realhost;
|
||||
const char *err;
|
||||
char *realhost;
|
||||
DWORD namelen;
|
||||
|
||||
if (host == NULL || host[0] == '\0')
|
||||
|
27
ssh.c
27
ssh.c
@ -662,7 +662,7 @@ struct ssh_tag {
|
||||
#define logevent(s) logevent(ssh->frontend, s)
|
||||
|
||||
/* logevent, only printf-formatted. */
|
||||
static void logeventf(Ssh ssh, char *fmt, ...)
|
||||
static void logeventf(Ssh ssh, const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
char *buf;
|
||||
@ -2077,7 +2077,7 @@ static void ssh_do_close(Ssh ssh)
|
||||
}
|
||||
}
|
||||
|
||||
static int ssh_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int ssh_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
Ssh ssh = (Ssh) plug;
|
||||
@ -2120,8 +2120,8 @@ static void ssh_sent(Plug plug, int bufsize)
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static char *connect_to_host(Ssh ssh, char *host, int port,
|
||||
char **realhost, int nodelay)
|
||||
static const char *connect_to_host(Ssh ssh, char *host, int port,
|
||||
char **realhost, int nodelay)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
ssh_closing,
|
||||
@ -2131,7 +2131,7 @@ static char *connect_to_host(Ssh ssh, char *host, int port,
|
||||
};
|
||||
|
||||
SockAddr addr;
|
||||
char *err;
|
||||
const char *err;
|
||||
|
||||
ssh->savedhost = snewn(1 + strlen(host), char);
|
||||
if (!ssh->savedhost)
|
||||
@ -3528,7 +3528,8 @@ static void ssh1_protocol(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
||||
struct ssh_rportfwd pf;
|
||||
int hostsize, port;
|
||||
char host[256], buf[1024];
|
||||
char *p, *h, *e;
|
||||
char *p, *h;
|
||||
const char *e;
|
||||
c = snew(struct ssh_channel);
|
||||
c->ssh = ssh;
|
||||
|
||||
@ -6000,8 +6001,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
||||
if (realpf == NULL) {
|
||||
error = "Remote port is not recognised";
|
||||
} else {
|
||||
char *e = pfd_newconnect(&c->u.pfd.s, realpf->dhost,
|
||||
realpf->dport, c, &ssh->cfg);
|
||||
const char *e = pfd_newconnect(&c->u.pfd.s,
|
||||
realpf->dhost,
|
||||
realpf->dport, c,
|
||||
&ssh->cfg);
|
||||
logeventf(ssh, "Received remote port open request"
|
||||
" for %s:%d", realpf->dhost, realpf->dport);
|
||||
if (e != NULL) {
|
||||
@ -6110,11 +6113,11 @@ static void ssh2_protocol(Ssh ssh, unsigned char *in, int inlen, int ispkt)
|
||||
*
|
||||
* Returns an error message, or NULL on success.
|
||||
*/
|
||||
static char *ssh_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
static const char *ssh_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
Ssh ssh;
|
||||
|
||||
ssh = snew(struct ssh_tag);
|
||||
|
15
ssh.h
15
ssh.h
@ -250,18 +250,19 @@ int random_byte(void);
|
||||
void random_add_noise(void *noise, int length);
|
||||
void random_add_heavynoise(void *noise, int length);
|
||||
|
||||
void logevent(void *, char *);
|
||||
void logevent(void *, const char *);
|
||||
|
||||
/* Allocate and register a new channel for port forwarding */
|
||||
void *new_sock_channel(void *handle, Socket s);
|
||||
void ssh_send_port_open(void *channel, char *hostname, int port, char *org);
|
||||
|
||||
/* Exports from portfwd.c */
|
||||
extern char *pfd_newconnect(Socket * s, char *hostname, int port, void *c,
|
||||
const Config *cfg);
|
||||
extern const char *pfd_newconnect(Socket * s, char *hostname, int port,
|
||||
void *c, const Config *cfg);
|
||||
/* desthost == NULL indicates dynamic (SOCKS) port forwarding */
|
||||
extern char *pfd_addforward(char *desthost, int destport, char *srcaddr,
|
||||
int port, void *backhandle, const Config *cfg);
|
||||
extern const char *pfd_addforward(char *desthost, int destport, char *srcaddr,
|
||||
int port, void *backhandle,
|
||||
const Config *cfg);
|
||||
extern void pfd_close(Socket s);
|
||||
extern int pfd_send(Socket s, char *data, int len);
|
||||
extern void pfd_confirm(Socket s);
|
||||
@ -269,8 +270,8 @@ extern void pfd_unthrottle(Socket s);
|
||||
extern void pfd_override_throttle(Socket s, int enable);
|
||||
|
||||
/* Exports from x11fwd.c */
|
||||
extern char *x11_init(Socket *, char *, void *, void *, const char *, int,
|
||||
const Config *);
|
||||
extern const char *x11_init(Socket *, char *, void *, void *, const char *,
|
||||
int, const Config *);
|
||||
extern void x11_close(Socket);
|
||||
extern int x11_send(Socket, char *, int);
|
||||
extern void *x11_invent_auth(char *, int, char *, int, int);
|
||||
|
11
telnet.c
11
telnet.c
@ -631,7 +631,7 @@ static void do_telnet_read(Telnet telnet, char *buf, int len)
|
||||
}
|
||||
}
|
||||
|
||||
static int telnet_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int telnet_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
Telnet telnet = (Telnet) plug;
|
||||
@ -671,9 +671,10 @@ static void telnet_sent(Plug plug, int bufsize)
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static char *telnet_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
static const char *telnet_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost,
|
||||
int nodelay)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
telnet_closing,
|
||||
@ -681,7 +682,7 @@ static char *telnet_init(void *frontend_handle, void **backend_handle,
|
||||
telnet_sent
|
||||
};
|
||||
SockAddr addr;
|
||||
char *err;
|
||||
const char *err;
|
||||
Telnet telnet;
|
||||
|
||||
telnet = snew(struct telnet_tag);
|
||||
|
@ -2720,7 +2720,7 @@ void *eventlogstuff_new(void)
|
||||
return es;
|
||||
}
|
||||
|
||||
void logevent_dlg(void *estuff, char *string)
|
||||
void logevent_dlg(void *estuff, const char *string)
|
||||
{
|
||||
struct eventlog_stuff *es = (struct eventlog_stuff *)estuff;
|
||||
|
||||
|
@ -166,7 +166,7 @@ int from_backend(void *frontend, int is_stderr, const char *data, int len)
|
||||
return term_data(inst->term, is_stderr, data, len);
|
||||
}
|
||||
|
||||
void logevent(void *frontend, char *string)
|
||||
void logevent(void *frontend, const char *string)
|
||||
{
|
||||
struct gui_data *inst = (struct gui_data *)frontend;
|
||||
|
||||
@ -3075,7 +3075,8 @@ int pt_main(int argc, char **argv)
|
||||
|
||||
inst->back = select_backend(&inst->cfg);
|
||||
{
|
||||
char *realhost, *error;
|
||||
char *realhost;
|
||||
const char *error;
|
||||
|
||||
error = inst->back->init((void *)inst, &inst->backhandle,
|
||||
&inst->cfg, inst->cfg.host, inst->cfg.port,
|
||||
|
@ -485,8 +485,8 @@ static void pty_uxsel_setup(void)
|
||||
* Also places the canonical host name into `realhost'. It must be
|
||||
* freed by the caller.
|
||||
*/
|
||||
static char *pty_init(void *frontend, void **backend_handle, Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
static const char *pty_init(void *frontend, void **backend_handle, Config *cfg,
|
||||
char *host, int port, char **realhost, int nodelay)
|
||||
{
|
||||
int slavefd;
|
||||
pid_t pid, pgrp;
|
||||
|
@ -64,7 +64,7 @@ void fatal_message_box(void *window, char *msg);
|
||||
void about_box(void *window);
|
||||
void *eventlogstuff_new(void);
|
||||
void showeventlog(void *estuff, void *parentwin);
|
||||
void logevent_dlg(void *estuff, char *string);
|
||||
void logevent_dlg(void *estuff, const char *string);
|
||||
int reallyclose(void *frontend);
|
||||
|
||||
/* Things pterm.c needs from {ptermm,uxputty}.c */
|
||||
|
@ -258,7 +258,7 @@ void old_keyfile_warning(void)
|
||||
fputs(message, stderr);
|
||||
}
|
||||
|
||||
void logevent(void *frontend, char *string)
|
||||
void logevent(void *frontend, const char *string)
|
||||
{
|
||||
log_eventlog(logctx, string);
|
||||
}
|
||||
|
16
unix/uxnet.c
16
unix/uxnet.c
@ -26,7 +26,7 @@
|
||||
struct Socket_tag {
|
||||
struct socket_function_table *fn;
|
||||
/* the above variable absolutely *must* be the first in this structure */
|
||||
char *error;
|
||||
const char *error;
|
||||
int s;
|
||||
Plug plug;
|
||||
void *private_ptr;
|
||||
@ -56,7 +56,7 @@ struct Socket_tag {
|
||||
typedef struct Socket_tag *Actual_Socket;
|
||||
|
||||
struct SockAddr_tag {
|
||||
char *error;
|
||||
const char *error;
|
||||
/*
|
||||
* Which address family this address belongs to. AF_INET for
|
||||
* IPv4; AF_INET6 for IPv6; AF_UNSPEC indicates that name
|
||||
@ -115,7 +115,7 @@ void sk_cleanup(void)
|
||||
}
|
||||
}
|
||||
|
||||
char *error_string(int error)
|
||||
const char *error_string(int error)
|
||||
{
|
||||
return strerror(error);
|
||||
}
|
||||
@ -322,7 +322,7 @@ static int sk_tcp_write_oob(Socket s, const char *data, int len);
|
||||
static void sk_tcp_set_private_ptr(Socket s, void *ptr);
|
||||
static void *sk_tcp_get_private_ptr(Socket s);
|
||||
static void sk_tcp_set_frozen(Socket s, int is_frozen);
|
||||
static char *sk_tcp_socket_error(Socket s);
|
||||
static const char *sk_tcp_socket_error(Socket s);
|
||||
|
||||
static struct socket_function_table tcp_fn_table = {
|
||||
sk_tcp_plug,
|
||||
@ -837,8 +837,8 @@ static int net_select_result(int fd, int event)
|
||||
ret = recv(s->s, buf, sizeof(buf), MSG_OOB);
|
||||
noise_ultralight(ret);
|
||||
if (ret <= 0) {
|
||||
char *str = (ret == 0 ? "Internal networking trouble" :
|
||||
error_string(errno));
|
||||
const char *str = (ret == 0 ? "Internal networking trouble" :
|
||||
error_string(errno));
|
||||
/* We're inside the Unix frontend here, so we know
|
||||
* that the frontend handle is unnecessary. */
|
||||
logevent(NULL, str);
|
||||
@ -1003,11 +1003,11 @@ static void *sk_tcp_get_private_ptr(Socket sock)
|
||||
* if there's a problem. These functions extract an error message,
|
||||
* or return NULL if there's no problem.
|
||||
*/
|
||||
char *sk_addr_error(SockAddr addr)
|
||||
const char *sk_addr_error(SockAddr addr)
|
||||
{
|
||||
return addr->error;
|
||||
}
|
||||
static char *sk_tcp_socket_error(Socket sock)
|
||||
static const char *sk_tcp_socket_error(Socket sock)
|
||||
{
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
return s->error;
|
||||
|
@ -574,7 +574,7 @@ int main(int argc, char **argv)
|
||||
*/
|
||||
logctx = log_init(NULL, &cfg);
|
||||
{
|
||||
char *error;
|
||||
const char *error;
|
||||
char *realhost;
|
||||
/* nodelay is only useful if stdin is a terminal device */
|
||||
int nodelay = cfg.tcp_nodelay && isatty(0);
|
||||
|
2
windlg.c
2
windlg.c
@ -659,7 +659,7 @@ int do_reconfig(HWND hwnd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
void logevent(void *frontend, char *string)
|
||||
void logevent(void *frontend, const char *string)
|
||||
{
|
||||
char timebuf[40];
|
||||
time_t t;
|
||||
|
2
window.c
2
window.c
@ -636,7 +636,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
|
||||
* Start up the telnet connection.
|
||||
*/
|
||||
{
|
||||
char *error;
|
||||
const char *error;
|
||||
char msg[1024], *title;
|
||||
char *realhost;
|
||||
|
||||
|
6
winnet.c
6
winnet.c
@ -465,7 +465,7 @@ static int sk_tcp_write_oob(Socket s, const char *data, int len);
|
||||
static void sk_tcp_set_private_ptr(Socket s, void *ptr);
|
||||
static void *sk_tcp_get_private_ptr(Socket s);
|
||||
static void sk_tcp_set_frozen(Socket s, int is_frozen);
|
||||
static char *sk_tcp_socket_error(Socket s);
|
||||
static const char *sk_tcp_socket_error(Socket s);
|
||||
|
||||
extern char *do_select(SOCKET skt, int startup);
|
||||
|
||||
@ -1173,11 +1173,11 @@ static void *sk_tcp_get_private_ptr(Socket sock)
|
||||
* if there's a problem. These functions extract an error message,
|
||||
* or return NULL if there's no problem.
|
||||
*/
|
||||
char *sk_addr_error(SockAddr addr)
|
||||
const char *sk_addr_error(SockAddr addr)
|
||||
{
|
||||
return addr->error;
|
||||
}
|
||||
static char *sk_tcp_socket_error(Socket sock)
|
||||
static const char *sk_tcp_socket_error(Socket sock)
|
||||
{
|
||||
Actual_Socket s = (Actual_Socket) sock;
|
||||
return s->error;
|
||||
|
9
x11fwd.c
9
x11fwd.c
@ -174,7 +174,7 @@ static char *x11_verify(unsigned long peer_ip, int peer_port,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int x11_closing(Plug plug, char *error_msg, int error_code,
|
||||
static int x11_closing(Plug plug, const char *error_msg, int error_code,
|
||||
int calling_back)
|
||||
{
|
||||
struct X11Private *pr = (struct X11Private *) plug;
|
||||
@ -232,8 +232,8 @@ int x11_get_screen_number(char *display)
|
||||
* Returns an error message, or NULL on success.
|
||||
* also, fills the SocketsStructure
|
||||
*/
|
||||
char *x11_init(Socket * s, char *display, void *c, void *auth,
|
||||
const char *peeraddr, int peerport, const Config *cfg)
|
||||
const char *x11_init(Socket * s, char *display, void *c, void *auth,
|
||||
const char *peeraddr, int peerport, const Config *cfg)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
x11_closing,
|
||||
@ -244,7 +244,8 @@ char *x11_init(Socket * s, char *display, void *c, void *auth,
|
||||
|
||||
SockAddr addr;
|
||||
int port;
|
||||
char *err, *dummy_realhost;
|
||||
const char *err;
|
||||
char *dummy_realhost;
|
||||
char host[128];
|
||||
int n, displaynum;
|
||||
struct X11Private *pr;
|
||||
|
Loading…
Reference in New Issue
Block a user