home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / alib / createport.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-27  |  1.1 KB  |  65 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: createport.c,v 1.3 1997/01/27 00:16:35 ldp Exp $
  4.  
  5.     Desc: amiga.lib function CreatePort()
  6.     Lang: english
  7. */
  8. #include <proto/exec.h>
  9.  
  10. /*****************************************************************************
  11.  
  12.     NAME */
  13. #include <exec/ports.h>
  14. #include <proto/alib.h>
  15.  
  16.     struct MsgPort * CreatePort (
  17.  
  18. /*  SYNOPSIS */
  19.     STRPTR name,
  20.     LONG   pri)
  21.  
  22. /*  FUNCTION
  23.     Allocate and initialize a new Exec message port. You must
  24.     use DeletePort() to get rid of it.
  25.  
  26.     INPUTS
  27.     name - The name of the new port. The string is not copied
  28.     pri - The priority of the port.
  29.  
  30.     RESULT
  31.     A pointer to the new message port or NULL if no memory or
  32.     no signal was available.
  33.  
  34.     NOTES
  35.  
  36.     EXAMPLE
  37.  
  38.     BUGS
  39.  
  40.     SEE ALSO
  41.     DeletePort(), CreateMsgPort(), DeleteMsgPort()
  42.  
  43.     INTERNALS
  44.  
  45.     HISTORY
  46.  
  47. ******************************************************************************/
  48. {
  49.     struct MsgPort * mp;
  50.  
  51.     mp = CreateMsgPort ();
  52.  
  53.     if (mp)
  54.     {
  55.     mp->mp_Node.ln_Name = name;
  56.     mp->mp_Node.ln_Pri  = pri;
  57.  
  58.     if (name)
  59.         AddPort (mp);
  60.     }
  61.  
  62.     return mp;
  63. } /* CreatePort */
  64.  
  65.