Added stub for PrinterProperties.
[wine] / tools / make_debug
1 #!/bin/bash
2 #
3 # This script generates the required files for supporting the debug
4 # channels used throught the code.
5 # The generated files are 
6 #   include/debugdefs.h
7 #   include/debug.h
8 # The script must be run in the root directory of the project.
9 #
10 # Dimitrie O. Paun <dimi@cs.toronto.edu>
11 #
12 DEBUG_H="include/debug.h"
13 DEBUG_DEFS_H="include/debugdefs.h"
14
15 DEBUG_CHANNELS="$( tools/find_debug_channels )"
16 DEBUG_CLASSES="fixme err warn trace"
17
18 {
19     cat <<EOF
20 /* Do not modify this file -- it is automatically generated! */
21
22 #ifndef __WINE_DEBUGTOOLS_H
23 #include "debugtools.h"
24 #endif
25
26 EOF
27     echo "/* Definitions for channels identifiers */"
28
29     chno=0
30     for ch in $DEBUG_CHANNELS
31     do
32         echo "#define dbch_${ch} $chno"
33         let chno=$chno+1
34     done
35
36     echo "/* Definitions for classes identifiers */"
37     clno=0
38     for cl in $DEBUG_CLASSES
39     do
40         echo "#define dbcl_${cl} $clno"
41         let clno=$clno+1
42     done
43 } > $DEBUG_H
44
45 # Now, on the last step, we proceed to construct
46 # the definitions to be used by the main function.
47 # These will be stored in include/debugdefs.h
48 {
49     cat <<EOF
50 /* Do not modify this file -- it is automatically generated! */
51
52 #ifndef __WINE_DEBUGTOOLS_H
53 #include "debugtools.h"
54 #endif
55
56 #define DEBUG_CHANNEL_COUNT $chno
57 #ifdef DEBUG_RUNTIME
58 short debug_msg_enabled[][DEBUG_CLASS_COUNT] = {
59 EOF
60
61     for ch in $DEBUG_CHANNELS
62     do
63         echo "{1, 1, 0, 0},"
64     done
65     echo '};'
66
67     echo 'const char* debug_ch_name[] = {'
68     for ch in $DEBUG_CHANNELS
69     do
70         echo "\"${ch}\","
71     done
72     echo '};'
73     
74     echo 'const char* debug_cl_name[] = {'
75     for ch in $DEBUG_CLASSES
76     do
77         echo "\"${ch}\","
78     done
79     echo '};'
80
81     cat <<EOF
82
83 #endif /*DEBUG_RUNTIME*/
84
85 /* end of automatically generated debug.h */
86 EOF
87
88 } > $DEBUG_DEFS_H
89
90