File: debug.cc

package info (click to toggle)
gri 2.4.2-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 4,540 kB
  • ctags: 1,966
  • sloc: cpp: 32,542; lisp: 3,243; perl: 806; makefile: 548; sh: 253
file content (50 lines) | stat: -rw-r--r-- 998 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include	<string>
#include	<stdio.h>
#include	<math.h>
#include	<ctype.h>
#include	"gr.hh"
#include	"debug.hh"
#include	"extern.hh"

int
debugCmd()
{
    int             debug;
    switch (_nword) {
    case 2:
	/* debug .n.|off */
	if (!strcmp(_word[1], "off")) {
	    debug = 0;
	    PUT_VAR("..debug..", debug);
	    _debugFlag = 0;
	    return 1;
	}
	getinum(_word[1], &debug);
	break;
    case 1:
	/* `debug' -- equivalent to `debug 1' */
	debug = 1;
	_debugFlag = 1;
	break;
    case 6:
	/* `debug clipped values in draw commands' */
	if (!strcmp(_word[1], "clipped")
	    && !strcmp(_word[2], "values")
	    && !strcmp(_word[3], "in")
	    && !strcmp(_word[4], "draw")
	    && !strcmp(_word[5], "commands")) {
	    _debugFlag |= DEBUG_CLIPPED;
	    return 1;
	} else {
	    demonstrate_command_usage();
	    err("Can't understand command.");
	    return 0;
	}
    default:
	demonstrate_command_usage();
	NUMBER_WORDS_ERROR;
	return 0;
    }
    PUT_VAR("..debug..", debug);
    return 1;
}