/[cvs]/eggdrop1.9/src/egg_timer.h
ViewVC logotype

Contents of /eggdrop1.9/src/egg_timer.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (show annotations) (download) (as text)
Sun May 5 16:40:38 2002 UTC (17 years, 5 months ago) by tothwolf
Branch: MAIN
Changes since 1.4: +25 -1 lines
File MIME type: text/x-csrc
Grafted GPL header onto newer files.
Storing rcsid in binary files now.

1 /*
2 * egg_timer.h --
3 */
4 /*
5 * Copyright (C) 2002 Eggheads Development Team
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21 /*
22 * $Id$
23 */
24
25 #ifndef _EGG_TIMER_H
26 #define _EGG_TIMER_H
27
28 typedef struct egg_timeval_b {
29 int sec;
30 int usec;
31 } egg_timeval_t;
32
33 #define TIMER_REPEAT 1
34
35 /* Create a simple timer with no client data and no flags. */
36 #define timer_create(howlong,callback) timer_create_complex(howlong, callback, NULL, 0)
37
38 /* Create a simple timer with no client data, but it repeats. */
39 #define timer_create_repeater(howlong,callback) timer_create_complex(howlong, callback, NULL, TIMER_REPEAT)
40
41 extern void timer_init();
42 extern int timer_get_time(egg_timeval_t *curtime);
43 extern int timer_diff(egg_timeval_t *from_time, egg_timeval_t *to_time, egg_timeval_t *diff);
44 extern int timer_create_complex(egg_timeval_t *howlong, Function callback, void *client_data, int flags);
45 extern int timer_destroy(int timer_id);
46 extern int timer_destroy_all();
47 extern int timer_get_shortest(egg_timeval_t *howlong);
48 extern int timer_run();
49
50 #endif /* !_EGG_TIMER_H */

webmaster@eggheads.org
ViewVC Help
Powered by ViewVC 1.1.23