#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/queue.h>
#include <errno.h>
#include <bsd/string.h>
#include <cne_common.h>
Go to the source code of this file.
Event monitoring Helpers in CNE
Definition in file cne_event.h.
◆ cne_ev_callback_fn
typedef void(* cne_ev_callback_fn) (void *cb_arg) |
Function to be registered for the specific interrupt
- Parameters
-
cb_arg | address of parameter for callback. |
Definition at line 45 of file cne_event.h.
◆ cne_ev_unregister_callback_fn
typedef void(* cne_ev_unregister_callback_fn) (struct cne_ev_handle *ev_handle, void *cb_arg) |
Function to call after a callback is unregistered. Can be used to close fd and free cb_arg.
- Parameters
-
ev_handle | Pointer to the event handle. |
cb_arg | address of parameter for callback. |
Definition at line 56 of file cne_event.h.
◆ cne_ev_callback_register()
It registers the callback for the specific event. Multiple callbacks can be registered at the same time.
- Parameters
-
ev_handle | Pointer to the event handle. |
cb_fn | callback address. |
cb_arg | address of parameter for callback. |
- Returns
- On success, zero.
- On failure, a negative value.
◆ cne_ev_callback_unregister()
It unregisters the callback for the specific event. Multiple callbacks can be registered at the same time.
- Parameters
-
ev_handle | Pointer to the event handle. |
cb_fn | callback address. |
cb_arg | address of parameter for callback. |
- Returns
- On success, zero.
- On failure, a negative value.
◆ cne_ev_callback_unregister_pending()
Unregister the callback according to the specified event handle, after it's no longer active. Fail if source is not active.
- Parameters
-
ev_handle | pointer to the event handle. |
cb_fn | callback address. |
cb_arg | address of parameter for callback, (void *)-1 means to remove all registered which has the same callback address. |
ucb_fn | callback to call before cb is unregistered (optional). can be used to close fd and free cb_arg. |
- Returns
- On success, return the number of callback entities marked for remove.
- On failure, a negative value.