2 * Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of version 2 of the GNU General Public License as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it would be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * Further, this software is distributed without any warranty that it is
13 * free of the rightful claim of any third person regarding infringement
14 * or the like. Any license provided herein, whether implied or
15 * otherwise, applies only to this software file. Patent licenses, if
16 * any, provided herein do not apply to combinations of this program with
17 * other software, or any other product whatsoever.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write the Free Software Foundation, Inc., 59
21 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
23 * Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
24 * Mountain View, CA 94043, or:
28 * For further information regarding this notice, see:
30 * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
33 /* $Id: debug.c,v 1.1 2000/09/21 21:35:06 alaffin Exp $ */
40 int Debug
[MAXDEBUG
]; /* Debug level in their areas */
44 * set debug areas & levels
46 * Syntax: area[,area]:level[,area[,area]:level]...
49 set_debug(char *optarg
)
52 /* pointers to the debug area and level in the option's arguments */
53 char *d_area
, *d_level
;
54 /* debug area and level after converted to integers */
55 int db_area
, db_level
;
60 d_level
= strchr(d_area
,':');
62 db_level
= atoi(d_level
);
65 if(db_area
> MAXDEBUG
) {
66 printf("Error - Debug area %s > maximum of %d\n", d_area
,
71 while(d_area
!= NULL
) {
72 db_area
= atoi(d_area
);
73 printf("Debug area %d set to %d\n", db_area
, db_level
);
74 Debug
[db_area
] = db_level
;
75 if((d_area
= strchr(d_area
, ',')) != NULL
)
78 if( (d_area
= strchr(d_level
, ',')) == NULL
)
82 printf("Debugging is not enabled. -D has been ignored\n");