00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2009 John E. Stone 00004 *cr 00005 ***************************************************************************/ 00006 /*************************************************************************** 00007 * RCS INFORMATION: 00008 * 00009 * $RCSfile: WKFUtils.h,v $ 00010 * $Author: johns $ $Locker: $ $State: Exp $ 00011 * $Revision: 1.1 $ $Date: 2009/10/26 14:59:45 $ 00012 * 00013 ***************************************************************************/ 00014 /* 00015 * Copyright (c) 1994-2009 John E. Stone 00016 * All rights reserved. 00017 * 00018 * Redistribution and use in source and binary forms, with or without 00019 * modification, are permitted provided that the following conditions 00020 * are met: 00021 * 1. Redistributions of source code must retain the above copyright 00022 * notice, this list of conditions and the following disclaimer. 00023 * 2. Redistributions in binary form must reproduce the above copyright 00024 * notice, this list of conditions and the following disclaimer in the 00025 * documentation and/or other materials provided with the distribution. 00026 * 3. The name of the author may not be used to endorse or promote products 00027 * derived from this software without specific prior written permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 00030 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00031 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00032 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 00033 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00034 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00035 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00036 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00038 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00039 * SUCH DAMAGE. 00040 */ 00041 00042 #ifndef WKF_UTILS_INC 00043 #define WKF_UTILS_INC 1 00044 00045 #ifdef __cplusplus 00046 extern "C" { 00047 #endif 00048 00049 typedef void * wkf_timerhandle; 00050 wkf_timerhandle wkf_timer_create(void); 00051 void wkf_timer_destroy(wkf_timerhandle); 00052 void wkf_timer_start(wkf_timerhandle); 00053 void wkf_timer_stop(wkf_timerhandle); 00054 double wkf_timer_time(wkf_timerhandle); 00055 double wkf_timer_timenow(wkf_timerhandle); 00056 double wkf_timer_start_time(wkf_timerhandle); 00057 double wkf_timer_stop_time(wkf_timerhandle); 00058 00059 typedef struct { 00060 wkf_timerhandle timer; 00061 double updatetime; 00062 } wkfmsgtimer; 00063 00065 extern wkfmsgtimer * wkf_msg_timer_create(double updatetime); 00066 00068 extern int wkf_msg_timer_timeout(wkfmsgtimer *time); 00069 00071 void wkf_msg_timer_destroy(wkfmsgtimer * mt); 00072 00073 #ifdef __cplusplus 00074 } 00075 #endif 00076 00077 #endif
1.2.14 written by Dimitri van Heesch,
© 1997-2002