]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - db/debug.c
Update copyright/license notices to match SGI legal prefered boilerplate.
[thirdparty/xfsprogs-dev.git] / db / debug.c
1 /*
2 * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 #include <xfs/libxfs.h>
20 #include "command.h"
21 #include "debug.h"
22 #include "output.h"
23
24 static int debug_f(int argc, char **argv);
25
26 static const cmdinfo_t debug_cmd =
27 { "debug", NULL, debug_f, 0, 1, 0, "[flagbits]",
28 "set debug option bits", NULL };
29
30 long debug_state;
31
32 static int
33 debug_f(
34 int argc,
35 char **argv)
36 {
37 char *p;
38
39 if (argc > 1) {
40 debug_state = strtol(argv[1], &p, 0);
41 if (*p != '\0') {
42 dbprintf("bad value for debug %s\n", argv[1]);
43 return 0;
44 }
45 }
46 dbprintf("debug = %ld\n", debug_state);
47 return 0;
48 }
49
50 void
51 debug_init(void)
52 {
53 add_command(&debug_cmd);
54 }