/[dynamips]/upstream/dynamips-0.2.5/ptask.h
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /upstream/dynamips-0.2.5/ptask.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Sat Oct 6 16:01:44 2007 UTC (16 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 799 byte(s)
import 0.2.5 from upstream

1 /*
2 * Cisco 7200 (Predator) simulation platform.
3 * Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr)
4 *
5 * Periodic tasks centralization.
6 */
7
8 #ifndef __PTASK_H__
9 #define __PTASK_H__
10
11 #include <sys/types.h>
12 #include <sys/socket.h>
13 #include <sys/un.h>
14 #include "utils.h"
15
16 /* ptask identifier */
17 typedef m_int64_t ptask_id_t;
18
19 /* periodic task callback prototype */
20 typedef int (*ptask_callback)(void *object,void *arg);
21
22 /* periodic task definition */
23 typedef struct ptask ptask_t;
24 struct ptask {
25 ptask_id_t id;
26 ptask_t *next;
27 ptask_callback cbk;
28 void *object,*arg;
29 };
30
31 /* Add a new task */
32 ptask_id_t ptask_add(ptask_callback cbk,void *object,void *arg);
33
34 /* Remove a task */
35 int ptask_remove(ptask_id_t id);
36
37 /* Initialize ptask module */
38 int ptask_init(u_int sleep_time);
39
40 #endif

  ViewVC Help
Powered by ViewVC 1.1.26