@@ -1891,7 +1891,7 @@ size_t webui_bind(size_t window, const char* element, void(*func)(webui_event_t*
1891
1891
win -> has_all_events = true;
1892
1892
win -> cb [index ] = func ;
1893
1893
#ifdef WEBUI_LOG
1894
- printf ("[User] webui_bind() -> Save bind (all events) at %zu\n" , index );
1894
+ printf ("[User] webui_bind() -> Save bind (all events) index %zu, address 0x%p \n" , index , func );
1895
1895
#endif
1896
1896
}
1897
1897
return index ;
@@ -1902,7 +1902,7 @@ size_t webui_bind(size_t window, const char* element, void(*func)(webui_event_t*
1902
1902
if (func != NULL ) {
1903
1903
win -> cb [index ] = func ;
1904
1904
#ifdef WEBUI_LOG
1905
- printf ("[User] webui_bind() -> Save bind at %zu\n" , index );
1905
+ printf ("[User] webui_bind() -> Save bind index %zu, address 0x%p \n" , index , func );
1906
1906
#endif
1907
1907
1908
1908
// Send to all connected clients the new binding ID
@@ -3761,7 +3761,7 @@ static void _webui_interface_bind_handler_all(webui_event_t* e) {
3761
3761
#endif
3762
3762
// Call all-events cb
3763
3763
#ifdef WEBUI_LOG
3764
- printf ("[Core]\t\t_webui_interface_bind_handler_all() -> Calling user all-events callback\n[Call]\n" );
3764
+ printf ("[Core]\t\t_webui_interface_bind_handler_all() -> Calling user all-events callback at address 0x%p \n[Call]\n" , win -> cb_interface [ events_cb_index ] );
3765
3765
#endif
3766
3766
win -> cb_interface [events_cb_index ](e -> window , e -> event_type , e -> element , e -> event_number , e -> bind_id );
3767
3767
}
@@ -3799,7 +3799,7 @@ static void _webui_interface_bind_handler(webui_event_t* e) {
3799
3799
#endif
3800
3800
// Call cb
3801
3801
#ifdef WEBUI_LOG
3802
- printf ("[Core]\t\t_webui_interface_bind_handler() -> Calling user callback\n[Call]\n" );
3802
+ printf ("[Core]\t\t_webui_interface_bind_handler() -> Calling user callback at address 0x%p \n[Call]\n" , win -> cb_interface [ cb_index ] );
3803
3803
#endif
3804
3804
win -> cb_interface [cb_index ](e -> window , e -> event_type , e -> element , e -> event_number , e -> bind_id );
3805
3805
}
@@ -3811,6 +3811,9 @@ static void _webui_interface_bind_handler(webui_event_t* e) {
3811
3811
3812
3812
// Async response wait
3813
3813
if (_webui .config .asynchronous_response ) {
3814
+ #ifdef WEBUI_LOG
3815
+ printf ("[Core]\t\t_webui_interface_bind_handler() -> Waiting for asynchronous response...\n" );
3816
+ #endif
3814
3817
bool done = false;
3815
3818
while (!done ) {
3816
3819
_webui_sleep (10 );
@@ -4020,7 +4023,7 @@ void webui_interface_set_response_file_handler(size_t window, const void* respon
4020
4023
bool webui_interface_is_app_running (void ) {
4021
4024
4022
4025
#ifdef WEBUI_LOG
4023
- // printf("[User] webui_is_app_running ()\n");
4026
+ // printf("[User] webui_interface_is_app_running ()\n");
4024
4027
#endif
4025
4028
4026
4029
// Stop if already flagged
@@ -4041,7 +4044,7 @@ bool webui_interface_is_app_running(void) {
4041
4044
4042
4045
#ifdef WEBUI_LOG
4043
4046
if (!app_is_running )
4044
- printf ("[User] webui_is_app_running () -> App Stopped\n" );
4047
+ printf ("[User] webui_interface_is_app_running () -> App Stopped\n" );
4045
4048
#endif
4046
4049
4047
4050
return app_is_running ;
@@ -4851,7 +4854,8 @@ static int _webui_external_file_handler(_webui_window_t* win, struct mg_connecti
4851
4854
// Files handler callback
4852
4855
#ifdef WEBUI_LOG
4853
4856
printf ("[Core]\t\t_webui_external_file_handler() -> Path [%s]\n" , url );
4854
- printf ("[Core]\t\t_webui_external_file_handler() -> Calling custom files handler callback\n" );
4857
+ printf ("[Core]\t\t_webui_external_file_handler() -> Calling custom files handler callback at address 0x%p\n" ,
4858
+ (win -> files_handler_window != NULL ? win -> files_handler_window : win -> files_handler ));
4855
4859
printf ("[Call]\n" );
4856
4860
#endif
4857
4861
@@ -4874,6 +4878,9 @@ static int _webui_external_file_handler(_webui_window_t* win, struct mg_connecti
4874
4878
if (_webui .config .asynchronous_response ) {
4875
4879
// `callback_resp` is NULL now, we need to
4876
4880
// wait for the response that will come later.
4881
+ #ifdef WEBUI_LOG
4882
+ printf ("[Core]\t\t_webui_external_file_handler() -> Waiting for asynchronous response...\n" );
4883
+ #endif
4877
4884
bool done = false;
4878
4885
while (!done ) {
4879
4886
_webui_sleep (10 );
@@ -8393,7 +8400,7 @@ static void _webui_window_event(
8393
8400
if (exist && win -> cb [events_cb_index ] != NULL ) {
8394
8401
// Call user all-events cb
8395
8402
#ifdef WEBUI_LOG
8396
- printf ("[Core]\t\t_webui_window_event() -> Calling all-events user callback\n" );
8403
+ printf ("[Core]\t\t_webui_window_event() -> Calling all-events user callback at address 0x%p \n" , win -> cb [ events_cb_index ] );
8397
8404
printf ("[Call]\n" );
8398
8405
#endif
8399
8406
e .bind_id = events_cb_index ;
@@ -8409,7 +8416,7 @@ static void _webui_window_event(
8409
8416
if (exist && win -> cb [cb_index ] != NULL ) {
8410
8417
// Call user cb
8411
8418
#ifdef WEBUI_LOG
8412
- printf ("[Core]\t\t_webui_window_event() -> Calling user callback\n" );
8419
+ printf ("[Core]\t\t_webui_window_event() -> Calling user callback at address 0x%p \n" , win -> cb [ cb_index ] );
8413
8420
printf ("[Call]\n" );
8414
8421
#endif
8415
8422
e .bind_id = cb_index ;
@@ -8424,6 +8431,9 @@ static void _webui_window_event(
8424
8431
8425
8432
// Async response wait
8426
8433
if (_webui .config .asynchronous_response ) {
8434
+ #ifdef WEBUI_LOG
8435
+ printf ("[Core]\t\t_webui_window_event() -> Waiting for asynchronous response...\n" );
8436
+ #endif
8427
8437
bool done = false;
8428
8438
while (!done ) {
8429
8439
_webui_sleep (10 );
@@ -10487,15 +10497,18 @@ static void _webui_ws_process(
10487
10497
// Call user cb
10488
10498
#ifdef WEBUI_LOG
10489
10499
printf (
10490
- "[Core]\t\t_webui_ws_process(%zu) -> Calling user callback\n[Call]\n" ,
10491
- recvNum
10500
+ "[Core]\t\t_webui_ws_process(%zu) -> Calling user callback at address 0x%p \n[Call]\n" ,
10501
+ recvNum , win -> cb [ cb_index ]
10492
10502
);
10493
10503
#endif
10494
10504
e .bind_id = cb_index ;
10495
10505
win -> cb [cb_index ](& e );
10496
10506
10497
10507
// Async response wait
10498
10508
if (_webui .config .asynchronous_response ) {
10509
+ #ifdef WEBUI_LOG
10510
+ printf ("[Core]\t\t_webui_ws_process(%zu) -> Waiting for asynchronous response...\n" , recvNum );
10511
+ #endif
10499
10512
bool done = false;
10500
10513
while (!done ) {
10501
10514
_webui_sleep (10 );
0 commit comments