/* Function: al_append_native_text_log */ void al_append_native_text_log(ALLEGRO_TEXTLOG *textlog, char const *format, ...) { ALLEGRO_NATIVE_DIALOG *dialog = (ALLEGRO_NATIVE_DIALOG *)textlog; va_list args; /* Fall back to printf if no window. */ if (!dialog) { va_start(args, format); vprintf(format, args); va_end(args); return; } al_lock_mutex(dialog->tl_text_mutex); /* We could optimise the case where format="%s". */ va_start(args, format); al_ustr_vappendf(dialog->tl_pending_text, format, args); va_end(args); _al_append_native_text_log(dialog); al_unlock_mutex(dialog->tl_text_mutex); }
/* Function: al_ustr_appendf */ bool al_ustr_appendf(ALLEGRO_USTR *us, const char *fmt, ...) { va_list ap; bool rc; va_start(ap, fmt); rc = al_ustr_vappendf(us, fmt, ap); va_end(ap); return rc; }
/* Function: al_ustr_newf */ ALLEGRO_USTR *al_ustr_newf(const char *fmt, ...) { ALLEGRO_USTR *us; va_list ap; us = al_ustr_new(""); va_start(ap, fmt); al_ustr_vappendf(us, fmt, ap); va_end(ap); return us; }