Browse Source

Doxygen updates on timer modules

- changing from \ and ! to javadoc format
- adding new  doxygen file headers
oej 16 years ago
parent
commit
08aaf73050
6 changed files with 77 additions and 67 deletions
  1. 8 13
      timer.c
  2. 3 8
      timer.h
  3. 26 17
      timer_funcs.h
  4. 8 5
      timer_proc.c
  5. 12 6
      timer_proc.h
  6. 20 18
      timer_ticks.h

+ 8 - 13
timer.c

@@ -3,19 +3,14 @@
  *
  * Copyright (C) 2001-2003 FhG Fokus
  *
- * This file is part of ser, a free SIP server.
+ * This file is part of SIP-router, a free SIP server.
  *
- * ser is free software; you can redistribute it and/or modify
+ * SIP-router is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
- * For a license to use the ser software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- *    [email protected]
- *
- * ser is distributed in the hope that it will be useful,
+ * SIP-router is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
@@ -38,11 +33,11 @@
  */
 
 
-/*!
- * \file
- * \brief SIP-router core :: 
- * \ingroup core
- * Module: \ref core
+/**
+ * @file
+ * @brief SIP-router core :: 
+ * @ingroup core
+ * Module: @ref core
  */
 
 #include "timer.h"

+ 3 - 8
timer.h

@@ -6,19 +6,14 @@
  *
  * Copyright (C) 2001-2003 FhG Fokus
  *
- * This file is part of ser, a free SIP server.
+ * This file is part of SIP-router, a free SIP server.
  *
- * ser is free software; you can redistribute it and/or modify
+ * SIP-router is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
- * For a license to use the ser software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- *    [email protected]
- *
- * ser is distributed in the hope that it will be useful,
+ * SIP-router is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.

+ 26 - 17
timer_funcs.h

@@ -6,19 +6,14 @@
  *
  * Copyright (C) 2005 iptelorg GmbH
  *
- * This file is part of ser, a free SIP server.
+ * This file is part of SIP-router, a free SIP server.
  *
- * ser is free software; you can redistribute it and/or modify
+ * SIP-router is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
- * For a license to use the ser software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- *    [email protected]
- *
- * ser is distributed in the hope that it will be useful,
+ * SIP-router is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
@@ -27,11 +22,19 @@
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
+
 /* History:
  * --------
  *  2005-07-27  complete re-design/re-implemnetation (andrei)
  */
 
+/**
+ * @file
+ * @brief SIP-router core :: Timer related functions (internal)
+ * @ingroup core
+ * Module: @ref core
+ */
+
 
 #ifndef timer_funcs_h
 #define timer_funcs_h
