summaryrefslogtreecommitdiffstats
path: root/common/elapi/elapi_async.h
diff options
context:
space:
mode:
authorDmitri Pal <dpal@redhat.com>2009-08-07 15:50:34 -0400
committerStephen Gallagher <sgallagh@redhat.com>2009-08-12 12:24:27 -0400
commit1771d32e945b758326951384f0e17121042ad74e (patch)
tree070df00bcb1e049a1bdf794922b9b970479942a8 /common/elapi/elapi_async.h
parentd59ba3139bba2d28c1209f62c01a7017c26dd635 (diff)
downloadsssd-1771d32e945b758326951384f0e17121042ad74e.tar.gz
sssd-1771d32e945b758326951384f0e17121042ad74e.tar.xz
sssd-1771d32e945b758326951384f0e17121042ad74e.zip
ELAPI Next round of functionality - logging part of the interface
a) Added the main logging interface which allows creating dispatcher and logging messages or events. Can't actully log anything yet since the sinks are stubbed out. b) Made default template be a part of the default dispatcher. c) Updated UNIT test. d) Some of the calls are stubbed out but they are there to indicate where next round of work will be.
Diffstat (limited to 'common/elapi/elapi_async.h')
-rw-r--r--common/elapi/elapi_async.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/common/elapi/elapi_async.h b/common/elapi/elapi_async.h
new file mode 100644
index 000000000..24cb7f8bc
--- /dev/null
+++ b/common/elapi/elapi_async.h
@@ -0,0 +1,72 @@
+/*
+ ELAPI
+
+ Header file for the ELAPI async processing interface.
+
+ Copyright (C) Dmitri Pal <dpal@redhat.com> 2009
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef ELAPI_ASYNC_H
+#define ELAPI_ASYNC_H
+
+#include <sys/time.h>
+
+/* Signature ELAPI callback function that
+ * should be called when the event loop got an event on the
+ * socket or file descriptor.
+ * ELAPI will always try to write to sockets in async way
+ * if the sink has this capability.
+ * So this is the callback that will always be
+ * invoked when we get ACK from the process receiving events.
+ */
+typedef int (*elapi_fd_callback)(int fd, /* File descriptor */
+ void *elapi_data); /* ELAPI supplied data */
+
+/* Signature ELAPI callback function that
+ * should be called when the event loop got a timer driven event.
+ */
+typedef int (*elapi_timer_callback)(void *elapi_data); /* ELAPI supplied data */
+
+/* Signature of the supplied by caller function that ELAPI
+ * will call to add the fd into the application event processing loop.
+ */
+typedef int (*elapi_add_fd)(int fd, /* File descriptor to add */
+ void *callers_data, /* Data that the function
+ * would need to do its work */
+ elapi_fd_callback handle, /* Callback to call when event happens */
+ void *elapi_data); /* Data to pass to the callback */
+
+/* Signature of the supplied by caller function that ELAPI
+ * will call to remove the fd from the application event processing loop.
+ * The implementation of the function should assume that
+ * ELAPI will close file/socket descriptor after colling this function.
+ */
+typedef int (*elapi_rem_fd)(int fd, /* File descriptor to add */
+ void *callers_data); /* Data that the function
+ * would need to do its work */
+
+/* Signature of the supplied by caller function that ELAPI
+ * will call to add a new timer event to the application event processing loop.
+ */
+typedef int (*elapi_add_timer)(struct timeval timer, /* Timer */
+ void *callers_data, /* Data that the function
+ * would need to do its work */
+ elapi_timer_callback handle, /* Callback to call when event happens */
+ void *elapi_data); /* Data to pass to the callback */
+
+
+
+
+
+#endif