/*
* Copyright 2000, International Business Machines Corporation and others.
* All Rights Reserved.
- *
+ *
* This software has been released under the terms of the IBM Public
* License. For details, see the LICENSE file in the top-level source
* directory or online at http://www.openafs.org/dl/license10.html
#include <afsconfig.h>
#include <afs/param.h>
-RCSID
- ("$Header$");
-
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <sys/time.h>
-#endif
-#include <stdlib.h>
+#include <roken.h>
#define _TIMER_IMPL_
#include "timer.h"
/* t1 = t2 - t3 */
static void
-subtract(t1, t2, t3)
- register struct timeval *t1, *t2, *t3;
+subtract(struct timeval *t1, struct timeval *t2,
+ struct timeval *t3)
{
- register int sec2, usec2, sec3, usec3;
+ int sec2, usec2, sec3, usec3;
sec2 = t2->tv_sec;
usec2 = t2->tv_usec;
/* t1 += t2; */
static void
-add(t1, t2)
- register struct timeval *t1, *t2;
+add(struct timeval *t1, struct timeval *t2)
{
t1->tv_usec += t2->tv_usec;
t1->tv_sec += t2->tv_sec;
t1->tv_usec -= MILLION;
}
}
-\f
+
/* t1 == t2 */
int
/*
obsolete, commentless procedure, all done by hand expansion now.
-static bool geq(t1, t2)
- register struct timeval *t1, *t2;
+static bool geq(struct timeval *t1, struct timeval *t2)
{
return (t1->tv_sec > t2->tv_sec) ||
(t1->tv_sec == t2->tv_sec && t1->tv_usec >= t2->tv_usec);
*/
static bool
-blocking(t)
- register struct TM_Elem *t;
+blocking(struct TM_Elem *t)
{
return (t->TotalTime.tv_sec < 0 || t->TotalTime.tv_usec < 0);
}
-\f
+
/*
*/
int
-TM_Init(list)
- register struct TM_Elem **list;
+TM_Init(struct TM_Elem **list)
{
if (!globalInitDone) {
FT_Init(0, 0);
}
int
-TM_Final(list)
- register struct TM_Elem **list;
+TM_Final(struct TM_Elem **list)
{
if (list == NULL || *list == NULL)
return -1;
*/
void
-TM_Insert(tlistPtr, elem)
- struct TM_Elem *tlistPtr; /* pointer to head pointer of timer list */
- struct TM_Elem *elem; /* element to be inserted */
+TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem)
{
- register struct TM_Elem *next;
+ struct TM_Elem *next;
/* TimeLeft must be set for function IOMGR with infinite timeouts */
elem->TimeLeft = elem->TotalTime;
next = tlistPtr;
openafs_insque(elem, next->Prev);
}
-\f
+
/*
Walks through the specified list and updates the TimeLeft fields in it.
Returns number of expired elements in the list.
*/
int
-TM_Rescan(tlist)
- struct TM_Elem *tlist; /* head pointer of timer list */
+TM_Rescan(struct TM_Elem *tlist) /* head pointer of timer list */
{
struct timeval time;
- register int expired;
+ int expired;
-#ifndef AFS_DJGPP_ENV
FT_AGetTimeOfDay(&time, 0);
-#else
- FT_GetTimeOfDay(&time, 0); /* we need a real time value */
-#endif
expired = 0;
FOR_ALL_ELTS(e, tlist, {
if (!blocking(e)) {
*/
struct TM_Elem *
-TM_GetExpired(tlist)
- struct TM_Elem *tlist; /* head pointer of timer list */
+TM_GetExpired(struct TM_Elem *tlist) /* head pointer of timer list */
{
FOR_ALL_ELTS(e, tlist, {
if (!blocking(e)
*/
struct TM_Elem *
-TM_GetEarliest(tlist)
- struct TM_Elem *tlist;
+TM_GetEarliest(struct TM_Elem *tlist)
{
- register struct TM_Elem *e;
+ struct TM_Elem *e;
e = tlist->Next;
return (e == tlist ? NULL : e);