00001 00027 /* 00028 * Copyright (c) 2004, Swedish Institute of Computer Science. 00029 * All rights reserved. 00030 * 00031 * Redistribution and use in source and binary forms, with or without 00032 * modification, are permitted provided that the following conditions 00033 * are met: 00034 * 1. Redistributions of source code must retain the above copyright 00035 * notice, this list of conditions and the following disclaimer. 00036 * 2. Redistributions in binary form must reproduce the above copyright 00037 * notice, this list of conditions and the following disclaimer in the 00038 * documentation and/or other materials provided with the distribution. 00039 * 3. Neither the name of the Institute nor the names of its contributors 00040 * may be used to endorse or promote products derived from this software 00041 * without specific prior written permission. 00042 * 00043 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00044 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00045 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00046 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00047 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00048 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00049 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00050 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00051 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00052 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00053 * SUCH DAMAGE. 00054 * 00055 * This file is part of the uIP TCP/IP stack 00056 * 00057 * Author: Adam Dunkels <adam@sics.se> 00058 * 00059 * $Id: timer.h,v 1.3 2006/06/11 21:46:39 adam Exp $ 00060 */ 00061 #ifndef __TIMER_H__ 00062 #define __TIMER_H__ 00063 00064 #include "clock.h" 00065 00074 struct timer { 00075 clock_time_t start; 00076 clock_time_t interval; 00077 }; 00078 00079 void timer_set(struct timer *t, clock_time_t interval); 00080 void timer_reset(struct timer *t); 00081 void timer_restart(struct timer *t); 00082 int timer_expired(struct timer *t); 00083 00084 #endif /* __TIMER_H__ */ 00085