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