msg_log.h File Reference


Detailed Description

Maintaining of message log.

Purpose:
Header file. Defines exported routines from msg_log.c.
Comment:
None.
Author:
Tomasz Lis
Date:
25 Apr 2008 - 29 Jul 2008
Copying and copyrights:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Definition in file msg_log.h.

#include "globals.h"
#include <stdarg.h>

Go to the source code of this file.

Functions

DLLIMPORT void init_messages (void)
 Clears message log variables without freeing memory (drops any pointers).
DLLIMPORT void free_messages (void)
 Frees memory allocated for messages.
DLLIMPORT void message_error (const char *format,...)
 Logs the message and prints it into stderr.
DLLIMPORT void message_info (const char *format,...)
 Logs the message and prints it into message buffer.
DLLIMPORT void message_info_force (const char *format,...)
 Sets the new message even if previous one was marked to be held.
DLLIMPORT short message_is_empty (void)
 Returns if the message buffer is empty.
DLLIMPORT void message_release (void)
 Releases the message buffer, so it can store next message.
DLLIMPORT char * message_get (void)
 Returns pointer to the buffer with the last message.
DLLIMPORT char * message_get_prev (void)
 Returns pointer to the buffer with the previous message.
DLLIMPORT short message_hold_get (void)
 Returns the value of message_hold.
DLLIMPORT unsigned int message_getcount_get (void)
 Returns the value of message_getcount.
DLLIMPORT void message_log (const char *format,...)
 Only logs the message, without showing on screen.
DLLIMPORT void message_log_simp (const char *str)
 Simplified function for message logging.
DLLIMPORT void message_log_vl (const char *format, va_list val)
 Only logs the message, without showing on screen.
DLLIMPORT short set_msglog_fname (char *fname)
 Sets message log file name.


Function Documentation

DLLIMPORT void free_messages ( void   ) 

Frees memory allocated for messages.

The pointers are not cleared.

Definition at line 287 of file msg_log.c.

DLLIMPORT void init_messages ( void   ) 

Clears message log variables without freeing memory (drops any pointers).

Definition at line 275 of file msg_log.c.

DLLIMPORT void message_error ( const char *  format,
  ... 
)

DLLIMPORT char* message_get ( void   ) 

Returns pointer to the buffer with the last message.

Returns:
Returns pointer to the last message string.

Definition at line 226 of file msg_log.c.

DLLIMPORT char* message_get_prev ( void   ) 

Returns pointer to the buffer with the previous message.

Returns:
Returns pointer to the last message string.

Definition at line 236 of file msg_log.c.

DLLIMPORT 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.

Returns:
Returns message_get call count.

Definition at line 207 of file msg_log.c.

DLLIMPORT short message_hold_get ( void   ) 

Returns the value of message_hold.

This value informs if the buffer need to be released before any further logging.

Returns:
Returns message_hold, which true or false.

Definition at line 196 of file msg_log.c.

DLLIMPORT 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.

Parameters:
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().

DLLIMPORT 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.

Parameters:
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().

DLLIMPORT short message_is_empty ( void   ) 

Returns if the message buffer is empty.

Returns:
Returns true if the message buffer is empty.

Definition at line 117 of file msg_log.c.

Referenced by message_info().

DLLIMPORT void message_log ( const char *  format,
  ... 
)

DLLIMPORT void message_log_simp ( const char *  str  ) 

Simplified function for message logging.

Allows writing only single string.

Parameters:
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().

DLLIMPORT 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.

Parameters:
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().

DLLIMPORT 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.

Definition at line 217 of file msg_log.c.

DLLIMPORT short set_msglog_fname ( char *  fname  ) 

Sets message log file name.

Rewrites it, then writes header and two last messages.

Parameters:
fname The file name under which log is written.
Returns:
Returns true if the log was created, otherwise false.

Definition at line 247 of file msg_log.c.


Generated on Tue Sep 2 18:51:50 2008 for libAdikted by  doxygen 1.5.6