source: trunk/src/gdi32/dbglocal.cpp@ 8871

Last change on this file since 8871 was 8871, checked in by sandervl, 23 years ago

Handle management updates

File size: 2.4 KB
Line 
1/* $Id: dbglocal.cpp,v 1.8 2002-07-15 10:02:28 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 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};
45//******************************************************************************
46//******************************************************************************
47void ParseLogStatusGDI32()
48{
49 char *envvar = getenv(DBG_ENVNAME);
50 char *envvar2= getenv(DBG_ENVNAME_LVL2);
51 char *dbgvar;
52 int i;
53
54 for(i=0;i<DBG_MAXFILES;i++) {
55 DbgEnabledGDI32[i] = 1;
56 }
57
58 if(!envvar)
59 return;
60
61 dbgvar = strstr(envvar, "dll");
62 if(dbgvar) {
63 if(*(dbgvar-1) == '-') {
64 for(i=0;i<DBG_MAXFILES;i++) {
65 DbgEnabledGDI32[i] = 0;
66 }
67 }
68 }
69 for(i=0;i<DBG_MAXFILES;i++) {
70 int len = strlen(DbgFileNames[i]);
71 dbgvar = strstr(envvar, DbgFileNames[i]);
72 if(dbgvar && !islower(dbgvar[len])) {
73 if(*(dbgvar-1) == '-') {
74 DbgEnabledGDI32[i] = 0;
75 }
76 else
77 if(*(dbgvar-1) == '+') {
78 DbgEnabledGDI32[i] = 1;
79 }
80 }
81 }
82 if(envvar2) {
83 dbgvar = strstr(envvar2, "dll");
84 if(dbgvar) {
85 if(*(dbgvar-1) == '+') {
86 for(i=0;i<DBG_MAXFILES;i++) {
87 DbgEnabledLvl2GDI32[i] = 1;
88 }
89 }
90 }
91 for(i=0;i<DBG_MAXFILES;i++) {
92 int len = strlen(DbgFileNames[i]);
93 dbgvar = strstr(envvar2, DbgFileNames[i]);
94 if(dbgvar && !islower(dbgvar[len])) {
95 if(*(dbgvar-1) == '-') {
96 DbgEnabledLvl2GDI32[i] = 0;
97 }
98 else
99 if(*(dbgvar-1) == '+') {
100 DbgEnabledLvl2GDI32[i] = 1;
101 }
102 }
103 }
104 }
105}
106//******************************************************************************
107//******************************************************************************
108
109#endif
Note: See TracBrowser for help on using the repository browser.