1 /*******************************************************************
2 uLan Utilities Library - C library of basic reusable constructions
4 ul_htimroot.h - hierarchical timer support for root htimer queue
6 (C) Copyright 2003-2009 by Pavel Pisa - Originator
8 The uLan utilities library can be used, copied and modified under
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.
20 See files COPYING and README for details.
22 *******************************************************************/
25 #include "ul_htimer.h"
27 #ifdef UL_HTIMER_WITH_STD_TYPE
29 ul_root_htimer_ops_t *ul_root_htimer_ops;
31 int ul_root_htimer_add(ul_htimer_t *timer)
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);
40 int ul_root_htimer_detach(ul_htimer_t *timer)
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);
49 int ul_root_htimer_init(int options, void *context)
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);
56 #endif /*UL_HTIMER_WITH_STD_TYPE*/