NetTribute library with debug turned on in FShandler Donatien Garner -> Segundo Equipo -> this version

Committer:
hexley
Date:
Fri Nov 19 01:54:45 2010 +0000
Revision:
0:281d6ff68967

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
hexley 0:281d6ff68967 1 /*
hexley 0:281d6ff68967 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
hexley 0:281d6ff68967 3 * All rights reserved.
hexley 0:281d6ff68967 4 *
hexley 0:281d6ff68967 5 * Redistribution and use in source and binary forms, with or without modification,
hexley 0:281d6ff68967 6 * are permitted provided that the following conditions are met:
hexley 0:281d6ff68967 7 *
hexley 0:281d6ff68967 8 * 1. Redistributions of source code must retain the above copyright notice,
hexley 0:281d6ff68967 9 * this list of conditions and the following disclaimer.
hexley 0:281d6ff68967 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
hexley 0:281d6ff68967 11 * this list of conditions and the following disclaimer in the documentation
hexley 0:281d6ff68967 12 * and/or other materials provided with the distribution.
hexley 0:281d6ff68967 13 * 3. The name of the author may not be used to endorse or promote products
hexley 0:281d6ff68967 14 * derived from this software without specific prior written permission.
hexley 0:281d6ff68967 15 *
hexley 0:281d6ff68967 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
hexley 0:281d6ff68967 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
hexley 0:281d6ff68967 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
hexley 0:281d6ff68967 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
hexley 0:281d6ff68967 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
hexley 0:281d6ff68967 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
hexley 0:281d6ff68967 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
hexley 0:281d6ff68967 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
hexley 0:281d6ff68967 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
hexley 0:281d6ff68967 25 * OF SUCH DAMAGE.
hexley 0:281d6ff68967 26 *
hexley 0:281d6ff68967 27 * This file is part of the lwIP TCP/IP stack.
hexley 0:281d6ff68967 28 *
hexley 0:281d6ff68967 29 * Author: Adam Dunkels <adam@sics.se>
hexley 0:281d6ff68967 30 * Simon Goldschmidt
hexley 0:281d6ff68967 31 *
hexley 0:281d6ff68967 32 */
hexley 0:281d6ff68967 33 #ifndef __LWIP_TIMERS_H__
hexley 0:281d6ff68967 34 #define __LWIP_TIMERS_H__
hexley 0:281d6ff68967 35
hexley 0:281d6ff68967 36 #include "lwip/opt.h"
hexley 0:281d6ff68967 37
hexley 0:281d6ff68967 38 /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */
hexley 0:281d6ff68967 39 #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS))
hexley 0:281d6ff68967 40
hexley 0:281d6ff68967 41 #if LWIP_TIMERS
hexley 0:281d6ff68967 42
hexley 0:281d6ff68967 43 #include "lwip/err.h"
hexley 0:281d6ff68967 44 #include "lwip/sys.h"
hexley 0:281d6ff68967 45
hexley 0:281d6ff68967 46 #ifdef __cplusplus
hexley 0:281d6ff68967 47 extern "C" {
hexley 0:281d6ff68967 48 #endif
hexley 0:281d6ff68967 49
hexley 0:281d6ff68967 50 #ifndef LWIP_DEBUG_TIMERNAMES
hexley 0:281d6ff68967 51 #ifdef LWIP_DEBUG
hexley 0:281d6ff68967 52 #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG
hexley 0:281d6ff68967 53 #else /* LWIP_DEBUG */
hexley 0:281d6ff68967 54 #define LWIP_DEBUG_TIMERNAMES 0
hexley 0:281d6ff68967 55 #endif /* LWIP_DEBUG*/
hexley 0:281d6ff68967 56 #endif
hexley 0:281d6ff68967 57
hexley 0:281d6ff68967 58 /** Function prototype for a timeout callback function. Register such a function
hexley 0:281d6ff68967 59 * using sys_timeout().
hexley 0:281d6ff68967 60 *
hexley 0:281d6ff68967 61 * @param arg Additional argument to pass to the function - set up by sys_timeout()
hexley 0:281d6ff68967 62 */
hexley 0:281d6ff68967 63 typedef void (* sys_timeout_handler)(void *arg);
hexley 0:281d6ff68967 64
hexley 0:281d6ff68967 65 struct sys_timeo {
hexley 0:281d6ff68967 66 struct sys_timeo *next;
hexley 0:281d6ff68967 67 u32_t time;
hexley 0:281d6ff68967 68 sys_timeout_handler h;
hexley 0:281d6ff68967 69 void *arg;
hexley 0:281d6ff68967 70 #if LWIP_DEBUG_TIMERNAMES
hexley 0:281d6ff68967 71 const char* handler_name;
hexley 0:281d6ff68967 72 #endif /* LWIP_DEBUG_TIMERNAMES */
hexley 0:281d6ff68967 73 };
hexley 0:281d6ff68967 74
hexley 0:281d6ff68967 75 void sys_timeouts_init(void);
hexley 0:281d6ff68967 76
hexley 0:281d6ff68967 77 #if LWIP_DEBUG_TIMERNAMES
hexley 0:281d6ff68967 78 void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name);
hexley 0:281d6ff68967 79 #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler)
hexley 0:281d6ff68967 80 #else /* LWIP_DEBUG_TIMERNAMES */
hexley 0:281d6ff68967 81 void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg);
hexley 0:281d6ff68967 82 #endif /* LWIP_DEBUG_TIMERNAMES */
hexley 0:281d6ff68967 83
hexley 0:281d6ff68967 84 void sys_untimeout(sys_timeout_handler handler, void *arg);
hexley 0:281d6ff68967 85 #if NO_SYS
hexley 0:281d6ff68967 86 void sys_check_timeouts(void);
hexley 0:281d6ff68967 87 void sys_restart_timeouts(void);
hexley 0:281d6ff68967 88 #else /* NO_SYS */
hexley 0:281d6ff68967 89 void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg);
hexley 0:281d6ff68967 90 #endif /* NO_SYS */
hexley 0:281d6ff68967 91
hexley 0:281d6ff68967 92
hexley 0:281d6ff68967 93 #ifdef __cplusplus
hexley 0:281d6ff68967 94 }
hexley 0:281d6ff68967 95 #endif
hexley 0:281d6ff68967 96
hexley 0:281d6ff68967 97 #endif /* LWIP_TIMERS */
hexley 0:281d6ff68967 98 #endif /* __LWIP_TIMERS_H__ */