1 /*********************************************************************
2  * error.c
3  *
4  * Error and warning messages, and system commands.
5  *********************************************************************/
6 
7 
8 /* Standard includes */
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <stdarg.h>
12 #include <framework/mlt_log.h>
13 
14 /*********************************************************************
15  * KLTError
16  *
17  * Prints an error message and dies.
18  *
19  * INPUTS
20  * exactly like printf
21  */
22 
KLTError(char * fmt,...)23 void KLTError(char *fmt, ...)
24 {
25   va_list args;
26 
27   va_start(args, fmt);
28   mlt_log_error(NULL, "KLT Error: ");
29   mlt_log_error(NULL, fmt, args);
30   mlt_log_error(NULL, "\n");
31   va_end(args);
32 }
33 
34 
35 /*********************************************************************
36  * KLTWarning
37  *
38  * Prints a warning message.
39  *
40  * INPUTS
41  * exactly like printf
42  */
43 
KLTWarning(char * fmt,...)44 void KLTWarning(char *fmt, ...)
45 {
46   va_list args;
47 
48   va_start(args, fmt);
49   fprintf(stderr, "KLT Warning: ");
50   vfprintf(stderr, fmt, args);
51   fprintf(stderr, "\n");
52   fflush(stderr);
53   va_end(args);
54 }
55 
56