home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / desklib / Libraries / Event / c / MRelMsg < prev    next >
Encoding:
Text File  |  1992-03-31  |  1.7 KB  |  51 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:    Event.MRelMsg.c
  12.     Author:  Copyright © 1992 Jason Williams
  13.     Version: 1.00 (16 Mar 1992)
  14.     Purpose: Extension to Event.c to allow routing of specific message types
  15.              to different windows' message handlers.
  16. */
  17.  
  18. #include "EMsgDefs.h"
  19.  
  20. extern linklist_header eventmsg__claimanchor;
  21.  
  22.  
  23. extern BOOL EventMsg_ReleaseMessage(message_action messagetype)
  24. {
  25.   eventmsg_claimrecord *ptr;
  26.   eventmsg_windowrecord *wptr, *next;
  27.  
  28.   ptr = (eventmsg_claimrecord *) eventmsg__claimanchor.next;
  29.  
  30.   while (ptr != NULL)
  31.   {
  32.     if (ptr->messagetype == messagetype)
  33.     {
  34.       wptr = (eventmsg_windowrecord *) ptr->windowlist.next;
  35.       while (wptr != NULL)                      /* Release all window claims */
  36.       {
  37.         next = (eventmsg_windowrecord *) wptr->header.next;
  38.         free(wptr);
  39.         wptr = next;
  40.       }
  41.  
  42.       LinkList_Unlink(&eventmsg__claimanchor, &(ptr->header));
  43.                                                       /* remove message type */
  44.       free(ptr);                                      /* free memory up      */
  45.       return(TRUE);
  46.     }
  47.     ptr = (eventmsg_claimrecord *) ptr->header.next;
  48.   }
  49.   return(FALSE);
  50. }
  51.