/* begincopyright
  Copyright (c) 1988 Xerox Corporation. All rights reserved.
  Use and copying of this software and preparation of derivative works based
  upon this software are permitted. Any distribution of this software or
  derivative works must comply with all applicable United States export
  control laws. This software is made available AS IS, and Xerox Corporation
  makes no warranty about the software, its performance or its conformity to
  any specification. Any person obtaining a copy of this software is requested
  to send their name and post office or electronic mail address to:
    PCR Coordinator
    Xerox PARC
    3333 Coyote Hill Rd.
    Palo Alto, CA 94304
  endcopyright */

/*
 * UIOEvents.h
 *
 * Asynchronous UIO events.
 *
 * Demers, March 12, 1990 2:28:20 pm PST
 */

#ifndef ←XR←UIO←EVENTS←
#define ←XR←UIO←EVENTS← 1

#ifndef ←XR←BASIC←TYPES←
#   include "xr/BasicTypes.h"
#endif


typedef struct XR←UIOEventRep {
    unsigned uioe←seqNum;
    int uioe←iopIndex;
    int uioe←id;		/* UNIX sig num or 0 (missed events) or ... */
    XR←Pointer uioe←info;	/* always NIL for now */
} *XR←UIOEvent;


#define XR←UIO←EVENT←ID←MISSED	0


extern int
XR←UIOAwaitEvent(/*XR←UIOEvent uioe*/);
/*
    Wait (abortably) for next event, or until timeout.
    Return 0 (on success) or (-1) (on ABORT).
*/

extern int
XR←UIORegisterInterestInEvent(/*int id, bool interested*/);
/*
    Register interest in event.
    Return 0 on success, (-1) on failure with XR←Errno() set.
*/

#endif /* ←XR←UIO←EVENTS← */