home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gdb-4.16-base.tgz / gdb-4.16-base.tar / fsf / gdb / sim / ppc / events.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-19  |  1.9 KB  |  82 lines

  1. /*  This file is part of the program psim.
  2.  
  3.     Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
  4.  
  5.     This program is free software; you can redistribute it and/or modify
  6.     it under the terms of the GNU General Public License as published by
  7.     the Free Software Foundation; either version 2 of the License, or
  8.     (at your option) any later version.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18.  
  19.     */
  20.  
  21.  
  22. #ifndef _EVENTS_H_
  23. #define _EVENTS_H_
  24.  
  25. typedef struct _event_queue event_queue;
  26. typedef void *event_entry_tag;
  27.  
  28. typedef void event_handler
  29. (event_queue *queue,
  30.  void *data);
  31.  
  32. INLINE_EVENTS\
  33. (event_queue *) event_queue_create
  34. (void);
  35.  
  36. INLINE_EVENTS\
  37. (void) event_queue_init
  38. (event_queue *queue);
  39.  
  40.  
  41. /* (de)Schedule things to happen in the future. */
  42.  
  43. INLINE_EVENTS\
  44. (event_entry_tag) event_queue_schedule
  45. (event_queue *queue,
  46.  signed64 delta_time,
  47.  event_handler *handler,
  48.  void *data);
  49.  
  50. INLINE_EVENTS\
  51. (event_entry_tag) event_queue_schedule_after_signal
  52. (event_queue *queue,
  53.  signed64 delta_time,
  54.  event_handler *handler,
  55.  void *data);
  56.  
  57. INLINE_EVENTS\
  58. (void) event_queue_deschedule
  59. (event_queue *queue,
  60.  event_entry_tag event_to_remove);
  61.  
  62.  
  63. /* progress time.  In to parts so that if something is pending, the
  64.    caller has a chance to save any cached state */
  65.  
  66. INLINE_EVENTS\
  67. (int) event_queue_tick
  68. (event_queue *queue);
  69.  
  70. INLINE_EVENTS\
  71. (void) event_queue_process
  72. (event_queue *events);
  73.  
  74.  
  75. /* local concept of time */
  76.  
  77. INLINE_EVENTS\
  78. (signed64) event_queue_time
  79. (event_queue *queue);
  80.  
  81. #endif /* _EVENTS_H_ */
  82.