mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 12:23:37 +02:00
correct wrong function prefixes: g_input -> i_input
This commit is contained in:
parent
9cbdf9175e
commit
edb2f699d1
17 changed files with 72 additions and 103 deletions
|
|
@ -37,15 +37,15 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
|||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
||||
/* error, we have to call the function.. */
|
||||
if (rec->condition & G_IO_IN)
|
||||
icond |= G_INPUT_READ;
|
||||
icond |= I_INPUT_READ;
|
||||
else
|
||||
icond |= G_INPUT_WRITE;
|
||||
icond |= I_INPUT_WRITE;
|
||||
}
|
||||
|
||||
if (condition & (G_IO_IN | G_IO_PRI))
|
||||
icond |= G_INPUT_READ;
|
||||
icond |= I_INPUT_READ;
|
||||
if (condition & G_IO_OUT)
|
||||
icond |= G_INPUT_WRITE;
|
||||
icond |= I_INPUT_WRITE;
|
||||
|
||||
if (rec->condition & icond)
|
||||
rec->function(rec->data, source, icond);
|
||||
|
|
@ -53,8 +53,8 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
|
||||
void *data)
|
||||
{
|
||||
IRSSI_INPUT_REC *rec;
|
||||
unsigned int result;
|
||||
|
|
@ -66,9 +66,9 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
|
|||
rec->data = data;
|
||||
|
||||
cond = (GIOCondition) (G_IO_ERR|G_IO_HUP|G_IO_NVAL);
|
||||
if (condition & G_INPUT_READ)
|
||||
if (condition & I_INPUT_READ)
|
||||
cond |= G_IO_IN|G_IO_PRI;
|
||||
if (condition & G_INPUT_WRITE)
|
||||
if (condition & I_INPUT_WRITE)
|
||||
cond |= G_IO_OUT;
|
||||
|
||||
result = g_io_add_watch_full(source, priority, cond,
|
||||
|
|
@ -77,19 +77,16 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
|
|||
return result;
|
||||
}
|
||||
|
||||
int g_input_add(GIOChannel *source, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data)
|
||||
{
|
||||
return g_input_add_full(source, G_PRIORITY_DEFAULT, condition,
|
||||
function, data);
|
||||
return i_input_add_full(source, G_PRIORITY_DEFAULT, condition, function, data);
|
||||
}
|
||||
|
||||
/* easy way to bypass glib polling of io channel internal buffer */
|
||||
int g_input_add_poll(int fd, int priority, int condition,
|
||||
GInputFunction function, void *data)
|
||||
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data)
|
||||
{
|
||||
GIOChannel *source = g_io_channel_unix_new(fd);
|
||||
int ret = g_input_add_full(source, priority, condition, function, data);
|
||||
int ret = i_input_add_full(source, priority, condition, function, data);
|
||||
g_io_channel_unref(source);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
#ifndef IRSSI_CORE_MISC_H
|
||||
#define IRSSI_CORE_MISC_H
|
||||
|
||||
int g_input_add_poll(int fd, int priority, int condition,
|
||||
GInputFunction function, void *data);
|
||||
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data);
|
||||
|
||||
/* `str' should be type char[MAX_INT_STRLEN] */
|
||||
#define ltoa(str, num) \
|
||||
|
|
|
|||
|
|
@ -97,8 +97,7 @@ void net_disconnect_later(GIOChannel *handle)
|
|||
rec = g_new(NET_DISCONNECT_REC, 1);
|
||||
rec->created = time(NULL);
|
||||
rec->handle = handle;
|
||||
rec->tag = g_input_add(handle, G_INPUT_READ,
|
||||
(GInputFunction) sig_disconnect, rec);
|
||||
rec->tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_disconnect, rec);
|
||||
|
||||
if (timeout_tag == -1) {
|
||||
timeout_tag = g_timeout_add(10000, (GSourceFunc)
|
||||
|
|
|
|||
|
|
@ -132,8 +132,7 @@ int net_sendbuffer_send(NET_SENDBUF_REC *rec, const void *data, int size)
|
|||
/* everything couldn't be sent. */
|
||||
if (rec->send_tag == -1) {
|
||||
rec->send_tag =
|
||||
g_input_add(rec->handle, G_INPUT_WRITE,
|
||||
(GInputFunction) sig_sendbuffer, rec);
|
||||
i_input_add(rec->handle, I_INPUT_WRITE, (GInputFunction) sig_sendbuffer, rec);
|
||||
}
|
||||
|
||||
return buffer_add(rec, data, size) ? 0 : -1;
|
||||
|
|
|
|||
|
|
@ -184,10 +184,9 @@ static void server_connect_callback_init_ssl(SERVER_REC *server, GIOChannel *han
|
|||
if (error & 1) {
|
||||
if (server->connect_tag != -1)
|
||||
g_source_remove(server->connect_tag);
|
||||
server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE,
|
||||
(GInputFunction)
|
||||
server_connect_callback_init_ssl,
|
||||
server);
|
||||
server->connect_tag =
|
||||
i_input_add(handle, error == 1 ? I_INPUT_READ : I_INPUT_WRITE,
|
||||
(GInputFunction) server_connect_callback_init_ssl, server);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -253,11 +252,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
|
|||
if (server->connrec->use_tls)
|
||||
server_connect_callback_init_ssl(server, handle);
|
||||
else
|
||||
server->connect_tag =
|
||||
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
|
||||
(GInputFunction)
|
||||
server_connect_callback_init,
|
||||
server);
|
||||
server->connect_tag =
|
||||
i_input_add(handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||
(GInputFunction) server_connect_callback_init, server);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -418,10 +415,8 @@ int server_start_connect(SERVER_REC *server)
|
|||
net_gethostbyname_nonblock(connect_address,
|
||||
server->connect_pipe[1], 0);
|
||||
server->connect_tag =
|
||||
g_input_add(server->connect_pipe[0], G_INPUT_READ,
|
||||
(GInputFunction)
|
||||
server_connect_callback_readpipe,
|
||||
server);
|
||||
i_input_add(server->connect_pipe[0], I_INPUT_READ,
|
||||
(GInputFunction) server_connect_callback_readpipe, server);
|
||||
|
||||
server->connect_time = time(NULL);
|
||||
lookup_servers = g_slist_append(lookup_servers, server);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue