1 | /* file: dprints.h 12/30/96 Nakajima/SAIC/MRY |
---|
2 | */ |
---|
3 | #include <stdio.h> |
---|
4 | |
---|
5 | #define p_char(expr) fprintf(stdout," (char) " #expr "= %c\n",expr) |
---|
6 | #define p_string(expr) fprintf(stdout," (char *) " #expr "= %s\n",expr) |
---|
7 | #define p_ushort(expr) fprintf(stdout," (uns. short) " #expr "= %u\n",expr) |
---|
8 | #define p_short(expr) fprintf(stdout," (short) " #expr "= %d\n",expr) |
---|
9 | #define p_int(expr) fprintf(stdout," (int) " #expr "= %d\n",expr) |
---|
10 | #define p_long(expr) fprintf(stdout," (long) " #expr "= %ld\n",expr) |
---|
11 | #define p_ulong(expr) fprintf(stdout," (uns.long) " #expr "= %u\n",expr) |
---|
12 | #define p_float(expr) fprintf(stdout," (float) " #expr "= %.5f\n",expr) |
---|
13 | #define p_double(expr) fprintf(stdout," (double) " #expr "= %.5lf\n",expr) |
---|
14 | |
---|
15 | |
---|
16 | #ifdef VERBOSE |
---|
17 | /************************************************ |
---|
18 | * DEBUG IS DESIRED (compiled with -DVERBOSE) |
---|
19 | ************************************************/ |
---|
20 | #define VERB_ON 1 |
---|
21 | #define LIB_VERSION "verbose" |
---|
22 | #define DISPLAY_GRIBHDR(gh) display_gribhdr(gh) |
---|
23 | #define HDR_PRINT(str,addr,sz) hdr_print(str,addr,sz) |
---|
24 | #define PRT_INP_STRUCT(a,b,c,d,e) prt_inp_struct(a,b,c,d,e) |
---|
25 | #define DPRINT0(fmt) fprintf(stdout,(fmt)) |
---|
26 | #define DPRINT1(fmt,a) fprintf(stdout,(fmt),(a)) |
---|
27 | #define DPRINT2(fmt,a,b) fprintf(stdout,(fmt),(a),(b)) |
---|
28 | #define DPRINT3(fmt,a,b,c) fprintf(stdout,(fmt),(a),(b),(c)) |
---|
29 | #define DPRINT4(fmt,a,b,c,d) fprintf(stdout,(fmt),(a),(b),(c),(d)) |
---|
30 | #define DPRINT5(fmt,a,b,c,d,e) fprintf(stdout,(fmt),\ |
---|
31 | (a),(b),(c),(d),(e)) |
---|
32 | #define DPRINT6(fmt,a,b,c,d,e,f) fprintf(stdout,(fmt),\ |
---|
33 | (a),(b),(c),(d),(e),(f)) |
---|
34 | #define DPRINT7(fmt,a,b,c,d,e,f,g) fprintf(stdout,(fmt), \ |
---|
35 | (a),(b),(c),(d),(e), (f),(g)) |
---|
36 | #define DPRINT8(fmt,a,b,c,d,e,f,g,h) fprintf(stdout,(fmt),\ |
---|
37 | (a),(b),(c),(d),(e),(f),(g),(h)) |
---|
38 | #define DPRINT9(fmt,a,b,c,d,e,f,g,h,i) fprintf(stdout,(fmt),\ |
---|
39 | (a),(b),(c),(d),(e),(f),(g),(h),(i)) |
---|
40 | #define P_CHAR(x) p_char(x) |
---|
41 | #define P_STRING(x) p_string(x) |
---|
42 | #define P_USHORT(x) p_ushort(x) |
---|
43 | #define P_SHORT(x) p_short(x) |
---|
44 | #define P_INT(x) p_int(x) |
---|
45 | #define P_LONG(x) p_long(x) |
---|
46 | #define P_ULONG(x) p_ulong(x) |
---|
47 | #define P_FLOAT(x) p_float(x) |
---|
48 | #define P_DOUBLE(x) p_double(x) |
---|
49 | |
---|
50 | #else |
---|
51 | /*********************************************** |
---|
52 | * ELSE TURN ALL DEBUG PRINTING OFF |
---|
53 | * null out function calls |
---|
54 | ************************************************/ |
---|
55 | #define VERB_ON 0 |
---|
56 | #define LIB_VERSION "non-verbose" |
---|
57 | #define DISPLAY_GRIBHDR(gh) {} |
---|
58 | #define HDR_PRINT(title,addr,sz) {} |
---|
59 | #define PRT_INP_STRUCT(a,b,c,d,e) {} |
---|
60 | #define DPRINT0(fmt) {} |
---|
61 | #define DPRINT1(fmt,s) {} |
---|
62 | #define DPRINT2(fmt,a,b) {} |
---|
63 | #define DPRINT3(fmt,a,b,c) {} |
---|
64 | #define DPRINT4(fmt,a,b,c,d) {} |
---|
65 | #define DPRINT5(fmt,a,b,c,d,e) {} |
---|
66 | #define DPRINT6(fmt,a,b,c,d,e,f) {} |
---|
67 | #define DPRINT7(fmt,a,b,c,d,e,f,g) {} |
---|
68 | #define DPRINT8(fmt,a,b,c,d,e,f,g,h) {} |
---|
69 | #define DPRINT9(fmt,a,b,c,d,e,f,g,h,i) {} |
---|
70 | #define P_CHAR(expr) {} |
---|
71 | #define P_STRING(expr) {} |
---|
72 | #define P_USHORT(expr) {} |
---|
73 | #define P_SHORT(expr) {} |
---|
74 | #define P_INT(expr) {} |
---|
75 | #define P_LONG(expr) {} |
---|
76 | #define P_ULONG(expr) {} |
---|
77 | #define P_FLOAT(expr) {} |
---|
78 | #define P_DOUBLE(expr) {} |
---|
79 | #endif |
---|