From: nishi Date: Sat, 27 Jan 2024 01:33:03 +0000 (+0000) Subject: event handler X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=929c4f7ede3f3eb287a0023b10cfd300da1c4ba1;p=libw3.git event handler git-svn-id: file:///raid/svn-main/nishi-libw3/trunk@104 d27a3e52-49c5-7645-884c-6793ebffc270 --- diff --git a/Library/POP3.c b/Library/POP3.c index ff5c9ae..0c15f5f 100644 --- a/Library/POP3.c +++ b/Library/POP3.c @@ -46,6 +46,11 @@ void __W3_POP3_Request(struct W3* w3) { if(login == 2){ /* Login success */ login = 3; + void* funcptr = __W3_Get_Event(w3, "login"); + if(funcptr != NULL){ + void(*func)(struct W3*, const char*) = (void(*)(struct W3*, int))funcptr; + func(w3, 512); + } __W3_Debug("LibW3-POP3", "Login successful"); }else{ } @@ -53,7 +58,13 @@ void __W3_POP3_Request(struct W3* w3) { /* ERR */ if(login == 2){ /* Login failed */ + void* funcptr = __W3_Get_Event(w3, "error"); + if(funcptr != NULL){ + void(*func)(struct W3*, const char*) = (void(*)(struct W3*, const char*))funcptr; + func(w3, "login-fail"); + } login = 0; + return; }else{ } }