@@ -46,23 +49,27 @@ struct timer_head{
 
 
 
-/* hierarchical timing wheel with 3 levels
+/** @name hierarchical timing wheel with 3 levels
+ *
  * Most timeouts should go in the first "wheel" (h0)
  * h0 will contain timers expiring from crt. time up to
  * crt. time + (1<<H0_BITS)/TICKS_HZ s and will use
  * (1<<H0_BITS)*sizeof(struct timer_head) bytes of memory, so arrange it
  * accordingly
- */
-
-#define H0_BITS 14
-#define H1_BITS  9 
-#define H2_BITS  (32-H1_BITS-H0_BITS)
-/* Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10
+ *
+x* Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10
  * holds ~ 30 min in the first hash/wheel and ~233h in the first two.
  * More perfomant arrangement: 16, 8, 8 (but eats 1 MB on a 64 bit system, and
  *  512K on a 32 bit one). For TICKS_HZ=10 it holds almost 2h in the
  *  first hash/wheel and ~460h in the first two.
  */
+ */
+/*@{ */
+
+#define H0_BITS 14
+#define H1_BITS  9 
+#define H2_BITS  (32-H1_BITS-H0_BITS)
+
 
 #define H0_ENTRIES (1<<H0_BITS)
 #define H1_ENTRIES (1<<H1_BITS)
@@ -72,6 +79,7 @@ struct timer_head{
 #define H1_MASK (H1_ENTRIES-1)
 #define H1_H0_MASK ((1<<(H0_BITS+H1_BITS))-1)
 
+/*@} */
 
 struct timer_lists{
 	struct timer_head  h0[H0_ENTRIES];
@@ -99,7 +107,8 @@ extern struct timer_lists* timer_lst;
 
 
 
-/* generic add timer entry to the timer lists function (see _timer_add)
+/** @brief generic add timer entry to the timer lists function (see _timer_add)
+ *
  * tl->expire must be set previously, delta is the difference in ticks
  * from current time to the timer desired expire (should be tl->expire-*tick)
  * If you don't know delta, you probably want to call _timer_add instead.
@@ -193,7 +202,7 @@ static inline void timer_lst_mv1(ticks_t t, struct timer_head* h)
 }
 
 
-/* possible faster version */
+/** @brief possible faster version */
 static inline void timer_run(ticks_t t)
 {
 	/* trust the compiler for optimizing */

+ 8 - 5
timer_proc.c

@@ -25,11 +25,14 @@
  *  2009-03-10  initial version (andrei)
 */
 
-/*!
- * \file
- * \brief SIP-router core :: 
- * \ingroup core
- * Module: \ref core
+/**
+ * @file
+ * @brief SIP-router core ::  timer - separate process timers
+ *
+ *  (unrelated to the main fast and slow timers)
+ *
+ * @ingroup core
+ * Module: @ref core
  */
 
 #include "timer_proc.h"

+ 12 - 6
timer_proc.h

@@ -15,26 +15,32 @@
  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
-/*
- * timer_proc.h - separate process timers
- * (unrelated to the main fast and slow timers)
- */
+
 /*
  * History:
  * --------
  *  2009-03-10  initial version (andrei)
 */
 
+/**
+ * @file
+ * @brief SIP-router core :: timer_proc.h - separate process timers
+ *
+ * (unrelated to the main fast and slow timers)
+ * @ingroup core
+ * Module: @ref core
+ */
+
 #ifndef __timer_proc_h
 #define __timer_proc_h
 
 #include "local_timer.h"
 
-/* forks a separate simple sleep() periodic timer */
+/** @brief forks a separate simple sleep() periodic timer */
 int fork_dummy_timer(int child_id, char* desc, int make_sock,
 						timer_function* f, void* param, int interval);
 
-/* forks a timer process based on the local timer */
+/** @briefforks a timer process based on the local timer */
 int fork_local_timer_process(int child_id, char* desc, int make_sock,
 						struct local_timer** lt_h);
 

+ 20 - 18
timer_ticks.h

@@ -6,19 +6,14 @@
  *
  * Copyright (C) 2005 iptelorg GmbH
  *
- * This file is part of ser, a free SIP server.
+ * This file is part of SIP-router, a free SIP server.
  *
- * ser is free software; you can redistribute it and/or modify
+ * SIP-router is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
- * For a license to use the ser software under conditions
- * other than those described here, or to purchase support for this
- * software, please contact iptel.org by e-mail at the following addresses:
- *    [email protected]
- *
- * ser is distributed in the hope that it will be useful,
+ * SIP-router is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
@@ -33,38 +28,45 @@
  *  2007-07-02  added ticks comparison macros (andrei)
  */
 
+/**
+ * @file
+ * @brief SIP-router core :: timer frequency and ticks conversions
+ * @ingroup core
+ * Module: @ref core
+ */
+
 #ifndef _timer_ticks_h
 #define _timer_ticks_h
 
-/* how many ticks per second (must >1 and < 100 (on linux x86))
+/** @brief how many ticks per second (must >1 and < 100 (on linux x86))
  * recomended values >=8, <=32 (a 2^k value is better/faster)*/
 #define TIMER_TICKS_HZ	16U
 
-/* how many ticks per m milliseconds? (rounded up) */
+/** @brief how many ticks per m milliseconds? (rounded up) */
 #define MS_TO_TICKS(m)  (((m)*TIMER_TICKS_HZ+999U)/1000U)
 
 
-/* how many ticks per s seconds? */
+/** @brief how many ticks per s seconds? */
 #define S_TO_TICKS(s)	((s)*TIMER_TICKS_HZ)
 
 
-/* how many s pe per t ticks, integer value */
+/** @brief how many s pe per t ticks, integer value */
 #define TICKS_TO_S(t)	((t)/TIMER_TICKS_HZ)
 
-/* how many ms per t ticks, integer value */
+/** @brief how many ms per t ticks, integer value */
 #define TICKS_TO_MS(t) (((t)*1000U)/TIMER_TICKS_HZ)
 
 
-/* ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
+/** @brief ticks comparison operations: t1 OP t2, where OP can be <, >, <=, >= */
 #define TICKS_CMP_OP(t1, t2, OP) \
 	(((s_ticks_t)((ticks_t)(t1)-(ticks_t)(t2))) OP (s_ticks_t)0)
-/* t1 < t2 */
+/** @brief t1 < t2 */
 #define TICKS_LT(t1, t2)  TICKS_CMP_OP(t1, t2, <)
-/* t1 <= t2 */
+/** @brief t1 <= t2 */
 #define TICKS_LE(t1, t2)  TICKS_CMP_OP(t1, t2, <=)
-/* t1 > t2 */
+/** @brief t1 > t2 */
 #define TICKS_GT(t1, t2)  TICKS_CMP_OP(t1, t2, >)
-/* t1 >= t2 */
+/** @brief t1 >= t2 */
 #define TICKS_GE(t1, t2)  TICKS_CMP_OP(t1, t2, >=)