]> git.sesse.net Git - vlc/blob - src/interface/intf_msg.c
* Coding style fixes here and there.
[vlc] / src / interface / intf_msg.c
1 /*****************************************************************************
2  * intf_msg.c: messages interface
3  * This library provides basic functions for threads to interact with user
4  * interface, such as message output. See config.h for output configuration.
5  *****************************************************************************
6  * Copyright (C) 1998, 1999, 2000 VideoLAN
7  * $Id: intf_msg.c,v 1.32 2001/04/28 03:36:25 sam Exp $
8  *
9  * Authors: Vincent Seguin <seguin@via.ecp.fr>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  * 
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
24  *****************************************************************************/
25
26 /*****************************************************************************
27  * Preamble
28  *****************************************************************************/
29 #include "defs.h"
30
31 #include <errno.h>                                                  /* errno */
32 #include <fcntl.h>                     /* O_CREAT, O_TRUNC, O_WRONLY, O_SYNC */
33 #include <stdio.h>                                               /* required */
34 #include <stdarg.h>                                       /* va_list for BSD */
35 #include <stdlib.h>                                              /* malloc() */
36 #include <string.h>                                            /* strerror() */
37 #include <unistd.h>                                      /* close(), write() */
38
39 #include "config.h"
40 #include "common.h"
41 #include "threads.h"
42 #include "mtime.h"
43
44 #include "intf_msg.h"
45 #include "interface.h"
46 #include "intf_console.h"
47
48 #include "main.h"
49
50 #ifdef WIN32
51 #define snprintf _snprintf         /* snprintf not defined in mingw32 (bug?) */
52 #endif
53
54 /*****************************************************************************
55  * intf_msg_item_t
56  *****************************************************************************
57  * Store a single message. Messages have a maximal size of INTF_MSG_MSGSIZE.
58  * If TRACE is defined, messages have a date field and debug messages are
59  * printed with a date to allow more precise profiling.
60  *****************************************************************************/
61 typedef struct
62 {
63     int     i_type;                               /* message type, see below */
64     char *  psz_msg;                                   /* the message itself */
65
66 #ifdef TRACE
67     /* Debugging informations - in TRACE mode, debug messages have calling
68      * location informations printed */
69     mtime_t date;                                     /* date of the message */
70     char *  psz_file;               /* file in which the function was called */
71     char *  psz_function;     /* function from which the function was called */
72     int     i_line;                 /* line at which the function was called */
73 #endif
74 } intf_msg_item_t;
75
76 /* Message types */
77 #define INTF_MSG_STD    0                                /* standard message */
78 #define INTF_MSG_ERR    1                                   /* error message */
79 #define INTF_MSG_INTF   2                               /* interface message */
80 #define INTF_MSG_DBG    3                                   /* debug message */
81 #define INTF_MSG_WARN   4                                  /* warning message*/
82
83
84 /*****************************************************************************
85  * intf_msg_t
86  *****************************************************************************
87  * Store all data requiered by messages interfaces. It has a single reference
88  * int p_main.
89  *****************************************************************************/
90 typedef struct intf_msg_s
91 {
92 #ifdef INTF_MSG_QUEUE
93     /* Message queue */
94     vlc_mutex_t             lock;                      /* message queue lock */
95     int                     i_count;            /* number of messages stored */
96     intf_msg_item_t         msg[INTF_MSG_QSIZE];            /* message queue */
97 #endif
98
99 #ifdef TRACE_LOG
100     /* Log file */
101     FILE *                  p_log_file;                          /* log file */
102 #endif
103
104 #if !defined(INTF_MSG_QUEUE) && !defined(TRACE_LOG)
105     /* If neither messages queue, neither log file is used, then the structure
106      * is empty. However, empty structures are not allowed in C. Therefore, a
107      * dummy integer is used to fill it. */
108     int                     i_dummy;                        /* unused filler */
109 #endif
110 } intf_msg_t;
111
112 /*****************************************************************************
113  * Local prototypes
114  *****************************************************************************/
115
116 static void QueueMsg        ( intf_msg_t *p_msg, int i_type,
117                               char *psz_format, va_list ap );
118 static void PrintMsg        ( intf_msg_item_t *p_msg );
119 #ifdef TRACE
120 static void QueueDbgMsg     ( intf_msg_t *p_msg, char *psz_file,
121                               char *psz_function, int i_line,
122                               char *psz_format, va_list ap );
123 #endif
124 #ifdef INTF_MSG_QUEUE
125 static void FlushLockedMsg  ( intf_msg_t *p_msg );
126 #endif
127
128
129 /*****************************************************************************
130  * intf_MsgCreate: initialize messages interface                         (ok ?)
131  *****************************************************************************
132  * This functions has to be called before any call to other intf_*Msg functions.
133  * It set up the locks and the message queue if it is used.
134  *****************************************************************************/
135 p_intf_msg_t intf_MsgCreate( void )
136 {
137     p_intf_msg_t p_msg;
138
139     /* Allocate structure */
140     p_msg = malloc( sizeof( intf_msg_t ) );
141     if( p_msg == NULL )
142     {
143         errno = ENOMEM;
144     }
145     else
146     {
147 #ifdef INTF_MSG_QUEUE
148     /* Message queue initialization */
149     vlc_mutex_init( &p_msg->lock );                        /* intialize lock */
150     p_msg->i_count = 0;                                    /* queue is empty */
151 #endif
152
153     
154 #ifdef TRACE_LOG
155         /* Log file initialization - on failure, file pointer will be null,
156          * and no log will be issued, but this is not considered as an
157          * error */
158         p_msg->p_log_file = fopen( TRACE_LOG, "w" );
159 #endif
160     }
161     return( p_msg );
162 }
163
164 /*****************************************************************************
165  * intf_MsgDestroy: free resources allocated by intf_InitMsg            (ok ?)
166  *****************************************************************************
167  * This functions prints all messages remaining in queue, then free all the
168  * resources allocated by intf_InitMsg.
169  * No other messages interface functions should be called after this one.
170  *****************************************************************************/
171 void intf_MsgDestroy( void )
172 {
173     intf_FlushMsg();                         /* print all remaining messages */
174
175 #ifdef TRACE_LOG
176     /* Close log file if any */
177     if( p_main->p_msg->p_log_file != NULL )
178     {
179         fclose( p_main->p_msg->p_log_file );
180     }
181 #endif
182
183 #ifdef INTF_MSG_QUEUE
184     /* destroy lock */
185     vlc_mutex_destroy( &p_main->p_msg->lock );
186 #endif
187     
188     /* Free structure */
189     free( p_main->p_msg );
190 }
191
192 /*****************************************************************************
193  * intf_Msg: print a message                                             (ok ?)
194  *****************************************************************************
195  * This function queue a message for later printing, or print it immediately
196  * if the queue isn't used.
197  *****************************************************************************/
198 void intf_Msg( char *psz_format, ... )
199 {
200     va_list ap;
201
202     va_start( ap, psz_format );
203     QueueMsg( p_main->p_msg, INTF_MSG_STD, psz_format, ap );
204     va_end( ap );
205 }
206
207 /*****************************************************************************
208  * intf_ErrMsg : print an error message                                  (ok ?)
209  *****************************************************************************
210  * This function is the same as intf_Msg, except that it prints its messages
211  * on stderr.
212  *****************************************************************************/
213 void intf_ErrMsg( char *psz_format, ... )
214 {
215     va_list ap;
216
217     va_start( ap, psz_format );
218     QueueMsg( p_main->p_msg, INTF_MSG_ERR, psz_format, ap );
219     va_end( ap );
220 }
221
222 /*****************************************************************************
223  * intf_WarnMsg : print a warning message
224  *****************************************************************************
225  * This function is the same as intf_Msg, except that it concerns warning
226  * messages for testing purpose.
227  *****************************************************************************/
228 void intf_WarnMsg( int i_level, char *psz_format, ... )
229 {
230     va_list ap;
231     
232     if( i_level >= p_main->i_warning_level )
233     {
234         va_start( ap, psz_format );
235         QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap );
236         va_end( ap );
237     }
238 }
239
240
241 /*****************************************************************************
242  * intf_IntfMsg : print an interface message                             (ok ?)
243  *****************************************************************************
244  * In opposition to all other intf_*Msg function, this function does not print
245  * it's message on default terminal (stdout or stderr), but send it to
246  * interface (in fact to the X11 console). This means that the interface MUST
247  * be initialized and a X11 console openned before this function is used, and
248  * that once the console is closed, this call is vorbidden.
249  * Practically, only the interface thread itself should call this function, and
250  * flush all messages before intf_CloseX11Console() is called.
251  *****************************************************************************/
252 void intf_IntfMsg(char *psz_format, ...)
253 {
254     va_list ap;
255
256     va_start( ap, psz_format );
257     QueueMsg( p_main->p_msg, INTF_MSG_INTF, psz_format, ap );
258     va_end( ap );
259 }
260
261 /*****************************************************************************
262  * _intf_DbgMsg: print a debugging message                               (ok ?)
263  *****************************************************************************
264  * This function prints a debugging message. Compared to other intf_*Msg
265  * functions, it is only defined if TRACE is defined and require a file name,
266  * a function name and a line number as additionnal debugging informations. It
267  * also prints a debugging header for each received line.
268  *****************************************************************************/
269 #ifdef TRACE
270 void _intf_DbgMsg( char *psz_file, char *psz_function, int i_line,
271                    char *psz_format, ...)
272 {
273     va_list ap;
274
275     va_start( ap, psz_format );
276     QueueDbgMsg( p_main->p_msg, psz_file, psz_function, i_line,
277                  psz_format, ap );
278     va_end( ap );
279 }
280 #endif
281
282 /*****************************************************************************
283  * intf_MsgImm: print a message                                          (ok ?)
284  *****************************************************************************
285  * This function prints a message immediately. If the queue is used, all
286  * waiting messages are also printed.
287  *****************************************************************************/
288 void intf_MsgImm( char *psz_format, ... )
289 {
290     va_list ap;
291
292     va_start( ap, psz_format );
293     QueueMsg( p_main->p_msg, INTF_MSG_STD, psz_format, ap );
294     va_end( ap );
295     intf_FlushMsg();
296 }
297
298 /*****************************************************************************
299  * intf_ErrMsgImm: print an error message immediately                    (ok ?)
300  *****************************************************************************
301  * This function is the same as intf_MsgImm, except that it prints its message
302  * on stderr.
303  *****************************************************************************/
304 void intf_ErrMsgImm(char *psz_format, ...)
305 {
306     va_list ap;
307
308     va_start( ap, psz_format );
309     QueueMsg( p_main->p_msg, INTF_MSG_ERR, psz_format, ap );
310     va_end( ap );
311     intf_FlushMsg();
312 }
313
314 /*****************************************************************************
315  * intf_WarnMsgImm : print a warning message
316  *****************************************************************************
317  * This function is the same as intf_MsgImm, except that it concerns warning
318  * messages for testing purpose.
319  *****************************************************************************/
320 void intf_WarnMsgImm( int i_level, char *psz_format, ... )
321 {
322     va_list ap;
323
324     if( i_level >= p_main->i_warning_level )
325     {
326         va_start( ap, psz_format );
327         QueueMsg( p_main->p_msg, INTF_MSG_WARN, psz_format, ap );
328         va_end( ap );
329     }
330     intf_FlushMsg();
331 }
332
333
334
335 /*****************************************************************************
336  * _intf_DbgMsgImm: print a debugging message immediately                (ok ?)
337  *****************************************************************************
338  * This function is the same as intf_DbgMsgImm, except that it prints its
339  * message immediately. It should only be called through the macro
340  * intf_DbgMsgImm().
341  *****************************************************************************/
342 #ifdef TRACE
343 void _intf_DbgMsgImm( char *psz_file, char *psz_function, int i_line,
344                       char *psz_format, ...)
345 {
346     va_list ap;
347
348     va_start( ap, psz_format );
349     QueueDbgMsg( p_main->p_msg, psz_file, psz_function, i_line,
350                  psz_format, ap );
351     va_end( ap );
352     intf_FlushMsg();
353 }
354 #endif
355
356 /*****************************************************************************
357  * intf_WarnHexDump : print a hexadecimal dump of a memory area
358  *****************************************************************************
359  * This is convenient for debugging purposes.
360  *****************************************************************************/
361 void intf_WarnHexDump( int i_level, void *p_data, int i_size )
362 {
363     int   i_index = 0;
364     int   i_subindex;
365     char  p_string[75];
366     u8   *p_area = (u8 *)p_data;
367
368     intf_WarnMsg( i_level, "hexdump: dumping %i bytes at address %p",
369                            i_size, p_data );
370
371     while( i_index < i_size )
372     {
373         i_subindex = 0;
374
375         while( ( i_subindex < 24 ) && ( i_index + i_subindex < i_size ) )
376         {
377             sprintf( p_string + 3 * i_subindex, "%.2x ",
378                      p_area[ i_index + i_subindex ] );
379
380             i_subindex++;
381         }
382
383         /* -1 here is safe because we know we printed at least one */
384         p_string[ 3 * i_subindex - 1 ] = '\0';
385         intf_WarnMsg( i_level, "0x%.4x: %s", i_index, p_string );
386
387         i_index += 24;
388     }
389
390     intf_WarnMsg( i_level, "hexdump: %i bytes dumped", i_size );
391 }
392
393 /*****************************************************************************
394  * intf_FlushMsg                                                        (ok ?)
395  *****************************************************************************
396  * Print all messages remaining in queue: get lock and call FlushLockedMsg.
397  * This function does nothing if the message queue isn't used.
398  * This function is only implemented if message queue is used. If not, it is
399  * an empty macro.
400  *****************************************************************************/
401 #ifdef INTF_MSG_QUEUE
402 void intf_FlushMsg( void )
403 {
404     vlc_mutex_lock( &p_main->p_msg->lock );                      /* get lock */
405     FlushLockedMsg( p_main->p_msg );                       /* flush messages */
406     vlc_mutex_unlock( &p_main->p_msg->lock );              /* give lock back */
407 }
408 #endif
409
410 /* following functions are local */
411
412 /*****************************************************************************
413  * QueueMsg: add a message to a queue
414  *****************************************************************************
415  * This function provide basic functionnalities to other intf_*Msg functions.
416  * It add a message to a queue (after having printed all stored messages if it
417  * is full. If the message can't be converted to string in memory, it exit the
418  * program. If the queue is not used, it prints the message immediately.
419  *****************************************************************************/
420 static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list ap )
421 {
422     char *                  psz_str;             /* formatted message string */
423     intf_msg_item_t *       p_msg_item;                /* pointer to message */
424
425 #ifndef INTF_MSG_QUEUE /*................................... instant mode ...*/
426     intf_msg_item_t         msg_item;                             /* message */
427     p_msg_item =           &msg_item;
428 #endif /*....................................................................*/
429
430     /*
431      * Convert message to string
432      */
433 #ifdef HAVE_VASPRINTF
434     vasprintf( &psz_str, psz_format, ap );
435 #else
436     psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
437 #endif
438     if( psz_str == NULL )
439     {
440         fprintf(stderr, "warning: can't store following message (%s): ",
441                 strerror(errno) );
442         vfprintf(stderr, psz_format, ap );
443         fprintf(stderr, "\n" );
444         exit( errno );
445     }
446 #ifdef HAVE_VASPRINTF
447 #else
448     vsprintf( psz_str, psz_format, ap );
449 #endif
450
451 #ifdef INTF_MSG_QUEUE /*...................................... queue mode ...*/
452     vlc_mutex_lock( &p_msg->lock );                              /* get lock */
453     if( p_msg->i_count == INTF_MSG_QSIZE )          /* flush queue if needed */
454     {
455 #ifdef DEBUG               /* in debug mode, queue overflow causes a warning */
456         fprintf(stderr, "warning: message queue overflow\n" );
457 #endif
458         FlushLockedMsg( p_msg );
459     }
460     p_msg_item = p_msg->msg + p_msg->i_count++;            /* select message */
461 #endif /*.............................................. end of queue mode ...*/
462
463     /*
464      * Fill message information fields
465      */
466     p_msg_item->i_type =     i_type;
467     p_msg_item->psz_msg =    psz_str;
468 #ifdef TRACE    
469     p_msg_item->date =       mdate();
470 #endif
471
472 #ifdef INTF_MSG_QUEUE /*......................................... queue mode */
473     vlc_mutex_unlock( &p_msg->lock );                      /* give lock back */
474 #else /*....................................................... instant mode */
475     PrintMsg( p_msg_item );                                 /* print message */
476     free( psz_str );                                    /* free message data */
477 #endif /*....................................................................*/
478 }
479
480 /*****************************************************************************
481  * QueueDbgMsg: add a message to a queue with debugging informations
482  *****************************************************************************
483  * This function is the same as QueueMsg, except that it is only defined when
484  * TRACE is define, and require additionnal debugging informations.
485  *****************************************************************************/
486 #ifdef TRACE
487 static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function,
488                         int i_line, char *psz_format, va_list ap)
489 {
490     char *                  psz_str;             /* formatted message string */
491     intf_msg_item_t *       p_msg_item;                /* pointer to message */
492
493 #ifndef INTF_MSG_QUEUE /*................................... instant mode ...*/
494     intf_msg_item_t         msg_item;                             /* message */
495     p_msg_item =           &msg_item;
496 #endif /*....................................................................*/
497
498     /*
499      * Convert message to string
500      */
501 #ifdef HAVE_VASPRINTF
502     vasprintf( &psz_str, psz_format, ap );
503 #else
504     psz_str = (char*) malloc( INTF_MAX_MSG_SIZE );
505     vsprintf( psz_str, psz_format, ap );
506 #endif
507     if( psz_str == NULL )
508     {
509         fprintf(stderr, "warning: can't store following message (%s): ",
510                 strerror(errno) );
511         fprintf(stderr, INTF_MSG_DBG_FORMAT, psz_file, psz_function, i_line );
512         vfprintf(stderr, psz_format, ap );
513         fprintf(stderr, "\n" );
514         exit( errno );
515     }
516
517 #ifdef INTF_MSG_QUEUE /*...................................... queue mode ...*/
518     vlc_mutex_lock( &p_msg->lock );                              /* get lock */
519     if( p_msg->i_count == INTF_MSG_QSIZE )          /* flush queue if needed */
520     {
521         fprintf(stderr, "warning: message queue overflow\n" );
522         FlushLockedMsg( p_msg );
523     }
524     p_msg_item = p_msg->msg + p_msg->i_count++;            /* select message */
525 #endif /*.............................................. end of queue mode ...*/
526
527     /*
528      * Fill message information fields
529      */
530     p_msg_item->i_type =       INTF_MSG_DBG;
531     p_msg_item->psz_msg =      psz_str;
532     p_msg_item->psz_file =     psz_file;
533     p_msg_item->psz_function = psz_function;
534     p_msg_item->i_line =       i_line;
535     p_msg_item->date =         mdate();
536
537 #ifdef INTF_MSG_QUEUE /*......................................... queue mode */
538     vlc_mutex_unlock( &p_msg->lock );                      /* give lock back */
539 #else /*....................................................... instant mode */
540     PrintMsg( p_msg_item );                                 /* print message */
541     free( psz_str );                                    /* free message data */
542 #endif /*....................................................................*/
543 }
544 #endif
545
546 /*****************************************************************************
547  * FlushLockedMsg                                                       (ok ?)
548  *****************************************************************************
549  * Print all messages remaining in queue. MESSAGE QUEUE MUST BE LOCKED, since
550  * this function does not check the lock. This function is only defined if
551  * INTF_MSG_QUEUE is defined.
552  *****************************************************************************/
553 #ifdef INTF_MSG_QUEUE
554 static void FlushLockedMsg ( intf_msg_t *p_msg )
555 {
556     int i_index;
557
558     for( i_index = 0; i_index < p_msg->i_count; i_index++ )
559     {
560         /* Print message and free message data */
561         PrintMsg( &p_msg->msg[i_index] );
562         free( p_msg->msg[i_index].psz_msg );
563     }
564
565     p_msg->i_count = 0;
566 }
567 #endif
568
569 /*****************************************************************************
570  * PrintMsg: print a message                                             (ok ?)
571  *****************************************************************************
572  * Print a single message. The message data is not freed. This function exists
573  * in two version. The TRACE version prints a date with each message, and is
574  * able to log messages (if TRACE_LOG is defined).
575  * The normal one just prints messages to the screen.
576  *****************************************************************************/
577 #ifdef TRACE
578
579 static void PrintMsg( intf_msg_item_t *p_msg )
580 {
581     char    psz_date[MSTRTIME_MAX_SIZE];            /* formatted time buffer */
582     int     i_msg_len = MSTRTIME_MAX_SIZE + strlen(p_msg->psz_msg) + 200;
583     char   *psz_msg;                                       /* message buffer */
584
585     psz_msg = malloc( sizeof( char ) * i_msg_len );
586
587     /* Check if allocation succeeded */
588     if( psz_msg == NULL )
589     {
590         fprintf( stderr, "error: not enough memory for message %s\n",
591                  p_msg->psz_msg );
592         return;
593     }
594
595     /* Format message - the message is formatted here because in case the log
596      * file is used, it avoids another format string parsing */
597     switch( p_msg->i_type )
598     {
599     case INTF_MSG_STD:                                   /* regular messages */
600     case INTF_MSG_ERR:
601         snprintf( psz_msg, i_msg_len, "%s", p_msg->psz_msg );
602         break;
603
604     case INTF_MSG_WARN:                                   /* Warning message */
605         mstrtime( psz_date, p_msg->date );
606         snprintf( psz_msg, i_msg_len, "(%s) %s",
607                   psz_date, p_msg->psz_msg );
608
609         break;
610         
611     case INTF_MSG_INTF:                                /* interface messages */
612         snprintf( psz_msg, i_msg_len, "%s", p_msg->psz_msg );
613         break;
614
615     case INTF_MSG_DBG:                                     /* debug messages */
616         mstrtime( psz_date, p_msg->date );
617         snprintf( psz_msg, i_msg_len, "(%s) " INTF_MSG_DBG_FORMAT "%s",
618                   psz_date, p_msg->psz_file, p_msg->psz_function, p_msg->i_line,
619                   p_msg->psz_msg );
620         break;
621     }
622
623     /*
624      * Print messages
625      */
626     switch( p_msg->i_type )
627     {
628     case INTF_MSG_STD:                                  /* standard messages */
629         fprintf( stdout, "%s\n", psz_msg );
630         break;
631     case INTF_MSG_ERR:                                     /* error messages */
632     case INTF_MSG_WARN:
633 #ifndef TRACE_LOG_ONLY
634     case INTF_MSG_DBG:                                 /* debugging messages */
635 #endif
636         fprintf( stderr, "%s\n", psz_msg );
637         break;
638     case INTF_MSG_INTF:                                /* interface messages */
639         intf_ConsolePrint( p_main->p_intf->p_console, psz_msg );
640         break;
641     }
642
643 #ifdef TRACE_LOG
644     /* Append all messages to log file */
645     if( p_main->p_msg->p_log_file != NULL )
646     {
647         fwrite( psz_msg, strlen( psz_msg ), 1, p_main->p_msg->p_log_file );
648         fwrite( "\n", 1, 1, p_main->p_msg->p_log_file );
649     }
650 #endif
651
652     /* Free the message */
653     free( psz_msg );
654 }
655
656 #else
657
658 static void PrintMsg( intf_msg_item_t *p_msg )
659 {
660     /*
661      * Print messages on screen
662      */
663     switch( p_msg->i_type )
664     {
665     case INTF_MSG_STD:                                  /* standard messages */
666     case INTF_MSG_DBG:                                     /* debug messages */
667         fprintf( stdout, "%s\n", p_msg->psz_msg );
668         break;
669     case INTF_MSG_ERR:                                     /* error messages */
670     case INTF_MSG_WARN:
671         fprintf( stderr, "%s\n", p_msg->psz_msg );        /* warning message */
672         break;
673     case INTF_MSG_INTF:                                /* interface messages */
674         intf_ConsolePrint( p_main->p_intf->p_console, p_msg->psz_msg );
675         break;
676     }
677 }
678
679 #endif
680