From 1ea6bd0f466a10d29f12801aa35fb6d2b30443a1 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Wed, 27 Jul 2016 15:51:01 +0200 Subject: Expose use of the event loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use of the event loop where previously hidden in internal deep places of the websocket modules. This commits enforce the client of the library to explicitely tell what event loop must be used. This has 3 effects: - you know that the systemd event loop is used - you tell the event loop to use (no confusion) - you don't depend on afb-common.c Change-Id: Id13d8a96f981183c299cde414d9bb0cd77fe3daa Signed-off-by: José Bollo --- src/afb-wsj1.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/afb-wsj1.h') diff --git a/src/afb-wsj1.h b/src/afb-wsj1.h index 49b77828..1f433483 100644 --- a/src/afb-wsj1.h +++ b/src/afb-wsj1.h @@ -21,6 +21,7 @@ struct afb_wsj1; struct afb_wsj1_msg; struct json_object; +struct sd_event; /* * Interface for callback functions. @@ -49,9 +50,11 @@ struct afb_wsj1_itf { /* * Creates the afb_wsj1 socket connected to the file descriptor 'fd' * and having the callback interface defined by 'itf' for the 'closure'. + * When the creation is a success, the systemd event loop 'eloop' is + * used for handling event for 'fd'. * Returns the created wsj1 websocket or NULL in case of error. */ -extern struct afb_wsj1 *afb_wsj1_create(int fd, struct afb_wsj1_itf *itf, void *closure); +extern struct afb_wsj1 *afb_wsj1_create(struct sd_event *eloop, int fd, struct afb_wsj1_itf *itf, void *closure); /* * Increases by one the count of reference to 'wsj1' -- cgit 1.2.3-korg