1: /*
2: * out_null.c Null Output
3: *
4: * Copyright (c) 2001-2013 Thomas Graf <tgraf@suug.ch>
5: * Copyright (c) 2013 Red Hat, Inc.
6: *
7: * Permission is hereby granted, free of charge, to any person obtaining a
8: * copy of this software and associated documentation files (the "Software"),
9: * to deal in the Software without restriction, including without limitation
10: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11: * and/or sell copies of the Software, and to permit persons to whom the
12: * Software is furnished to do so, subject to the following conditions:
13: *
14: * The above copyright notice and this permission notice shall be included
15: * in all copies or substantial portions of the Software.
16: *
17: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20: * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23: * DEALINGS IN THE SOFTWARE.
24: */
25:
26: #include <bmon/bmon.h>
27: #include <bmon/output.h>
28: #include <bmon/utils.h>
29:
30: static void print_help(void)
31: {
32: printf(
33: "null - No output\n" \
34: "\n" \
35: " Disable primary output method\n" \
36: " Author: Thomas Graf <tgraf@suug.ch>\n" \
37: "\n");
38: }
39:
40: static void null_parse_opt(const char *type, const char *value)
41: {
42: if (!strcasecmp(type, "help")) {
43: print_help();
44: exit(0);
45: }
46: }
47:
48: static struct bmon_module null_ops = {
49: .m_name = "null",
50: .m_parse_opt = null_parse_opt,
51: };
52:
53: static void __init null_init(void)
54: {
55: output_register(&null_ops);
56: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>