forked from PsychoticNinja/irssi
correct wrong function prefixes: g_input -> i_input
This commit is contained in:
parent
9cbdf9175e
commit
edb2f699d1
11
src/common.h
11
src/common.h
@ -45,15 +45,14 @@ typedef guint64 uoff_t;
|
|||||||
#define PRIuUOFF_T G_GUINT64_FORMAT
|
#define PRIuUOFF_T G_GUINT64_FORMAT
|
||||||
|
|
||||||
/* input functions */
|
/* input functions */
|
||||||
#define G_INPUT_READ (1 << 0)
|
#define I_INPUT_READ (1 << 0)
|
||||||
#define G_INPUT_WRITE (1 << 1)
|
#define I_INPUT_WRITE (1 << 1)
|
||||||
|
|
||||||
typedef void (*GInputFunction) (void *data, GIOChannel *source, int condition);
|
typedef void (*GInputFunction) (void *data, GIOChannel *source, int condition);
|
||||||
|
|
||||||
int g_input_add(GIOChannel *source, int condition,
|
int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data);
|
||||||
GInputFunction function, void *data);
|
int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
|
||||||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
void *data);
|
||||||
GInputFunction function, void *data);
|
|
||||||
|
|
||||||
/* return full path for ~/.irssi */
|
/* return full path for ~/.irssi */
|
||||||
const char *get_irssi_dir(void);
|
const char *get_irssi_dir(void);
|
||||||
|
@ -37,15 +37,15 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
|||||||
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
|
||||||
/* error, we have to call the function.. */
|
/* error, we have to call the function.. */
|
||||||
if (rec->condition & G_IO_IN)
|
if (rec->condition & G_IO_IN)
|
||||||
icond |= G_INPUT_READ;
|
icond |= I_INPUT_READ;
|
||||||
else
|
else
|
||||||
icond |= G_INPUT_WRITE;
|
icond |= I_INPUT_WRITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (condition & (G_IO_IN | G_IO_PRI))
|
if (condition & (G_IO_IN | G_IO_PRI))
|
||||||
icond |= G_INPUT_READ;
|
icond |= I_INPUT_READ;
|
||||||
if (condition & G_IO_OUT)
|
if (condition & G_IO_OUT)
|
||||||
icond |= G_INPUT_WRITE;
|
icond |= I_INPUT_WRITE;
|
||||||
|
|
||||||
if (rec->condition & icond)
|
if (rec->condition & icond)
|
||||||
rec->function(rec->data, source, icond);
|
rec->function(rec->data, source, icond);
|
||||||
@ -53,8 +53,8 @@ static int irssi_io_invoke(GIOChannel *source, GIOCondition condition,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int g_input_add_full(GIOChannel *source, int priority, int condition,
|
int i_input_add_full(GIOChannel *source, int priority, int condition, GInputFunction function,
|
||||||
GInputFunction function, void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
IRSSI_INPUT_REC *rec;
|
IRSSI_INPUT_REC *rec;
|
||||||
unsigned int result;
|
unsigned int result;
|
||||||
@ -66,9 +66,9 @@ int g_input_add_full(GIOChannel *source, int priority, int condition,
|
|||||||
rec->data = data;
|
rec->data = data;
|
||||||
|
|
||||||
cond = (GIOCondition) (G_IO_ERR|G_IO_HUP|G_IO_NVAL);
|
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;
|
cond |= G_IO_IN|G_IO_PRI;
|
||||||
if (condition & G_INPUT_WRITE)
|
if (condition & I_INPUT_WRITE)
|
||||||
cond |= G_IO_OUT;
|
cond |= G_IO_OUT;
|
||||||
|
|
||||||
result = g_io_add_watch_full(source, priority, cond,
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int g_input_add(GIOChannel *source, int condition,
|
int i_input_add(GIOChannel *source, int condition, GInputFunction function, void *data)
|
||||||
GInputFunction function, void *data)
|
|
||||||
{
|
{
|
||||||
return g_input_add_full(source, G_PRIORITY_DEFAULT, condition,
|
return i_input_add_full(source, G_PRIORITY_DEFAULT, condition, function, data);
|
||||||
function, data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* easy way to bypass glib polling of io channel internal buffer */
|
/* easy way to bypass glib polling of io channel internal buffer */
|
||||||
int g_input_add_poll(int fd, int priority, int condition,
|
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data)
|
||||||
GInputFunction function, void *data)
|
|
||||||
{
|
{
|
||||||
GIOChannel *source = g_io_channel_unix_new(fd);
|
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);
|
g_io_channel_unref(source);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
#ifndef IRSSI_CORE_MISC_H
|
#ifndef IRSSI_CORE_MISC_H
|
||||||
#define IRSSI_CORE_MISC_H
|
#define IRSSI_CORE_MISC_H
|
||||||
|
|
||||||
int g_input_add_poll(int fd, int priority, int condition,
|
int i_input_add_poll(int fd, int priority, int condition, GInputFunction function, void *data);
|
||||||
GInputFunction function, void *data);
|
|
||||||
|
|
||||||
/* `str' should be type char[MAX_INT_STRLEN] */
|
/* `str' should be type char[MAX_INT_STRLEN] */
|
||||||
#define ltoa(str, num) \
|
#define ltoa(str, num) \
|
||||||
|
@ -97,8 +97,7 @@ void net_disconnect_later(GIOChannel *handle)
|
|||||||
rec = g_new(NET_DISCONNECT_REC, 1);
|
rec = g_new(NET_DISCONNECT_REC, 1);
|
||||||
rec->created = time(NULL);
|
rec->created = time(NULL);
|
||||||
rec->handle = handle;
|
rec->handle = handle;
|
||||||
rec->tag = g_input_add(handle, G_INPUT_READ,
|
rec->tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_disconnect, rec);
|
||||||
(GInputFunction) sig_disconnect, rec);
|
|
||||||
|
|
||||||
if (timeout_tag == -1) {
|
if (timeout_tag == -1) {
|
||||||
timeout_tag = g_timeout_add(10000, (GSourceFunc)
|
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. */
|
/* everything couldn't be sent. */
|
||||||
if (rec->send_tag == -1) {
|
if (rec->send_tag == -1) {
|
||||||
rec->send_tag =
|
rec->send_tag =
|
||||||
g_input_add(rec->handle, G_INPUT_WRITE,
|
i_input_add(rec->handle, I_INPUT_WRITE, (GInputFunction) sig_sendbuffer, rec);
|
||||||
(GInputFunction) sig_sendbuffer, rec);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buffer_add(rec, data, size) ? 0 : -1;
|
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 (error & 1) {
|
||||||
if (server->connect_tag != -1)
|
if (server->connect_tag != -1)
|
||||||
g_source_remove(server->connect_tag);
|
g_source_remove(server->connect_tag);
|
||||||
server->connect_tag = g_input_add(handle, error == 1 ? G_INPUT_READ : G_INPUT_WRITE,
|
server->connect_tag =
|
||||||
(GInputFunction)
|
i_input_add(handle, error == 1 ? I_INPUT_READ : I_INPUT_WRITE,
|
||||||
server_connect_callback_init_ssl,
|
(GInputFunction) server_connect_callback_init_ssl, server);
|
||||||
server);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -253,11 +252,9 @@ static void server_real_connect(SERVER_REC *server, IPADDR *ip,
|
|||||||
if (server->connrec->use_tls)
|
if (server->connrec->use_tls)
|
||||||
server_connect_callback_init_ssl(server, handle);
|
server_connect_callback_init_ssl(server, handle);
|
||||||
else
|
else
|
||||||
server->connect_tag =
|
server->connect_tag =
|
||||||
g_input_add(handle, G_INPUT_WRITE | G_INPUT_READ,
|
i_input_add(handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||||
(GInputFunction)
|
(GInputFunction) server_connect_callback_init, server);
|
||||||
server_connect_callback_init,
|
|
||||||
server);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,10 +415,8 @@ int server_start_connect(SERVER_REC *server)
|
|||||||
net_gethostbyname_nonblock(connect_address,
|
net_gethostbyname_nonblock(connect_address,
|
||||||
server->connect_pipe[1], 0);
|
server->connect_pipe[1], 0);
|
||||||
server->connect_tag =
|
server->connect_tag =
|
||||||
g_input_add(server->connect_pipe[0], G_INPUT_READ,
|
i_input_add(server->connect_pipe[0], I_INPUT_READ,
|
||||||
(GInputFunction)
|
(GInputFunction) server_connect_callback_readpipe, server);
|
||||||
server_connect_callback_readpipe,
|
|
||||||
server);
|
|
||||||
|
|
||||||
server->connect_time = time(NULL);
|
server->connect_time = time(NULL);
|
||||||
lookup_servers = g_slist_append(lookup_servers, server);
|
lookup_servers = g_slist_append(lookup_servers, server);
|
||||||
|
@ -524,9 +524,8 @@ static void handle_exec(const char *args, GHashTable *optlist,
|
|||||||
level = g_hash_table_lookup(optlist, "level");
|
level = g_hash_table_lookup(optlist, "level");
|
||||||
rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL);
|
rec->level = level == NULL ? MSGLEVEL_CLIENTCRAP : level2bits(level, NULL);
|
||||||
|
|
||||||
rec->read_tag = g_input_add(rec->in, G_INPUT_READ,
|
rec->read_tag =
|
||||||
(GInputFunction) sig_exec_input_reader,
|
i_input_add(rec->in, I_INPUT_READ, (GInputFunction) sig_exec_input_reader, rec);
|
||||||
rec);
|
|
||||||
processes = g_slist_append(processes, rec);
|
processes = g_slist_append(processes, rec);
|
||||||
|
|
||||||
if (rec->target == NULL && interactive)
|
if (rec->target == NULL && interactive)
|
||||||
|
@ -85,9 +85,8 @@ static void sig_input(void);
|
|||||||
|
|
||||||
void input_listen_init(int handle)
|
void input_listen_init(int handle)
|
||||||
{
|
{
|
||||||
readtag = g_input_add_poll(handle,
|
readtag = i_input_add_poll(handle, G_PRIORITY_HIGH, I_INPUT_READ,
|
||||||
G_PRIORITY_HIGH, G_INPUT_READ,
|
(GInputFunction) sig_input, NULL);
|
||||||
(GInputFunction) sig_input, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_listen_deinit(void)
|
void input_listen_deinit(void)
|
||||||
|
@ -491,10 +491,8 @@ static void irc_init_server(IRC_SERVER_REC *server)
|
|||||||
if (!IS_IRC_SERVER(server))
|
if (!IS_IRC_SERVER(server))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
server->readtag =
|
server->readtag = i_input_add(net_sendbuffer_handle(server->handle), I_INPUT_READ,
|
||||||
g_input_add(net_sendbuffer_handle(server->handle),
|
(GInputFunction) irc_parse_incoming, server);
|
||||||
G_INPUT_READ,
|
|
||||||
(GInputFunction) irc_parse_incoming, server);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void irc_irc_init(void)
|
void irc_irc_init(void)
|
||||||
|
@ -355,8 +355,7 @@ static void dcc_chat_listen(CHAT_DCC_REC *dcc)
|
|||||||
memcpy(&dcc->addr, &ip, sizeof(IPADDR));
|
memcpy(&dcc->addr, &ip, sizeof(IPADDR));
|
||||||
net_ip2host(&dcc->addr, dcc->addrstr);
|
net_ip2host(&dcc->addr, dcc->addrstr);
|
||||||
dcc->port = port;
|
dcc->port = port;
|
||||||
dcc->tagread = g_input_add(handle, G_INPUT_READ,
|
dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, dcc);
|
||||||
(GInputFunction) dcc_chat_input, dcc);
|
|
||||||
|
|
||||||
signal_emit("dcc connected", 1, dcc);
|
signal_emit("dcc connected", 1, dcc);
|
||||||
}
|
}
|
||||||
@ -379,8 +378,7 @@ static void sig_chat_connected(CHAT_DCC_REC *dcc)
|
|||||||
|
|
||||||
dcc->starttime = time(NULL);
|
dcc->starttime = time(NULL);
|
||||||
dcc->sendbuf = net_sendbuffer_create(dcc->handle, 0);
|
dcc->sendbuf = net_sendbuffer_create(dcc->handle, 0);
|
||||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_input, dcc);
|
||||||
(GInputFunction) dcc_chat_input, dcc);
|
|
||||||
|
|
||||||
signal_emit("dcc connected", 1, dcc);
|
signal_emit("dcc connected", 1, dcc);
|
||||||
}
|
}
|
||||||
@ -397,9 +395,8 @@ static void dcc_chat_connect(CHAT_DCC_REC *dcc)
|
|||||||
|
|
||||||
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
|
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
|
||||||
if (dcc->handle != NULL) {
|
if (dcc->handle != NULL) {
|
||||||
dcc->tagconn = g_input_add(dcc->handle,
|
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||||
G_INPUT_WRITE | G_INPUT_READ,
|
(GInputFunction) sig_chat_connected, dcc);
|
||||||
(GInputFunction) sig_chat_connected, dcc);
|
|
||||||
} else {
|
} else {
|
||||||
/* error connecting */
|
/* error connecting */
|
||||||
signal_emit("dcc error connect", 1, dcc);
|
signal_emit("dcc error connect", 1, dcc);
|
||||||
@ -428,8 +425,8 @@ static void dcc_chat_passive(CHAT_DCC_REC *dcc)
|
|||||||
cmd_return_error(CMDERR_ERRNO);
|
cmd_return_error(CMDERR_ERRNO);
|
||||||
|
|
||||||
dcc->handle = handle;
|
dcc->handle = handle;
|
||||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagconn =
|
||||||
(GInputFunction) dcc_chat_listen, dcc);
|
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
|
||||||
|
|
||||||
/* Let's send the reply to the other client! */
|
/* Let's send the reply to the other client! */
|
||||||
dcc_ip2str(&own_ip, host);
|
dcc_ip2str(&own_ip, host);
|
||||||
@ -508,8 +505,7 @@ static void cmd_dcc_chat(const char *data, IRC_SERVER_REC *server)
|
|||||||
|
|
||||||
dcc->handle = handle;
|
dcc->handle = handle;
|
||||||
dcc->tagconn =
|
dcc->tagconn =
|
||||||
g_input_add(dcc->handle, G_INPUT_READ,
|
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_chat_listen, dcc);
|
||||||
(GInputFunction) dcc_chat_listen, dcc);
|
|
||||||
|
|
||||||
/* send the chat request */
|
/* send the chat request */
|
||||||
signal_emit("dcc request send", 1, dcc);
|
signal_emit("dcc request send", 1, dcc);
|
||||||
|
@ -112,9 +112,8 @@ void dcc_get_send_received(GET_DCC_REC *dcc)
|
|||||||
last 1-3 bytes should be sent later. these happen probably
|
last 1-3 bytes should be sent later. these happen probably
|
||||||
never, but I just want to do it right.. :) */
|
never, but I just want to do it right.. :) */
|
||||||
if (dcc->tagwrite == -1) {
|
if (dcc->tagwrite == -1) {
|
||||||
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE,
|
dcc->tagwrite =
|
||||||
(GInputFunction) sig_dccget_send,
|
i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) sig_dccget_send, dcc);
|
||||||
dcc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -285,8 +284,8 @@ void sig_dccget_connected(GET_DCC_REC *dcc)
|
|||||||
dcc_close(DCC(dcc));
|
dcc_close(DCC(dcc));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagread =
|
||||||
(GInputFunction) sig_dccget_receive, dcc);
|
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) sig_dccget_receive, dcc);
|
||||||
signal_emit("dcc connected", 1, dcc);
|
signal_emit("dcc connected", 1, dcc);
|
||||||
|
|
||||||
if (dcc->from_dccserver) {
|
if (dcc->from_dccserver) {
|
||||||
@ -311,11 +310,8 @@ void dcc_get_connect(GET_DCC_REC *dcc)
|
|||||||
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
|
dcc->handle = dcc_connect_ip(&dcc->addr, dcc->port);
|
||||||
|
|
||||||
if (dcc->handle != NULL) {
|
if (dcc->handle != NULL) {
|
||||||
dcc->tagconn =
|
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_WRITE | I_INPUT_READ,
|
||||||
g_input_add(dcc->handle,
|
(GInputFunction) sig_dccget_connected, dcc);
|
||||||
G_INPUT_WRITE | G_INPUT_READ,
|
|
||||||
(GInputFunction) sig_dccget_connected,
|
|
||||||
dcc);
|
|
||||||
} else {
|
} else {
|
||||||
/* error connecting */
|
/* error connecting */
|
||||||
signal_emit("dcc error connect", 1, dcc);
|
signal_emit("dcc error connect", 1, dcc);
|
||||||
@ -344,8 +340,8 @@ static void dcc_get_listen(GET_DCC_REC *dcc)
|
|||||||
net_ip2host(&dcc->addr, dcc->addrstr);
|
net_ip2host(&dcc->addr, dcc->addrstr);
|
||||||
dcc->port = port;
|
dcc->port = port;
|
||||||
|
|
||||||
dcc->tagconn = g_input_add(handle, G_INPUT_READ | G_INPUT_WRITE,
|
dcc->tagconn = i_input_add(handle, I_INPUT_READ | I_INPUT_WRITE,
|
||||||
(GInputFunction) sig_dccget_connected, dcc);
|
(GInputFunction) sig_dccget_connected, dcc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dcc_get_passive(GET_DCC_REC *dcc)
|
void dcc_get_passive(GET_DCC_REC *dcc)
|
||||||
@ -361,8 +357,7 @@ void dcc_get_passive(GET_DCC_REC *dcc)
|
|||||||
cmd_return_error(CMDERR_ERRNO);
|
cmd_return_error(CMDERR_ERRNO);
|
||||||
|
|
||||||
dcc->handle = handle;
|
dcc->handle = handle;
|
||||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagconn = i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_get_listen, dcc);
|
||||||
(GInputFunction) dcc_get_listen, dcc);
|
|
||||||
|
|
||||||
/* Let's send the reply to the other client! */
|
/* Let's send the reply to the other client! */
|
||||||
dcc_ip2str(&own_ip, host);
|
dcc_ip2str(&own_ip, host);
|
||||||
|
@ -336,10 +336,8 @@ static void dcc_send_connected(SEND_DCC_REC *dcc)
|
|||||||
net_ip2host(&dcc->addr, dcc->addrstr);
|
net_ip2host(&dcc->addr, dcc->addrstr);
|
||||||
dcc->port = port;
|
dcc->port = port;
|
||||||
|
|
||||||
dcc->tagread = g_input_add(handle, G_INPUT_READ,
|
dcc->tagread = i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_read_size, dcc);
|
||||||
(GInputFunction) dcc_send_read_size, dcc);
|
dcc->tagwrite = i_input_add(handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
|
||||||
dcc->tagwrite = g_input_add(handle, G_INPUT_WRITE,
|
|
||||||
(GInputFunction) dcc_send_data, dcc);
|
|
||||||
|
|
||||||
signal_emit("dcc connected", 1, dcc);
|
signal_emit("dcc connected", 1, dcc);
|
||||||
}
|
}
|
||||||
@ -352,12 +350,10 @@ static void dcc_send_connect(SEND_DCC_REC *dcc)
|
|||||||
if (dcc->handle != NULL) {
|
if (dcc->handle != NULL) {
|
||||||
dcc->starttime = time(NULL);
|
dcc->starttime = time(NULL);
|
||||||
|
|
||||||
dcc->tagread = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagread = i_input_add(dcc->handle, I_INPUT_READ,
|
||||||
(GInputFunction) dcc_send_read_size,
|
(GInputFunction) dcc_send_read_size, dcc);
|
||||||
dcc);
|
dcc->tagwrite =
|
||||||
dcc->tagwrite = g_input_add(dcc->handle, G_INPUT_WRITE,
|
i_input_add(dcc->handle, I_INPUT_WRITE, (GInputFunction) dcc_send_data, dcc);
|
||||||
(GInputFunction) dcc_send_data,
|
|
||||||
dcc);
|
|
||||||
signal_emit("dcc connected", 1, dcc);
|
signal_emit("dcc connected", 1, dcc);
|
||||||
} else {
|
} else {
|
||||||
/* error connecting */
|
/* error connecting */
|
||||||
@ -436,9 +432,8 @@ static int dcc_send_one_file(int queue, const char *target, const char *fname,
|
|||||||
dcc->queue = queue;
|
dcc->queue = queue;
|
||||||
dcc->file_quoted = strchr(fname, ' ') != NULL;
|
dcc->file_quoted = strchr(fname, ' ') != NULL;
|
||||||
if (!passive) {
|
if (!passive) {
|
||||||
dcc->tagconn = g_input_add(handle, G_INPUT_READ,
|
dcc->tagconn =
|
||||||
(GInputFunction) dcc_send_connected,
|
i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_send_connected, dcc);
|
||||||
dcc);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Generate an ID for this send if using passive protocol */
|
/* Generate an ID for this send if using passive protocol */
|
||||||
|
@ -183,8 +183,8 @@ static void dcc_server_listen(SERVER_DCC_REC *dcc)
|
|||||||
memcpy(&newdcc->addr, &ip, sizeof(IPADDR));
|
memcpy(&newdcc->addr, &ip, sizeof(IPADDR));
|
||||||
net_ip2host(&newdcc->addr, newdcc->addrstr);
|
net_ip2host(&newdcc->addr, newdcc->addrstr);
|
||||||
newdcc->port = port;
|
newdcc->port = port;
|
||||||
newdcc->tagread = g_input_add(handle, G_INPUT_READ,
|
newdcc->tagread =
|
||||||
(GInputFunction) dcc_server_input, newdcc);
|
i_input_add(handle, I_INPUT_READ, (GInputFunction) dcc_server_input, newdcc);
|
||||||
|
|
||||||
signal_emit("dcc connected", 1, newdcc);
|
signal_emit("dcc connected", 1, newdcc);
|
||||||
}
|
}
|
||||||
@ -210,8 +210,8 @@ static void dcc_server_msg(SERVER_DCC_REC *dcc, const char *msg)
|
|||||||
memcpy(&dccchat->addr, &dcc->addr, sizeof(IPADDR));
|
memcpy(&dccchat->addr, &dcc->addr, sizeof(IPADDR));
|
||||||
net_ip2host(&dccchat->addr, dccchat->addrstr);
|
net_ip2host(&dccchat->addr, dccchat->addrstr);
|
||||||
dccchat->port = dcc->port;
|
dccchat->port = dcc->port;
|
||||||
dccchat->tagread = g_input_add(dccchat->handle, G_INPUT_READ,
|
dccchat->tagread = i_input_add(dccchat->handle, I_INPUT_READ,
|
||||||
(GInputFunction) dcc_chat_input, dccchat);
|
(GInputFunction) dcc_chat_input, dccchat);
|
||||||
|
|
||||||
dcc->connection_established = 1;
|
dcc->connection_established = 1;
|
||||||
signal_emit("dcc connected", 1, dccchat);
|
signal_emit("dcc connected", 1, dccchat);
|
||||||
@ -347,8 +347,8 @@ static void cmd_dcc_server(const char *data, IRC_SERVER_REC *server)
|
|||||||
dcc = dcc_server_create(server, flags);
|
dcc = dcc_server_create(server, flags);
|
||||||
dcc->handle = handle;
|
dcc->handle = handle;
|
||||||
dcc->port = atoi(port);
|
dcc->port = atoi(port);
|
||||||
dcc->tagconn = g_input_add(dcc->handle, G_INPUT_READ,
|
dcc->tagconn =
|
||||||
(GInputFunction) dcc_server_listen, dcc);
|
i_input_add(dcc->handle, I_INPUT_READ, (GInputFunction) dcc_server_listen, dcc);
|
||||||
|
|
||||||
signal_emit("dcc server started", 1, dcc);
|
signal_emit("dcc server started", 1, dcc);
|
||||||
|
|
||||||
|
@ -470,8 +470,7 @@ static void sig_listen(LISTEN_REC *listen)
|
|||||||
rec->server = servers == NULL ? NULL :
|
rec->server = servers == NULL ? NULL :
|
||||||
IRC_SERVER(server_find_chatnet(listen->ircnet));
|
IRC_SERVER(server_find_chatnet(listen->ircnet));
|
||||||
}
|
}
|
||||||
rec->recv_tag = g_input_add(handle, G_INPUT_READ,
|
rec->recv_tag = i_input_add(handle, I_INPUT_READ, (GInputFunction) sig_listen_client, rec);
|
||||||
(GInputFunction) sig_listen_client, rec);
|
|
||||||
|
|
||||||
proxy_clients = g_slist_prepend(proxy_clients, rec);
|
proxy_clients = g_slist_prepend(proxy_clients, rec);
|
||||||
listen->clients = g_slist_prepend(listen->clients, rec);
|
listen->clients = g_slist_prepend(listen->clients, rec);
|
||||||
@ -739,8 +738,7 @@ static void add_listen(const char *ircnet, int port, const char *port_or_path)
|
|||||||
rec->port = port;
|
rec->port = port;
|
||||||
rec->port_or_path = g_strdup(port_or_path);
|
rec->port_or_path = g_strdup(port_or_path);
|
||||||
|
|
||||||
rec->tag = g_input_add(rec->handle, G_INPUT_READ,
|
rec->tag = i_input_add(rec->handle, I_INPUT_READ, (GInputFunction) sig_listen, rec);
|
||||||
(GInputFunction) sig_listen, rec);
|
|
||||||
|
|
||||||
proxy_listens = g_slist_append(proxy_listens, rec);
|
proxy_listens = g_slist_append(proxy_listens, rec);
|
||||||
}
|
}
|
||||||
|
@ -252,7 +252,8 @@ void key_gen_run(struct otr_user_state *ustate, const char *account_name)
|
|||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
/* Parent process */
|
/* Parent process */
|
||||||
pidwait_add(pid);
|
pidwait_add(pid);
|
||||||
worker->tag = g_input_add(worker->pipes[0], G_INPUT_READ, (GInputFunction)read_key_gen_status, worker);
|
worker->tag = i_input_add(worker->pipes[0], I_INPUT_READ,
|
||||||
|
(GInputFunction) read_key_gen_status, worker);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -258,14 +258,14 @@ CODE:
|
|||||||
int
|
int
|
||||||
INPUT_READ()
|
INPUT_READ()
|
||||||
CODE:
|
CODE:
|
||||||
RETVAL = G_INPUT_READ;
|
RETVAL = I_INPUT_READ;
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
int
|
int
|
||||||
INPUT_WRITE()
|
INPUT_WRITE()
|
||||||
CODE:
|
CODE:
|
||||||
RETVAL = G_INPUT_WRITE;
|
RETVAL = I_INPUT_WRITE;
|
||||||
OUTPUT:
|
OUTPUT:
|
||||||
RETVAL
|
RETVAL
|
||||||
|
|
||||||
|
@ -139,8 +139,8 @@ int perl_input_add(int source, int condition, SV *func, SV *data, int once)
|
|||||||
rec->func = perl_func_sv_inc(func, pkg);
|
rec->func = perl_func_sv_inc(func, pkg);
|
||||||
rec->data = SvREFCNT_inc(data);
|
rec->data = SvREFCNT_inc(data);
|
||||||
|
|
||||||
rec->tag = g_input_add_poll(source, G_PRIORITY_DEFAULT, condition,
|
rec->tag = i_input_add_poll(source, G_PRIORITY_DEFAULT, condition,
|
||||||
(GInputFunction) perl_source_event, rec);
|
(GInputFunction) perl_source_event, rec);
|
||||||
|
|
||||||
perl_sources = g_slist_append(perl_sources, rec);
|
perl_sources = g_slist_append(perl_sources, rec);
|
||||||
return rec->tag;
|
return rec->tag;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user