Definition in file msg_log.c.
#include "msg_log.h"
#include "globals.h"
Go to the source code of this file.
Functions | |
void | message_log_vl (const char *format, va_list val) |
Only logs the message, without showing on screen. | |
void | message_log_simp (const char *str) |
Simplified function for message logging. | |
void | message_log (const char *format,...) |
Only logs the message, without showing on screen. | |
void | message_error (const char *format,...) |
Logs the message and prints it into stderr. | |
short | message_is_empty (void) |
Returns if the message buffer is empty. | |
void | message_info (const char *format,...) |
Logs the message and prints it into message buffer. | |
void | message_info_force (const char *format,...) |
Sets the new message even if previous one was marked to be held. | |
short | message_hold_get (void) |
Returns the value of message_hold. | |
unsigned int | message_getcount_get (void) |
Returns the value of message_getcount. | |
void | message_release (void) |
Releases the message buffer, so it can store next message. | |
char * | message_get (void) |
Returns pointer to the buffer with the last message. | |
char * | message_get_prev (void) |
Returns pointer to the buffer with the previous message. | |
short | set_msglog_fname (char *fname) |
Sets message log file name. | |
void | init_messages (void) |
Clears message log variables without freeing memory (drops any pointers). | |
void | free_messages (void) |
Frees memory allocated for messages. | |
Variables | |
char * | message_prv |
char * | message |
short | message_hold |
unsigned int | message_getcount |
char * | msgout_fname |
void free_messages | ( | void | ) |
Frees memory allocated for messages.
The pointers are not cleared.
void init_messages | ( | void | ) |
Clears message log variables without freeing memory (drops any pointers).
void message_error | ( | const char * | format, | |
... | ||||
) |
Logs the message and prints it into stderr.
Sets message_hold, so other messages can't overwrite it.
format | Specifies the string pattern. | |
... | List of arguments used in the pattern. |
Definition at line 88 of file msg_log.c.
Referenced by actnpt_add(), change_draw_data_texture(), create_actnpt(), create_actnpt_copy(), create_column_rec(), create_column_recp(), create_cust_col(), create_graffiti(), create_stlight(), create_stlight_copy(), create_thing_empty(), dkscript_verify(), execute_script_line(), format_data_fname(), generate_map_bitmap(), generate_map_bitmap_mapfname(), get_object_with_circle_at(), get_thing_with_circle_at(), graffiti_add_obj(), level_init(), level_set_size(), level_verify(), load_apt(), load_dk1_map(), load_dke_map(), load_draw_data(), load_lgt(), load_map_preview(), load_mapfile(), load_mapfile_msg(), load_tng(), prepare_short_fname(), recompose_script_command(), save_dke_map(), save_mapfile(), script_strword(), stlight_add(), text_file_line_add(), text_file_linecp_add(), thing_add(), user_load_map(), user_save_map(), user_set_owner_rect(), user_set_slab_rect(), user_set_slabown_rect(), write_bitmap_rgb(), write_def_clm_source(), and write_def_tng_source().
char* message_get | ( | void | ) |
Returns pointer to the buffer with the last message.
char* message_get_prev | ( | void | ) |
Returns pointer to the buffer with the previous message.
unsigned int message_getcount_get | ( | void | ) |
Returns the value of message_getcount.
This value informs how many times the message_get() was called for the current message.
short message_hold_get | ( | void | ) |
void message_info | ( | const char * | format, | |
... | ||||
) |
Logs the message and prints it into message buffer.
The message is set into buffer only if message_hold is not set.
format | Specifies the string pattern. | |
... | List of arguments used in the pattern. |
Definition at line 129 of file msg_log.c.
Referenced by generate_map_bitmap_mapfname(), get_object_with_circle_at(), get_thing_with_circle_at(), and level_verify().
void message_info_force | ( | const char * | format, | |
... | ||||
) |
Sets the new message even if previous one was marked to be held.
The new message is a standard information - hold is disabled.
format | Specifies the string pattern. | |
... | List of arguments used in the pattern. |
Definition at line 165 of file msg_log.c.
Referenced by load_mapfile(), load_mapfile_msg(), and save_mapfile().
short message_is_empty | ( | void | ) |
Returns if the message buffer is empty.
Definition at line 117 of file msg_log.c.
Referenced by message_info().
void message_log | ( | const char * | format, | |
... | ||||
) |
Only logs the message, without showing on screen.
Standard version - allows formatted message.
format | Specifies the string pattern. | |
... | List of arguments used in the pattern. |
Definition at line 73 of file msg_log.c.
Referenced by decompose_script(), decompose_script_command(), find_next_actnpt_on_map(), find_next_object_on_map(), find_next_stlight_on_map(), find_next_thing_on_map(), generate_map_bitmap(), level_clear(), level_clear_script(), level_deinit(), level_free(), level_free_script_param(), level_init(), level_set_size(), load_apt(), load_clm(), load_dat(), load_dk1_map(), load_dke_map(), load_draw_data(), load_flg(), load_inf(), load_lgt(), load_lif(), load_mapfile(), load_mapfile_msg(), load_own(), load_palette(), load_slb(), load_text_file(), load_tng(), load_txt(), load_vsn(), load_wib(), load_wlb(), save_dk1_map(), save_dke_map(), save_nfo_file(), script_load_and_execute(), script_load_and_execute_file(), start_new_map(), update_datclm_for_slab(), write_adi_script(), write_apt(), write_bitmap_rgb(), write_clm(), write_dat(), write_flg(), write_inf(), write_lgt(), write_lif(), write_nfo(), write_own(), write_slb(), write_tng(), write_txt(), write_vsn(), write_wib(), and write_wlb().
void message_log_simp | ( | const char * | str | ) |
Simplified function for message logging.
Allows writing only single string.
str | Specifies the exact to log string. |
Definition at line 54 of file msg_log.c.
Referenced by message_error(), message_info(), and message_info_force().
void message_log_vl | ( | const char * | format, | |
va_list | val | |||
) |
Only logs the message, without showing on screen.
The va_list version - mainly for internal use.
format | Specifies the string pattern. | |
val | List of arguments used in the pattern. |
Definition at line 35 of file msg_log.c.
Referenced by message_log().
void message_release | ( | void | ) |
Releases the message buffer, so it can store next message.
Call to this function is reqired after message_error call, to allow logging further messages.
short set_msglog_fname | ( | char * | fname | ) |
Sets message log file name.
Rewrites it, then writes header and two last messages.
fname | The file name under which log is written. |
char* message |
Definition at line 24 of file msg_log.c.
Referenced by free_messages(), init_messages(), message_error(), message_get(), message_info(), message_info_force(), message_is_empty(), and set_msglog_fname().
unsigned int message_getcount |
Definition at line 26 of file msg_log.c.
Referenced by init_messages(), message_error(), message_get(), message_getcount_get(), message_info(), and message_info_force().
short message_hold |
Definition at line 25 of file msg_log.c.
Referenced by init_messages(), message_error(), message_hold_get(), message_info(), message_info_force(), and message_release().
char* message_prv |
Definition at line 23 of file msg_log.c.
Referenced by free_messages(), init_messages(), message_error(), message_get_prev(), message_info(), message_info_force(), and set_msglog_fname().
char* msgout_fname |
Definition at line 27 of file msg_log.c.
Referenced by free_messages(), init_messages(), message_log(), message_log_simp(), message_log_vl(), and set_msglog_fname().