+/* $NetBSD: schedule.c,v 1.4 1997/10/12 21:25:11 christos Exp $ */
+
/*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ * The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char sccsid[] = "@(#)schedule.c 5.4 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)schedule.c 8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: schedule.c,v 1.4 1997/10/12 21:25:11 christos Exp $");
+#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include <err.h>
+#include "trek.h"
/*
** SCHEDULE AN EVENT
char x, y;
char z;
{
- register struct event *e;
- register int i;
+ struct event *e;
+ int i;
double date;
date = Now.date + offset;
Now.eventptr[type] = e;
return (e);
}
- syserr("Cannot schedule event %d parm %d %d %d", type, x, y, z);
+ errx(1, "Cannot schedule event %d parm %d %d %d", type, x, y, z);
}
** time plus 'offset'.
*/
+void
reschedule(e1, offset)
struct event *e1;
double offset;
{
double date;
- register struct event *e;
+ struct event *e;
e = e1;
** The event at slot 'e' is deleted.
*/
+void
unschedule(e1)
struct event *e1;
{
- register struct event *e;
+ struct event *e;
e = e1;
int factor;
int x, y, z;
{
- register int ev;
+ int ev;
ev = ev1;
return (schedule(ev, -Param.eventdly[ev] * Param.time * log(franf()) / factor, x, y, z));
** division factor. Look at the code to see what really happens.
*/
+void
xresched(e1, ev1, factor)
struct event *e1;
int ev1;
int factor;
{
- register int ev;
- register struct event *e;
+ int ev;
+ struct event *e;
ev = ev1;
e = e1;