int k2printf(char *fmt,...) { va_list args; int status; static void *k2printf_semaphore; static int count=0; if (count==0) k2printf_semaphore = willusgui_semaphore_create_ex("k2printf",1,1); count++; if (k2printf_semaphore) willusgui_semaphore_status_wait(k2printf_semaphore); status=0; va_start(args,fmt); #ifdef HAVE_K2GUI if (k2gui_active()) { #if (WILLUSDEBUGX & 0x4000) status=avprintf(stdout,fmt,args); #endif if (k2gui_cbox_converting()) status=k2gui_cbox_vprintf(stdout,fmt,args); else if (k2gui_overlay_converting()) status=k2gui_overlay_vprintf(stdout,fmt,args); } else #endif status=avprintf(stdout,fmt,args); va_end(args); willusgui_semaphore_release(k2printf_semaphore); return(status); }
int k2printf(char *fmt,...) { va_list args; int status; va_start(args,fmt); #ifdef HAVE_K2GUI if (k2gui_active() && k2gui_cbox_converting()) { #if (WILLUSDEBUGX & 0x4000) status=avprintf(stdout,fmt,args); #endif status=k2gui_cbox_vprintf(stdout,fmt,args); } else #endif status=avprintf(stdout,fmt,args); va_end(args); return(status); }