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

1.1       misho       1: /*
                      2:  * out_null.c            Null Output
                      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/output.h>
                     27: #include <bmon/utils.h>
                     28: 
                     29: static void
                     30: null_draw(void)
                     31: {
                     32: }
                     33: 
                     34: static int
                     35: null_probe(void)
                     36: {
                     37:        return 1;
                     38: }
                     39: 
                     40: static void
                     41: print_help(void)
                     42: {
                     43:        printf(
                     44:                "null - No output\n" \
                     45:                "\n" \
                     46:                "  Disable primary output method\n" \
                     47:                "  Author: Thomas Graf <tgraf@suug.ch>\n" \
                     48:                "\n");
                     49: }
                     50: 
                     51: static void
                     52: null_set_opts(tv_t *attrs)
                     53: {
                     54:        while (attrs) {
                     55:                if (!strcasecmp(attrs->type, "help")) {
                     56:                        print_help();
                     57:                        exit(0);
                     58:                }
                     59:                
                     60:                attrs = attrs->next;
                     61:        }
                     62: }
                     63: 
                     64: static struct output_module null_ops = {
                     65:        .om_name = "null",
                     66:        .om_draw = null_draw,
                     67:        .om_probe = null_probe,
                     68:        .om_set_opts = null_set_opts,
                     69: };
                     70: 
                     71: #if defined PRAGMA_FALLBACK
                     72: #pragma init (null_init)
                     73: #endif
                     74: 
                     75: static void __init
                     76: null_init(void)
                     77: {
                     78:        register_output_module(&null_ops);
                     79: }

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