Rev | Line | |
---|
[3198] | 1 | /* $Id: dbglocal.cpp,v 1.1 2000-03-22 20:01:05 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 "dbglocal.h"
|
---|
| 15 |
|
---|
| 16 | #ifdef DEBUG
|
---|
| 17 |
|
---|
| 18 | USHORT DbgEnabled[DBG_MAXFILES];
|
---|
| 19 | char *DbgFileNames[DBG_MAXFILES] =
|
---|
| 20 | {
|
---|
| 21 | "initterm",
|
---|
| 22 | "wsastruct",
|
---|
| 23 | "wsock32",
|
---|
| 24 | "unknown",
|
---|
| 25 | "async",
|
---|
| 26 | "asyncthread",
|
---|
| 27 | "wsa"
|
---|
| 28 | };
|
---|
| 29 | //******************************************************************************
|
---|
| 30 | //******************************************************************************
|
---|
| 31 | void ParseLogStatus()
|
---|
| 32 | {
|
---|
| 33 | char *envvar = getenv(DBG_ENVNAME);
|
---|
| 34 | char *dbgvar;
|
---|
| 35 | int i;
|
---|
| 36 |
|
---|
| 37 | for(i=0;i<DBG_MAXFILES;i++) {
|
---|
| 38 | DbgEnabled[i] = 1;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | if(!envvar)
|
---|
| 42 | return;
|
---|
| 43 |
|
---|
| 44 | dbgvar = strstr(envvar, "dll");
|
---|
| 45 | if(dbgvar) {
|
---|
| 46 | if(*(dbgvar-1) == '-') {
|
---|
| 47 | for(i=0;i<DBG_MAXFILES;i++) {
|
---|
| 48 | DbgEnabled[i] = 0;
|
---|
| 49 | }
|
---|
| 50 | }
|
---|
| 51 | }
|
---|
| 52 | for(i=0;i<DBG_MAXFILES;i++) {
|
---|
| 53 | dbgvar = strstr(envvar, DbgFileNames[i]);
|
---|
| 54 | if(dbgvar) {
|
---|
| 55 | if(*(dbgvar-1) == '-') {
|
---|
| 56 | DbgEnabled[i] = 0;
|
---|
| 57 | }
|
---|
| 58 | else
|
---|
| 59 | if(*(dbgvar-1) == '+') {
|
---|
| 60 | DbgEnabled[i] = 1;
|
---|
| 61 | }
|
---|
| 62 | }
|
---|
| 63 | }
|
---|
| 64 | }
|
---|
| 65 | //******************************************************************************
|
---|
| 66 | //******************************************************************************
|
---|
| 67 |
|
---|
| 68 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.