yev_create_inotify_event()

yev_create_inotify_event()#

yev_create_inotify_event() creates a new inotify event within the specified event loop, associating it with a callback function and a given object.

Prototype

yev_event_h yev_create_inotify_event(
    yev_loop_h      yev_loop,
    yev_callback_t  callback,  // if return -1 the loop in yev_loop_run will break;
    hgobj           gobj,
    int            fd,
    gbuffer_t *    gbuf
);

Parameters

Key

Type

Description

yev_loop

yev_loop_h

The event loop handle in which the inotify event will be created.

callback

yev_callback_t

The function to be called when the event is triggered. If it returns -1, yev_loop_run() will break.

gobj

hgobj

The associated object that will handle the event.

fd

int

The file descriptor associated with the inotify event.

gbuf

gbuffer_t *

A buffer for storing event-related data.


Return Value

Returns a yev_event_h handle to the newly created inotify event, or NULL on failure.

Notes

The callback function provided will be invoked when the inotify event is triggered. Ensure that the file descriptor fd is valid and properly initialized before calling yev_create_inotify_event().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples