source: trunk/src/gdi32/dbglocal.cpp

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 2.4 KB
Line 
1/* $Id: dbglocal.cpp,v 1.10 2004-01-11 11:42:08 sandervl Exp $ */
2
3/*
4 * debug logging functions for OS/2
5 *
6 *
7 * Copyright 2000 Sander van Leeuwen
8 * Project Odin Software License can be found in LICENSE.TXT
9 */
10#include <os2wrap.h>
11#include <stdlib.h>
12#include <stdio.h>
13#include <string.h>
14#include <ctype.h>
15#include "dbglocal.h"
16
17#ifdef DEBUG
18
19USHORT DbgEnabledGDI32[DBG_MAXFILES] = {0};
20USHORT DbgEnabledLvl2GDI32[DBG_MAXFILES] = {0};
21
22static const char *DbgFileNames[DBG_MAXFILES] =
23{
24"gdi32",
25"opengl",
26"callback",
27"dibsect",
28"initterm",
29"resource",
30"oslibgdi",
31"font",
32"text",
33"palette",
34"line",
35"oslibgpi",
36"region",
37"metafile",
38"dibitmap",
39"blit",
40"rgbcvt",
41"objhandle",
42"transform",
43"printer",
44"icm",
45"trace",
46"fontres",
47"devcontext"
48};
49//******************************************************************************
50//******************************************************************************
51void ParseLogStatusGDI32()
52{
53 char *envvar = getenv(DBG_ENVNAME);
54 char *envvar2= getenv(DBG_ENVNAME_LVL2);
55 char *dbgvar;
56 int i;
57
58 for(i=0;i<DBG_MAXFILES;i++) {
59 DbgEnabledGDI32[i] = 1;
60 }
61
62 if(!envvar)
63 return;
64
65 dbgvar = strstr(envvar, "dll");
66 if(dbgvar) {
67 if(*(dbgvar-1) == '-') {
68 for(i=0;i<DBG_MAXFILES;i++) {
69 DbgEnabledGDI32[i] = 0;
70 }
71 }
72 }
73 for(i=0;i<DBG_MAXFILES;i++) {
74 int len = strlen(DbgFileNames[i]);
75 dbgvar = strstr(envvar, DbgFileNames[i]);
76 if(dbgvar && !islower(dbgvar[len])) {
77 if(*(dbgvar-1) == '-') {
78 DbgEnabledGDI32[i] = 0;
79 }
80 else
81 if(*(dbgvar-1) == '+') {
82 DbgEnabledGDI32[i] = 1;
83 }
84 }
85 }
86 if(envvar2) {
87 dbgvar = strstr(envvar2, "dll");
88 if(dbgvar) {
89 if(*(dbgvar-1) == '+') {
90 for(i=0;i<DBG_MAXFILES;i++) {
91 DbgEnabledLvl2GDI32[i] = 1;
92 }
93 }
94 }
95 for(i=0;i<DBG_MAXFILES;i++) {
96 int len = strlen(DbgFileNames[i]);
97 dbgvar = strstr(envvar2, DbgFileNames[i]);
98 if(dbgvar && !islower(dbgvar[len])) {
99 if(*(dbgvar-1) == '-') {
100 DbgEnabledLvl2GDI32[i] = 0;
101 }
102 else
103 if(*(dbgvar-1) == '+') {
104 DbgEnabledLvl2GDI32[i] = 1;
105 }
106 }
107 }
108 }
109}
110//******************************************************************************
111//******************************************************************************
112
113#endif
Note: See TracBrowser for help on using the repository browser.