home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / d / desklib / !DeskLib / h_doc / Dispatch < prev    next >
Encoding:
Text File  |  1996-05-21  |  1.4 KB  |  49 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 __Desk_Dispatch_h
  18. #define __Desk_Dispatch_h
  19.  
  20. #ifdef __cplusplus
  21.     extern "C" {
  22. #endif
  23.  
  24.  
  25.  
  26. typedef void (*Desk_dispatch_proc)();
  27.  
  28.  
  29. extern int Dispatch(int value, int size, int table[],
  30.                     Desk_dispatch_proc functions[],
  31.                     int arg0, int arg1, int arg2, int arg3);
  32. /*
  33.  *  Dispatch()
  34.  *  Performs a table look up of value in table[size], and
  35.  *  calls the corrseponding procedure in functions[size], with
  36.  *  up to 4 arguments (any excess arguments will be safely ignored, as
  37.  *  these are the arguments that C passes in registers R0-R3)
  38.  *
  39.  *  If the table[] entry contains a -1 then the coresponding procedure in
  40.  *  functions[] is ALWAYS taken - Use this for a default action
  41.  */
  42.  
  43. #ifdef __cplusplus
  44. }
  45. #endif
  46.  
  47.  
  48. #endif
  49.