From a03520525ad4839861fc9fac2f07904937e77067 Mon Sep 17 00:00:00 2001 From: hiddenalpha.ch Date: Wed, 23 Sep 2026 22:37:36 +0200 Subject: reFormat to help YCM. --- include/qntan/Qntan.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/qntan') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index f89f008..1fc5cab 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -428,8 +428,8 @@ struct Qntan_IoMux { * file/socket types in use. High-level modules SHOULD NOT use this type * directly. */ - void (*read)( - struct Qntan_IoMux**, void*buf, int sz, int cnt, uintptr_t ptrToFILE, + void (*read)( struct Qntan_IoMux**, + void*buf, int sz, int cnt, uintptr_t ptrToFILE, void(*onDone)(int ret,Qntan_Cls), Qntan_Cls ); /* Basic idea is from * "https://pubs.opengroup.org/onlinepubs/009695399/functions/fread.html". @@ -515,8 +515,8 @@ struct Qntan_IoMux { * @param arg * User defined pointer to pass a context to 'onDone'. */ - void (*accept)( - struct Qntan_IoMux**, uintptr_t sockFd, int flgs, + void (*accept)( struct Qntan_IoMux**, + uintptr_t sockFd, int flgs, void(*onDone)(int ret, uintptr_t newClientFd, void*sockaddr, int sockaddr_len, Qntan_Cls), Qntan_Cls ); /* Basic idea is from @@ -709,8 +709,8 @@ struct Qntan_File { * Negative numbers indicate errors. Positive values indicate * number of objects that where read. */ - void (*read)( - struct Qntan_File**, void*buf, int sz, int cnt, + void (*read)( struct Qntan_File**, + void*buf, int sz, int cnt, void(*onDone)(int ret,Qntan_Cls), Qntan_Cls ); /* Basic idea is from * "https://pubs.opengroup.org/onlinepubs/009695399/functions/recv.html". -- cgit v1.3.1 From b5afa8ffae12f5681cfc1c7dbf8f5510ea56b503 Mon Sep 17 00:00:00 2001 From: hiddenalpha.ch Date: Fri, 2 Oct 2026 00:15:09 +0200 Subject: Make `EvLoop` better compatible with `Executor`. --- include/qntan/Qntan.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/qntan') diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index 1fc5cab..bb19954 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -146,6 +146,11 @@ struct Qntan_EvLoop { struct Qntan_EvLoop**, void(*fn)(Qntan_Cls), Qntan_Cls ); /* enque a task to the EvLoop. See also Qntan_ThreadPool.enque(). */ + int (*isMyThread)( struct Qntan_EvLoop** ); + /* returns positive, if calling thread belongs to this EventLoop. + * Zero if not. Negative values are reserved. + * (idea is to have the same method as an `Executor` has) + */ void (*addAwaitToken)( struct Qntan_EvLoop** ); /* TODO write doc */ @@ -162,6 +167,7 @@ struct Qntan_EvLoop { int (*isEvLoopThread)( struct Qntan_EvLoop** ); /* returns NON-zero, if called from the EvLoopThread. This is intended for * assertions, to check that one is running on the expected thread. + * TODO: OBSOLETE, use `isMyThread()` */ }; @@ -252,6 +258,10 @@ struct Qntan_Executor { * executor instance got chosen. This also includes stuff like ThreadPools * which may execute stuff out of order. */ + int (*isMyThread)( struct Qntan_Executor** ); + /* returns positive, if calling thread belongs to this executor. + * Zero if not. Negative values are reserved. + */ }; -- cgit v1.3.1