1
/* $Id: plugin_event.c -1 $
2
* $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/plugin_event.c $
6
* Copyright (C) 2003 Ed Martin <edman007@edman007.com>
7
* Copyright (C) 2004, 2005, 2006, 2007, 2008 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
9
* This file is part of LCD4Linux.
11
* LCD4Linux is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2, or (at your option)
16
* LCD4Linux is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
21
* You should have received a copy of the GNU General Public License
22
* along with this program; if not, write to the Free Software
23
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
* int plugin_init_event (void)
31
* adds various functions
36
/* define the include files you need */
43
/* these should always be included */
54
/* function 'trigger' */
55
/* takes one argument, a string */
56
/* triggers the event */
58
static void my_trigger(RESULT * result, RESULT * arg1)
63
/* R2N stands for 'Result to Number' */
65
named_event_trigger(param);
70
/* when called with R_NUMBER, it assumes the */
71
/* next parameter to be a pointer to double */
72
SetResult(&result, R_NUMBER, &value);
76
/* plugin initialization */
77
/* MUST NOT be declared 'static'! */
78
int plugin_init_event(void)
81
/* register all our cool functions */
82
/* the second parameter is the number of arguments */
83
/* -1 stands for variable argument list */
84
AddFunction("event::trigger", 1, my_trigger);
90
void plugin_exit_event(void)
92
/* free any allocated memory */
93
/* close filedescriptors */