/* -*- Mode: C -*-
 *
 * $Header: /home/gene/library/website/docsrc/cloop/src/RCS/timeevent.h,v 395.1 2008/04/20 17:25:50 gene Exp $
 *
 * Copyright (c) 2001 Gene Michael Stover.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
 * USA
 */

/*
 */
typedef struct {
  time_t when;
  int delay;
  unsigned long n;
  CLOOP_TimeFnType fn;
  void *p;
} TimeEvent;

/*
 * C-style comparator.  Returns negative if A is scheduled before
 * B, zero if they are scheduled at the same time (which should
 * mean that they are really the same event), or positive if A is
 * scheduled after B.
 */
C_API int TIMEEVENT_Cmp (const TimeEvent *a, const TimeEvent *b);

#ifdef __cplusplus
/*
 * C++ style comparator.  Returns true if & only if A is scheduled
 * before B.
 */
class TIMEEVENT_IsLess {
public:
  Boolean operator() (TimeEvent const &a, TimeEvent const &b);
};
#endif

/* --- end of file --- */
