1
/* $Id: event.h 840 2007-09-09 12:17:42Z michael $
2
* $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/event.h $
4
* generic timer handling
6
* Copyright (C) 2009 Ed Martin <edman007@edman007.com>
7
* Copyright (C) 2009 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.
33
//events are identified by their file descriptor only
36
* these functions allow plugins to add event hooks
37
* (and thus break out of the main loop when sleeping)
38
* these callbacks than then trigger named events to propagate
39
* the event to the screen
50
int event_add(void (*callback) (event_flags_t flags, void *data), void *data, const int fd, const int read,
51
const int write, const int active);
52
int event_del(const int fd);
53
int event_modify(const int fd, const int read, const int write, const int active);
54
int event_process(const struct timespec *timeout);
55
void event_exit(void);
58
* These fuctions keep a list of the events to trigger on allowing multiple
59
* things to trigger an event and multiple things to receive the event
62
//add an event to be triggered
63
int named_event_add(char *event, void (*callback) (void *data), void *data);
64
//remove an event from the list of events
65
int named_event_del(char *event, void (*callback) (void *data), void *data);
66
int named_event_trigger(char *event); //call all calbacks for this event