Annotation of embedaddon/bmon/src/in_null.c, revision 1.1.1.2

1.1       misho       1: /*
                      2:  * in_null.c               Null Input Method
                      3:  *
1.1.1.2 ! misho       4:  * Copyright (c) 2001-2013 Thomas Graf <tgraf@suug.ch>
        !             5:  * Copyright (c) 2013 Red Hat, Inc.
1.1       misho       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/input.h>
                     28: #include <bmon/utils.h>
                     29: 
                     30: static void null_read(void)
                     31: {
1.1.1.2 ! misho      32:        DBG("null: reading...");
1.1       misho      33: }
                     34: 
                     35: static void print_help(void)
                     36: {
                     37:        printf(
                     38:        "null - Do not collect statistics at all\n" \
                     39:        "\n" \
1.1.1.2 ! misho      40:        "  Will not collect any statistics at all, used to disable \n" \
1.1       misho      41:        "  local statistics collection.\n" \
                     42:        "  Author: Thomas Graf <tgraf@suug.ch>\n");
                     43: }
                     44: 
1.1.1.2 ! misho      45: static void null_parse_opt(const char *type, const char *value)
1.1       misho      46: {
1.1.1.2 ! misho      47:        if (!strcasecmp(type, "help")) {
        !            48:                print_help();
        !            49:                exit(0);
1.1       misho      50:        }
                     51: }
                     52: 
1.1.1.2 ! misho      53: static struct bmon_module null_ops = {
        !            54:        .m_name                 = "null",
        !            55:        .m_do                   = null_read,
        !            56:        .m_parse_opt            = null_parse_opt,
1.1       misho      57: };
                     58: 
                     59: static void __init null_init(void)
                     60: {
1.1.1.2 ! misho      61:        input_register(&null_ops);
1.1       misho      62: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>