1 /*
2  * Epson Inkjet Printer Driver (ESC/P-R) for Linux
3  * Copyright (C) Seiko Epson Corporation 2002-2013.
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA.
18  */
19 
20 #ifndef DEBUG_H
21 #define DEBUG_H
22 
23 #ifdef HAVE_CONFIG_H
24 #  include <config.h>
25 #endif
26 
27 #include <stdarg.h>
28 
29 #if !DEBUG   /* not DEBUG */
30 #define DEBUG_START
31 #define DEDBUG_END
32 
33 #define DEBUG_QUALITY_STRUCT(str)
34 #define DEBUG_JOB_STRUCT(str)
35 
36 #else /* DEBUG */
37 #define DEBUG_START debug_init ()
38 #define DEDBUG_END debug_end ()
39 
40 #define DEBUG_QUALITY_STRUCT(str) \
41 debug_dump ("--- ESCPR_PRINT_QUALITY ---\n\n" \
42 	    "mediaTypeID  = %d\n" \
43 	    "quality      = %d\n" \
44 	    "colormode    = %d\n" \
45 	    "brightness   = %d\n" \
46 	    "contrast     = %d\n" \
47 	    "saturation   = %d\n" \
48 	    "colorPlane   = %d\n" \
49 	    "paltetteSize = %d\n" \
50 	    "--------------------------\n\n" \
51 	    ,str.MediaTypeID \
52 	    ,str.PrintQuality \
53             ,str.ColorMono \
54 	    ,str.Brightness \
55 	    ,str.Contrast \
56 	    ,str.Saturation \
57 	    ,str.ColorPlane \
58 	    ,str.PaletteSize)
59 
60 #define DEBUG_JOB_STRUCT(str) \
61 debug_dump ("--- ESCPR_PRINT_JOB  ---\n\n" \
62 	    "paperWidth     = %ld\n" \
63 	    "paperLength    = %ld\n" \
64 	    "topMargin      = %d\n" \
65 	    "leftMargin     = %d\n" \
66 	    "areaWidth      = %ld\n" \
67 	    "areaLength     = %ld\n" \
68 	    "inResolution   = %d\n" \
69 	    "printDirection = %d\n" \
70 	    "--------------------------\n\n" \
71 	    ,str.PaperWidth \
72 	    ,str.PaperLength \
73 	    ,str.TopMargin \
74 	    ,str.LeftMargin \
75 	    ,str.PrintableAreaWidth \
76 	    ,str.PrintableAreaLength \
77 	    ,str.InResolution \
78 	    ,str.PrintDirection)
79 
80 BEGIN_C
81 
82 void debug_init (void);
83 void debug_dump (const char *, ...);
84 void debug_end (void);
85 
86 END_C
87 
88 #endif /* DEBUG */
89 
90 #endif /* DEBUG_H */
91