home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / gcc / !GCC / patches / DeskLib / h / Dispatch < prev    next >
Encoding:
Text File  |  1994-10-03  |  1.4 KB  |  46 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Dispatch.h  (for Misc.s.Dispatch)
  12.     Author:  Copyright © 1992 Shaun Blackmore
  13.     Version: 1.00 (03 Apr 1992)
  14.     Purpose: Function dispatcher
  15. */
  16.  
  17. #ifndef __dl_dispatch_h
  18. #define __dl_dispatch_h
  19.  
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23.  
  24. typedef void (*dispatch_proc)();
  25.  
  26. /*
  27.  *  Dispatch()
  28.  *  Performs a table look up of value in table[size], and
  29.  *  calls the corrseponding procedure in functions[size], with
  30.  *  up to 4 arguments (any excess arguments will be safely ignored, as
  31.  *  these are the arguments that C passes in registers R0-R3)
  32.  *
  33.  *  If the table[] entry contains a -1 then the coresponding procedure in
  34.  *  functions[] is ALWAYS taken - Use this for a default action
  35.  */
  36.  
  37. extern int Dispatch(int value, int size, int table[],
  38.                     dispatch_proc functions[],
  39.                     int arg0, int arg1, int arg2, int arg3);
  40.  
  41. #ifdef __cplusplus
  42.            }
  43. #endif
  44.  
  45. #endif
  46.