ipc-group.c revision 4ee00532a265bdfb38539d811fcd12d51210ac35
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher/* Copyright (c) 2011-2012 Dovecot authors, see the included COPYING file */
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozekstruct ipc_group *ipc_group_alloc(int listen_fd)
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher i_assert(ipc_group_lookup_listen_fd(listen_fd) == NULL);
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozek struct ipc_group *const *groups, *group = *_group;
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozek unsigned int i, count;
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher for (i = 0; i < count; i++) {
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozekstruct ipc_group *ipc_group_lookup_listen_fd(int listen_fd)
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherstruct ipc_group *ipc_group_lookup_name(const char *name)
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozekint ipc_group_update_name(struct ipc_group *group, const char *name)
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherstatic void ipc_group_cmd_callback(enum ipc_cmd_status status,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher struct ipc_group_cmd *group_cmd = context;
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher group_cmd->callback(IPC_CMD_STATUS_REPLY, line,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher /* fall through */
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher group_cmd->callback(IPC_CMD_STATUS_OK, line,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherbool ipc_group_cmd(struct ipc_group *group, const char *cmd,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ipc_cmd_callback_t *callback, void *context)
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher callback(IPC_CMD_STATUS_OK, NULL, context);
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher group_cmd = i_new(struct ipc_group_cmd, 1);
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher for (conn = group->connections; conn != NULL; conn = next) {