--- embedaddon/bmon/src/in_null.c 2012/02/21 22:19:56 1.1.1.1 +++ embedaddon/bmon/src/in_null.c 2014/07/30 07:55:27 1.1.1.2 @@ -1,7 +1,8 @@ /* * in_null.c Null Input Method * - * Copyright (c) 2001-2005 Thomas Graf + * Copyright (c) 2001-2013 Thomas Graf + * Copyright (c) 2013 Red Hat, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -28,6 +29,7 @@ static void null_read(void) { + DBG("null: reading..."); } static void print_help(void) @@ -35,36 +37,26 @@ static void print_help(void) printf( "null - Do not collect statistics at all\n" \ "\n" \ - " Will not collect any statistics at all, may be used to disable \n" \ + " Will not collect any statistics at all, used to disable \n" \ " local statistics collection.\n" \ " Author: Thomas Graf \n"); } -static void null_set_opts(tv_t *attrs) +static void null_parse_opt(const char *type, const char *value) { - while (attrs) { - if (!strcasecmp(attrs->type, "help")) { - print_help(); - exit(0); - } - attrs = attrs->next; + if (!strcasecmp(type, "help")) { + print_help(); + exit(0); } } -static int null_probe(void) -{ - return 1; -} - -static struct input_module null_ops = { - .im_name = "null", - .im_read = null_read, - .im_set_opts = null_set_opts, - .im_probe = null_probe, - .im_no_default = 1, +static struct bmon_module null_ops = { + .m_name = "null", + .m_do = null_read, + .m_parse_opt = null_parse_opt, }; static void __init null_init(void) { - register_input_module(&null_ops); + input_register(&null_ops); }