2751 |
} |
} |
2752 |
|
|
2753 |
/* |
/* |
2754 |
* gui_printf_type_color: display a message in a buffer |
* gui_printf_internal: display a message in a buffer |
2755 |
|
* This function should NEVER be called directly. |
2756 |
|
* You should use macros defined in gui.h |
2757 |
*/ |
*/ |
2758 |
|
|
2759 |
void |
void |
2760 |
gui_printf_type_color (t_gui_buffer *buffer, int type, int color, char *message, ...) |
gui_printf_internal (t_gui_buffer *buffer, int display_time, int type, int color, char *message, ...) |
2761 |
{ |
{ |
2762 |
static char buf[8192]; |
static char buf[8192]; |
2763 |
char text_time[1024 + 1]; |
char text_time[1024]; |
2764 |
char text_time_char[2]; |
char text_time_char[2]; |
2765 |
time_t time_seconds; |
time_t time_seconds; |
2766 |
struct tm *local_time; |
struct tm *local_time; |
2849 |
pos = buf3 - 1; |
pos = buf3 - 1; |
2850 |
while (pos) |
while (pos) |
2851 |
{ |
{ |
2852 |
if ((!buffer->last_line) || (buffer->line_complete)) |
if (display_time |
2853 |
|
&& cfg_look_buffer_timestamp && cfg_look_buffer_timestamp[0] |
2854 |
|
&& ((!buffer->last_line) || (buffer->line_complete))) |
2855 |
{ |
{ |
2856 |
time_seconds = time (NULL); |
time_seconds = time (NULL); |
2857 |
local_time = localtime (&time_seconds); |
local_time = localtime (&time_seconds); |
2858 |
strftime (text_time, 1024, cfg_look_buffer_timestamp, local_time); |
strftime (text_time, sizeof (text_time), cfg_look_buffer_timestamp, local_time); |
2859 |
|
|
2860 |
time_first_digit = -1; |
time_first_digit = -1; |
2861 |
time_last_digit = -1; |
time_last_digit = -1; |