home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / desklib / !DeskLib / h / Dispatch < prev    next >
Encoding:
Text File  |  1993-04-29  |  1.4 KB  |  39 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.  
  21. typedef void (*dispatch_proc)();
  22.  
  23. /*
  24.  *  Dispatch()
  25.  *  Performs a table look up of value in table[size], and
  26.  *  calls the corrseponding procedure in functions[size], with
  27.  *  up to 4 arguments (any excess arguments will be safely ignored, as
  28.  *  these are the arguments that C passes in registers R0-R3)
  29.  *
  30.  *  If the table[] entry contains a -1 then the coresponding procedure in
  31.  *  functions[] is ALWAYS taken - Use this for a default action
  32.  */
  33.  
  34. extern int Dispatch(int value, int size, int table[],
  35.                     dispatch_proc functions[],
  36.                     int arg0, int arg1, int arg2, int arg3);
  37.  
  38. #endif
  39.