view src/lib/ioloop-notify-fd.h @ 14629:c93ca5e46a8a

Marked functions parameters that are allowed to be NULL. Some APIs were also changed. The non-obvious APIs where NULL parameter was changed to "" are master_service_init() and auth_master_user_list_init(). These checks can currently be enabled only on a patched clang: http://llvm.org/bugs/show_bug.cgi?id=6786
author Timo Sirainen <tss@iki.fi>
date Sun, 24 Jun 2012 00:52:57 +0300
parents e4eb71ae8e96
children
line wrap: on
line source

#ifndef IOLOOP_NOTIFY_FD_H
#define IOLOOP_NOTIFY_FD_H

/* common notify code for fd-based notifications (dnotify, inotify) */

struct io_notify {
	struct io io;

	/* use a doubly linked list so that io_remove() is quick */
	struct io_notify *prev, *next;

	int fd;
};

struct ioloop_notify_fd_context {
	struct io_notify *notifies;
};

struct io *
io_notify_fd_add(struct ioloop_notify_fd_context *ctx, int fd,
		 io_callback_t *callback, void *context) ATTR_NULL(4);
void io_notify_fd_free(struct ioloop_notify_fd_context *ctx,
		       struct io_notify *io);

struct io_notify *
io_notify_fd_find(struct ioloop_notify_fd_context *ctx, int fd);

#endif