]> rtime.felk.cvut.cz Git - ulut.git/blob - ulut/ul_htimroot.c
Fix compilation on GCC 4.7 for ARM ABI.
[ulut.git] / ulut / ul_htimroot.c
1 /*******************************************************************
2   uLan Utilities Library - C library of basic reusable constructions
3
4   ul_htimroot.h  - hierarchical timer support for root htimer queue
5
6   (C) Copyright 2003-2009 by Pavel Pisa - Originator
7
8   The uLan utilities library can be used, copied and modified under
9   next licenses
10     - GPL - GNU General Public License
11     - LGPL - GNU Lesser General Public License
12     - MPL - Mozilla Public License
13     - and other licenses added by project originators
14   Code can be modified and re-distributed under any combination
15   of the above listed licenses. If contributor does not agree with
16   some of the licenses, he/she can delete appropriate line.
17   Warning, if you delete all lines, you are not allowed to
18   distribute source code and/or binaries utilizing code.
19   
20   See files COPYING and README for details.
21
22  *******************************************************************/
23
24 #include <string.h>
25 #include "ul_htimer.h"
26
27 #ifdef UL_HTIMER_WITH_STD_TYPE
28
29 ul_root_htimer_ops_t *ul_root_htimer_ops;
30
31 int ul_root_htimer_add(ul_htimer_t *timer)
32 {
33   int ret;
34   ul_htimer_queue_t *root_htimer = ul_root_htimer_get(0, NULL);
35   ret = ul_htimer_add(root_htimer, timer);
36   ul_root_htimer_put(root_htimer);
37   return ret;
38 }
39
40 int ul_root_htimer_detach(ul_htimer_t *timer)
41 {
42   int ret;
43   ul_htimer_queue_t *root_htimer = ul_root_htimer_get(0, NULL);
44   ret = ul_htimer_detach(root_htimer, timer);
45   ul_root_htimer_put(root_htimer);
46   return ret;
47 }
48
49 int ul_root_htimer_init(int options, void *context)
50 {
51   if(ul_root_htimer_ops == NULL)
52     ul_root_htimer_ops = ul_root_htimer_ops_compile_default;
53   return ul_root_htimer_ops->timer_root_init(options, context);
54 }
55
56 #endif /*UL_HTIMER_WITH_STD_TYPE*/