Coda Distributed File System
timer.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 5
5
6 Copyright (c) 1987-1999 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15
16#*/
17
18/*
19 IBM COPYRIGHT NOTICE
20
21 Copyright (C) 1986
22 International Business Machines Corporation
23 All Rights Reserved
24
25This file contains some code identical to or derived from the 1986
26version of the Andrew File System ("AFS"), which is owned by the IBM
27Corporation. This code is provided "AS IS" and IBM does not warrant
28that it is free of infringement of any intellectual rights of any
29third party. IBM disclaims liability of any kind for any damages
30whatsoever resulting directly or indirectly from use of this software
31or of any derivative work. Carnegie Mellon University has obtained
32permission to modify, distribute and sublicense this code, which is
33based on Version 2 of AFS and does not contain the features and
34enhancements that are part of Version 3 of AFS. Version 3 of AFS is
35commercially available and supported by Transarc Corporation,
36Pittsburgh, PA.
37
38*/
39
40#ifndef _LWP_TIMER_H_
41#define _LWP_TIMER_H_
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47struct TM_Elem {
48 struct TM_Elem *Next; /* filled by package */
49 struct TM_Elem *Prev; /* filled by package */
50 struct timeval TotalTime; /* filled in by caller;
51 changed to expiration by package */
52 struct timeval TimeLeft; /* filled by package */
53 char *BackPointer; /* filled by caller, not interpreted by package */
54};
55
56#define FOR_ALL_ELTS(var, list, body) \
57 { \
58 struct TM_Elem *_LIST_, *var, *_NEXT_; \
59 _LIST_ = (list); \
60 for (var = _LIST_->Next; var != _LIST_; var = _NEXT_) { \
61 _NEXT_ = var->Next; \
62 body \
63 } \
64 }
65
66/* extern definitions of timer routines */
67extern void TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem);
68extern void TM_Remove(struct TM_Elem *tlistPtr, struct TM_Elem *elem);
69extern int TM_Rescan(struct TM_Elem *tlist);
70extern struct TM_Elem *TM_GetExpired(struct TM_Elem *tlist);
71extern struct TM_Elem *TM_GetEarliest(struct TM_Elem *tlist);
72
73extern int TM_eql(struct timeval *t1, struct timeval *t2);
74extern int TM_Init(struct TM_Elem **list);
75extern int TM_Final(struct TM_Elem **list);
76extern void TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem);
77extern int TM_Rescan(struct TM_Elem *tlist);
78extern struct TM_Elem *TM_GetExpired(struct TM_Elem *tlist);
79extern struct TM_Elem *TM_GetEarliest(struct TM_Elem *tlist);
80
81#ifdef __cplusplus
82}
83#endif
84
85#endif /* _LWP_TIMER_H_ */
command_t list[]
Definition: repair.cc:29
Definition: timer.h:47
struct timeval TotalTime
Definition: timer.h:50
struct TM_Elem * Prev
Definition: timer.h:49
struct TM_Elem * Next
Definition: timer.h:48
struct timeval TimeLeft
Definition: timer.h:52
char * BackPointer
Definition: timer.h:53
rvm_tid_t * t1
Definition: testrvm.c:42
rvm_tid_t * t2
Definition: testrvm.c:42
int TM_Rescan(struct TM_Elem *tlist)
Definition: timer.c:218
struct TM_Elem * TM_GetEarliest(struct TM_Elem *tlist)
Definition: timer.c:264
int TM_Final(struct TM_Elem **list)
Definition: timer.c:136
void TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem)
Definition: timer.c:153
struct TM_Elem * TM_GetExpired(struct TM_Elem *tlist)
Definition: timer.c:244
int TM_eql(struct timeval *t1, struct timeval *t2)
Definition: timer.c:99
void TM_Remove(struct TM_Elem *tlistPtr, struct TM_Elem *elem)
Definition: timer.c:202
int TM_Init(struct TM_Elem **list)
Definition: timer.c:113