Authors: Reinhard Grafl
- $Id: logging.c 1761 2004-12-15 15:48:43Z twisti $
+ $Id: logging.c 1848 2005-01-04 11:35:10Z twisti $
*/
-void log_init(char *fname)
+void log_init(const char *fname)
{
if (fname) {
if (fname[0]) {
**************************************************************************/
-void dolog(char *txt, ...)
+void dolog(const char *txt, ...)
{
char logtext[MAXLOGTEXT];
va_list ap;
**************************************************************************/
-void dolog_plain(char *txt, ...)
+void dolog_plain(const char *txt, ...)
{
char logtext[MAXLOGTEXT];
va_list ap;
/********************* Function: log_text ********************************/
-void log_text(char *text)
+void log_text(const char *text)
{
dolog("%s", text);
}
/******************** Function: log_plain *******************************/
-void log_plain(char *text)
+void log_plain(const char *text)
{
dolog_plain("%s", text);
}
/****************** Function: get_logfile *******************************/
-FILE *get_logfile()
+FILE *get_logfile(void)
{
return (logfile) ? logfile : stdout;
}
/****************** Function: log_flush *********************************/
-void log_flush()
+void log_flush(void)
{
fflush(get_logfile());
}
/********************* Function: log_nl *********************************/
-void log_nl()
+void log_nl(void)
{
log_plain("\n");
fflush(get_logfile());
/********************* Function: log_cputime ****************************/
-void log_cputime()
+void log_cputime(void)
{
s8 t;
int sec, usec;
**************************************************************************/
-void error(char *txt, ...)
+void error(const char *txt, ...)
{
char logtext[MAXLOGTEXT];
va_list ap;
***************************************************************************/
-void panic(char *txt)
+void panic(const char *txt)
{
error("%s", txt);
}
Authors: Reinhard Grafl
- $Id: logging.h 1793 2004-12-21 10:14:35Z twisti $
+ $Id: logging.h 1848 2005-01-04 11:35:10Z twisti $
*/
/* function prototypes ********************************************************/
-void log_init(char *fname);
-void log_text(char *txt);
-void log_plain(char *txt); /* same as log_text without "LOG: " and newline */
-void log_flush(void); /* fflush logfile */
-void log_nl(void); /* newline and fflush */
+void log_init(const char *fname);
+void log_text(const char *txt);
+
+/* same as log_text without "LOG: " and newline */
+void log_plain(const char *txt);
+
+/* fflush logfile */
+void log_flush(void);
+
+/* newline and fflush */
+void log_nl(void);
void log_cputime(void);
void log_message_class(const char *msg, classinfo *c);
void log_message_method(const char *msg, methodinfo *m);
-void dolog(char *txt, ...);
-void dolog_plain(char *txt, ...); /* same as dolog without "LOG: " and newline*/
-void error(char *txt, ...);
+void dolog(const char *txt, ...);
+
+/* same as dolog without "LOG: " and newline*/
+void dolog_plain(const char *txt, ...);
+
+void error(const char *txt, ...);
/* XXX this is just a quick hack on darwin */
#if !defined(__DARWIN__)
-void panic(char *txt);
+void panic(const char *txt);
#endif
FILE *get_logfile(void); /* return the current logfile */