Add io_context argument to the callback

This commit is contained in:
2024-04-13 00:33:36 +02:00
parent 9dd8341dbc
commit e46c5a1042
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -1017,7 +1017,7 @@ void io_wait(struct io_context *ioc,
if (res->callback == NULL) if (res->callback == NULL)
break; break;
res->callback(*ev); res->callback(ioc, *ev);
} }
} }
+4 -2
View File
@@ -81,14 +81,16 @@ struct io_event {
}; };
}; };
struct io_context;
typedef void (*io_callback)(struct io_context *ioc, struct io_event);
enum io_restype { enum io_restype {
IO_RES_VOID, IO_RES_VOID,
IO_RES_FILE, IO_RES_FILE,
IO_RES_SOCKET, IO_RES_SOCKET,
}; };
typedef void (*io_callback)(struct io_event);
struct io_resource { struct io_resource {
enum io_restype type; enum io_restype type;
io_os_handle os_handle; io_os_handle os_handle;