s/_func/_fn/

This commit is contained in:
Přemysl Eric Janouch 2014-09-19 01:08:18 +02:00
parent 21e75ebd55
commit d4c60dc105
3 changed files with 16 additions and 16 deletions

View File

@ -595,7 +595,7 @@ struct str_map_iter
#define STR_MAP_MIN_ALLOC 16 #define STR_MAP_MIN_ALLOC 16
typedef void (*str_map_free_func) (void *); typedef void (*str_map_free_fn) (void *);
static void static void
str_map_init (struct str_map *self) 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 // 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. // 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_dispatcher_fn) (const struct pollfd *, void *);
typedef void (*poller_timer_func) (void *); typedef void (*poller_timer_fn) (void *);
#define POLLER_MIN_ALLOC 16 #define POLLER_MIN_ALLOC 16
struct poller_timer_info struct poller_timer_info
{ {
int64_t when; ///< When is the timer to expire 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 void *user_data; ///< User data
}; };
@ -951,7 +951,7 @@ poller_timers_heapify_up (struct poller_timers *self, size_t index)
static ssize_t static ssize_t
poller_timers_find (struct poller_timers *self, poller_timers_find (struct poller_timers *self,
poller_timer_func dispatcher, void *data) poller_timer_fn dispatcher, void *data)
{ {
// NOTE: there may be duplicates. // NOTE: there may be duplicates.
for (size_t i = 0; i < self->len; i++) 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 static void
poller_timers_add (struct poller_timers *self, 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) if (self->len == self->alloc)
self->info = xreallocarray (self->info, self->info = xreallocarray (self->info,
@ -1008,7 +1008,7 @@ struct poller_info
{ {
int fd; ///< Our file descriptor int fd; ///< Our file descriptor
short events; ///< The poll() events we registered for 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 void *user_data; ///< User data
}; };
@ -1115,7 +1115,7 @@ poller_poll_to_epoll_events (short events)
static void static void
poller_set (struct poller *self, int fd, short events, 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); ssize_t index = poller_find_by_fd (self, fd);
bool modifying = true; bool modifying = true;

8
kike.c
View File

@ -864,7 +864,7 @@ client_cancel_timers (struct client *c)
} }
static void 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); client_cancel_timers (c);
poller_timers_add (&c->ctx->poller.timers, fn, c, interval * 1000); 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); hard_assert (new_events != 0);
if (!pfd || pfd->events != new_events) if (!pfd || pfd->events != new_events)
poller_set (&c->ctx->poller, c->socket_fd, 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 static void
@ -2988,7 +2988,7 @@ irc_listen_resolve (struct server_context *ctx,
ctx->listen_fds[ctx->n_listen_fds++] = fd; ctx->listen_fds[ctx->n_listen_fds++] = fd;
set_blocking (fd, false); set_blocking (fd, false);
poller_set (&ctx->poller, fd, POLLIN, poller_set (&ctx->poller, fd, POLLIN,
(poller_dispatcher_func) on_irc_client_available, ctx); (poller_dispatcher_fn) on_irc_client_available, ctx);
break; break;
} }
freeaddrinfo (gai_result); freeaddrinfo (gai_result);
@ -3150,7 +3150,7 @@ main (int argc, char *argv[])
} }
poller_set (&ctx.poller, g_signal_pipe[0], POLLIN, 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) if (!irc_initialize_ssl (&ctx, &e)
|| !irc_initialize_server_name (&ctx, &e) || !irc_initialize_server_name (&ctx, &e)

View File

@ -1151,7 +1151,7 @@ plugin_queue_write (struct plugin_data *plugin)
} }
poller_set (&plugin->ctx->poller, plugin->write_fd, POLLOUT, 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 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); str_map_set (&ctx->plugins_by_name, name, plugin);
poller_set (&ctx->poller, stdout_pipe[0], POLLIN, poller_set (&ctx->poller, stdout_pipe[0], POLLIN,
(poller_dispatcher_func) on_plugin_readable, plugin); (poller_dispatcher_fn) on_plugin_readable, plugin);
return true; return true;
fail_3: 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 */; } // (struct linger) { .l_onoff = true; .l_linger = 1 /* 1s should do */; }
// 3/ /* O_CLOEXEC */ But only if the QUIT message proves unreliable. // 3/ /* O_CLOEXEC */ But only if the QUIT message proves unreliable.
poller_set (&ctx->poller, ctx->irc_fd, POLLIN, 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_reset_connection_timeouts (ctx);
irc_send (ctx, "NICK %s", nickname); irc_send (ctx, "NICK %s", nickname);
@ -2232,7 +2232,7 @@ main (int argc, char *argv[])
setup_recovery_handler (&ctx); setup_recovery_handler (&ctx);
poller_set (&ctx.poller, g_signal_pipe[0], POLLIN, 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); plugin_load_all_from_config (&ctx);
if (!parse_config (&ctx, &e) if (!parse_config (&ctx, &e)