• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * frontend/console.h
3  *
4  * This
5  *
6  *
7  */
8 
9 #ifndef LAME_CONSOLE_H
10 #define LAME_CONSOLE_H
11 
12 #if defined(_WIN32)  &&  !defined(__CYGWIN__)
13 # include <windows.h>
14 #endif
15 
16 #if defined(__cplusplus)
17 extern "C" {
18 #endif
19 
20 typedef struct console_io_struct {
21     unsigned long ClassID;
22     unsigned long ClassProt;
23     FILE   *Console_fp;      /* filepointer to stream reporting information */
24     FILE   *Error_fp;        /* filepointer to stream fatal error reporting information */
25     FILE   *Report_fp;       /* filepointer to stream reports (normally a text file or /dev/null) */
26 #if defined(_WIN32)  &&  !defined(__CYGWIN__)
27     HANDLE  Console_Handle;
28 #endif
29     int     disp_width;
30     int     disp_height;
31     char    str_up[10];
32     char    str_clreoln[10];
33     char    str_emph[10];
34     char    str_norm[10];
35     char    Console_buff[2048];
36     int     Console_file_type;
37 } Console_IO_t;
38 
39 extern Console_IO_t Console_IO;
40 extern int frontend_open_console(void);
41 extern void frontend_close_console(void);
42 
43 extern void frontend_msgf(const char *format, va_list ap);
44 extern void frontend_debugf(const char *format, va_list ap);
45 extern void frontend_errorf(const char *format, va_list ap);
46 extern void frontend_print_null(const char *format, va_list ap);
47 
48 int     console_printf(const char *format, ...);
49 int     error_printf(const char *format, ...);
50 int     report_printf(const char *format, ...);
51 
52 void    console_flush(void);
53 void    error_flush(void);
54 void    report_flush(void);
55 
56 void    console_up(int n_lines);
57 int     console_getwidth(void);
58 
59 void    set_debug_file(const char *fn);
60 
61 #if defined(__cplusplus)
62 }
63 #endif
64 
65 #endif /* LAME_CONSOLE_H */
66 
67 /* end of console.h */
68