home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / Emulatory / AROS / exec / getmsg.c < prev    next >
Encoding:
C/C++ Source or Header  |  1978-03-06  |  1.6 KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: getmsg.c,v 1.5 1996/10/24 15:50:51 aros Exp $
  4.     $Log: getmsg.c,v $
  5.     Revision 1.5  1996/10/24 15:50:51  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/08/13 13:56:03  digulla
  9.     Replaced AROS_LA by AROS_LHA
  10.     Replaced some AROS_LH*I by AROS_LH*
  11.     Sorted and added includes
  12.  
  13.     Revision 1.3  1996/08/01 17:41:12  digulla
  14.     Added standard header for all files
  15.  
  16.     Desc:
  17.     Lang: english
  18. */
  19. #include <exec/execbase.h>
  20. #include <exec/ports.h>
  21. #include <aros/libcall.h>
  22.  
  23. /*****************************************************************************
  24.  
  25.     NAME */
  26.     #include <clib/exec_protos.h>
  27.  
  28.     AROS_LH1(struct Message *, GetMsg,
  29.  
  30. /*  SYNOPSIS */
  31.     AROS_LHA(struct MsgPort *, port, A0),
  32.  
  33. /*  LOCATION */
  34.     struct ExecBase *, SysBase, 62, Exec)
  35.  
  36. /*  FUNCTION
  37.     Get a message from a given messageport. This function doesn't wait
  38.     and returns NULL if the messageport is empty. Therefore it's
  39.     generally a good idea to WaitPort() or Wait() on the given port first.
  40.  
  41.     INPUTS
  42.     port - Pointer to messageport
  43.  
  44.     RESULT
  45.     Pointer to message removed from the port.
  46.  
  47.     NOTES
  48.  
  49.     EXAMPLE
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.     WaitPort(), PutMsg()
  55.  
  56.     INTERNALS
  57.  
  58.     HISTORY
  59.  
  60. ******************************************************************************/
  61. {
  62.     AROS_LIBFUNC_INIT
  63.  
  64.     struct Message *msg;
  65.  
  66.     /* Protect the message list. */
  67.     Disable();
  68.  
  69.     /* Get first node. */
  70.     msg=(struct Message *)RemHead(&port->mp_MsgList);
  71.  
  72.     /* All done. */
  73.     Enable();
  74.     return msg;
  75.     AROS_LIBFUNC_EXIT
  76. }
  77.  
  78.