timer.h
来自「一个基于协同开发的轻量级进程间通讯处理包」· C头文件 代码 · 共 87 行
H
87 行
/* BLURB lgpl Coda File System Release 5 Copyright (c) 1987-1999 Carnegie Mellon University Additional copyrights listed belowThis code is distributed "AS IS" without warranty of any kind underthe terms of the GNU Library General Public Licence Version 2, asshown in the file LICENSE. The technical and financial contributors toCoda are listed in the file CREDITS. Additional copyrights#*//* IBM COPYRIGHT NOTICE Copyright (C) 1986 International Business Machines Corporation All Rights ReservedThis file contains some code identical to or derived from the 1986version of the Andrew File System ("AFS"), which is owned by the IBMCorporation. This code is provided "AS IS" and IBM does not warrantthat it is free of infringement of any intellectual rights of anythird party. IBM disclaims liability of any kind for any damageswhatsoever resulting directly or indirectly from use of this softwareor of any derivative work. Carnegie Mellon University has obtainedpermission to modify, distribute and sublicense this code, which isbased on Version 2 of AFS and does not contain the features andenhancements that are part of Version 3 of AFS. Version 3 of AFS iscommercially available and supported by Transarc Corporation,Pittsburgh, PA.*/#ifndef _LWP_TIMER_H_#define _LWP_TIMER_H_#ifdef __cplusplusextern "C" {#endifstruct TM_Elem { struct TM_Elem *Next; /* filled by package */ struct TM_Elem *Prev; /* filled by package */ struct timeval TotalTime; /* filled in by caller; changed to expiration by package */ struct timeval TimeLeft; /* filled by package */ char *BackPointer; /* filled by caller, not interpreted by package */};#define FOR_ALL_ELTS(var, list, body)\ {\ register struct TM_Elem *_LIST_, *var, *_NEXT_;\ _LIST_ = (list);\ for (var = _LIST_ -> Next; var != _LIST_; var = _NEXT_) {\ _NEXT_ = var -> Next;\ body\ }\ }/* extern definitions of timer routines */extern void TM_Insert (struct TM_Elem *tlistPtr, struct TM_Elem *elem);extern void TM_Remove (struct TM_Elem *tlistPtr, struct TM_Elem *elem);extern int TM_Rescan (struct TM_Elem *tlist);extern struct TM_Elem *TM_GetExpired (struct TM_Elem *tlist);extern struct TM_Elem *TM_GetEarliest (struct TM_Elem *tlist);extern int TM_eql (register struct timeval *t1, register struct timeval *t2);extern int TM_Init (register struct TM_Elem **list);extern int TM_Final (register struct TM_Elem **list);extern void TM_Insert (struct TM_Elem *tlistPtr, struct TM_Elem *elem);extern int TM_Rescan (struct TM_Elem *tlist);extern struct TM_Elem *TM_GetExpired (struct TM_Elem *tlist);extern struct TM_Elem *TM_GetEarliest (struct TM_Elem *tlist);#ifdef __cplusplus}#endif#endif /* _LWP_TIMER_H_ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?