aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2014-09-19 01:08:18 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2014-09-19 01:08:18 +0200
commitd4c60dc105e4f4a29873f4666a6c92541edb13eb (patch)
treecd529248882365a625486f74008177f47ce3597f
parent21e75ebd552a582bbc4c9a58bc00fd2d321bb637 (diff)
downloadxK-d4c60dc105e4f4a29873f4666a6c92541edb13eb.tar.gz
xK-d4c60dc105e4f4a29873f4666a6c92541edb13eb.tar.xz
xK-d4c60dc105e4f4a29873f4666a6c92541edb13eb.zip
s/_func/_fn/
-rw-r--r--common.c16
-rw-r--r--kike.c8
-rw-r--r--zyklonb.c8
3 files changed, 16 insertions, 16 deletions
diff --git a/common.c b/common.c
index f06fc96..c9d790d 100644
--- a/common.c
+++ b/common.c
@@ -595,7 +595,7 @@ struct str_map_iter
#define STR_MAP_MIN_ALLOC 16
-typedef void (*str_map_free_func) (void *);
+typedef void (*str_map_free_fn) (void *);
static void
str_map_init (struct str_map *self)
@@ -834,15 +834,15 @@ xclose (int fd)
// I don't expect this to be much of an issue, as there are typically not going
// to be that many FD's to watch, and the linear approach is cache-friendly.
-typedef void (*poller_dispatcher_func) (const struct pollfd *, void *);
-typedef void (*poller_timer_func) (void *);
+typedef void (*poller_dispatcher_fn) (const struct pollfd *, void *);
+typedef void (*poller_timer_fn) (void *);
#define POLLER_MIN_ALLOC 16
struct poller_timer_info
{
int64_t when; ///< When is the timer to expire
- poller_timer_func dispatcher; ///< Event dispatcher
+ poller_timer_fn dispatcher; ///< Event dispatcher
void *user_data; ///< User data
};
@@ -951,7 +951,7 @@ poller_timers_heapify_up (struct poller_timers *self, size_t index)
static ssize_t
poller_timers_find (struct poller_timers *self,
- poller_timer_func dispatcher, void *data)
+ poller_timer_fn dispatcher, void *data)
{
// NOTE: there may be duplicates.
for (size_t i = 0; i < self->len; i++)
@@ -972,7 +972,7 @@ poller_timers_find_by_data (struct poller_timers *self, void *data)
static void
poller_timers_add (struct poller_timers *self,
- poller_timer_func dispatcher, void *data, int timeout_ms)
+ poller_timer_fn dispatcher, void *data, int timeout_ms)
{
if (self->len == self->alloc)
self->info = xreallocarray (self->info,
@@ -1008,7 +1008,7 @@ struct poller_info
{
int fd; ///< Our file descriptor
short events; ///< The poll() events we registered for
- poller_dispatcher_func dispatcher; ///< Event dispatcher
+ poller_dispatcher_fn dispatcher; ///< Event dispatcher
void *user_data; ///< User data
};
@@ -1115,7 +1115,7 @@ poller_poll_to_epoll_events (short events)
static void
poller_set (struct poller *self, int fd, short events,
- poller_dispatcher_func dispatcher, void *data)
+ poller_dispatcher_fn dispatcher, void *data)
{
ssize_t index = poller_find_by_fd (self, fd);
bool modifying = true;
diff --git a/kike.c b/kike.c
index 2a05ead..76c7143 100644
--- a/kike.c
+++ b/kike.c
@@ -864,7 +864,7 @@ client_cancel_timers (struct client *c)
}
static void
-client_set_timer (struct client *c, poller_timer_func fn, unsigned interval)
+client_set_timer (struct client *c, poller_timer_fn fn, unsigned interval)
{
client_cancel_timers (c);
poller_timers_add (&c->ctx->poller.timers, fn, c, interval * 1000);
@@ -2627,7 +2627,7 @@ client_update_poller (struct client *c, const struct pollfd *pfd)
hard_assert (new_events != 0);
if (!pfd || pfd->events != new_events)
poller_set (&c->ctx->poller, c->socket_fd, new_events,
- (poller_dispatcher_func) on_client_ready, c);
+ (poller_dispatcher_fn) on_client_ready, c);
}
static void
@@ -2988,7 +2988,7 @@ irc_listen_resolve (struct server_context *ctx,
ctx->listen_fds[ctx->n_listen_fds++] = fd;
set_blocking (fd, false);
poller_set (&ctx->poller, fd, POLLIN,
- (poller_dispatcher_func) on_irc_client_available, ctx);
+ (poller_dispatcher_fn) on_irc_client_available, ctx);
break;
}
freeaddrinfo (gai_result);
@@ -3150,7 +3150,7 @@ main (int argc, char *argv[])
}
poller_set (&ctx.poller, g_signal_pipe[0], POLLIN,
- (poller_dispatcher_func) on_signal_pipe_readable, &ctx);
+ (poller_dispatcher_fn) on_signal_pipe_readable, &ctx);
if (!irc_initialize_ssl (&ctx, &e)
|| !irc_initialize_server_name (&ctx, &e)
diff --git a/zyklonb.c b/zyklonb.c
index 8f8bcda..ef7b8a6 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -1151,7 +1151,7 @@ plugin_queue_write (struct plugin_data *plugin)
}
poller_set (&plugin->ctx->poller, plugin->write_fd, POLLOUT,
- (poller_dispatcher_func) on_plugin_writable, plugin);
+ (poller_dispatcher_fn) on_plugin_writable, plugin);
}
static void
@@ -1417,7 +1417,7 @@ plugin_load (struct bot_context *ctx, const char *name, struct error **e)
str_map_set (&ctx->plugins_by_name, name, plugin);
poller_set (&ctx->poller, stdout_pipe[0], POLLIN,
- (poller_dispatcher_func) on_plugin_readable, plugin);
+ (poller_dispatcher_fn) on_plugin_readable, plugin);
return true;
fail_3:
@@ -2031,7 +2031,7 @@ irc_connect (struct bot_context *ctx, struct error **e)
// (struct linger) { .l_onoff = true; .l_linger = 1 /* 1s should do */; }
// 3/ /* O_CLOEXEC */ But only if the QUIT message proves unreliable.
poller_set (&ctx->poller, ctx->irc_fd, POLLIN,
- (poller_dispatcher_func) on_irc_readable, ctx);
+ (poller_dispatcher_fn) on_irc_readable, ctx);
irc_reset_connection_timeouts (ctx);
irc_send (ctx, "NICK %s", nickname);
@@ -2232,7 +2232,7 @@ main (int argc, char *argv[])
setup_recovery_handler (&ctx);
poller_set (&ctx.poller, g_signal_pipe[0], POLLIN,
- (poller_dispatcher_func) on_signal_pipe_readable, &ctx);
+ (poller_dispatcher_fn) on_signal_pipe_readable, &ctx);
plugin_load_all_from_config (&ctx);
if (!parse_config (&ctx, &e)