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

1.1       misho       1: /*
                      2:  * in_null.c               Null Input Method
                      3:  *
                      4:  * Copyright (c) 2001-2005 Thomas Graf <tgraf@suug.ch>
                      5:  *
                      6:  * Permission is hereby granted, free of charge, to any person obtaining a
                      7:  * copy of this software and associated documentation files (the "Software"),
                      8:  * to deal in the Software without restriction, including without limitation
                      9:  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
                     10:  * and/or sell copies of the Software, and to permit persons to whom the
                     11:  * Software is furnished to do so, subject to the following conditions:
                     12:  *
                     13:  * The above copyright notice and this permission notice shall be included
                     14:  * in all copies or substantial portions of the Software.
                     15:  *
                     16:  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
                     17:  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
                     19:  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
                     20:  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
                     21:  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
                     22:  * DEALINGS IN THE SOFTWARE.
                     23:  */
                     24: 
                     25: #include <bmon/bmon.h>
                     26: #include <bmon/input.h>
                     27: #include <bmon/utils.h>
                     28: 
                     29: static void null_read(void)
                     30: {
                     31: }
                     32: 
                     33: static void print_help(void)
                     34: {
                     35:        printf(
                     36:        "null - Do not collect statistics at all\n" \
                     37:        "\n" \
                     38:        "  Will not collect any statistics at all, may be used to disable \n" \
                     39:        "  local statistics collection.\n" \
                     40:        "  Author: Thomas Graf <tgraf@suug.ch>\n");
                     41: }
                     42: 
                     43: static void null_set_opts(tv_t *attrs)
                     44: {
                     45:        while (attrs) {
                     46:                if (!strcasecmp(attrs->type, "help")) {
                     47:                        print_help();
                     48:                        exit(0);
                     49:                }
                     50:                attrs = attrs->next;
                     51:        }
                     52: }
                     53: 
                     54: static int null_probe(void)
                     55: {
                     56:        return 1;
                     57: }
                     58: 
                     59: static struct input_module null_ops = {
                     60:        .im_name = "null",
                     61:        .im_read = null_read,
                     62:        .im_set_opts = null_set_opts,
                     63:        .im_probe = null_probe,
                     64:        .im_no_default = 1,
                     65: };
                     66: 
                     67: static void __init null_init(void)
                     68: {
                     69:        register_input_module(&null_ops);
                     70: }

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