boot.library is no more, *.handler to *-handler.
[AROS.git] / compiler / alib / createport.c
blobf0e7719c9eddd5abef0a955bf509ed6ff6ae92c8
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: amiga.lib function CreatePort()
6 Lang: english
7 */
9 #include <proto/exec.h>
11 /*****************************************************************************
13 NAME */
14 #include <exec/ports.h>
15 #include <proto/alib.h>
17 struct MsgPort * CreatePort (
19 /* SYNOPSIS */
20 STRPTR name,
21 LONG pri)
23 /* FUNCTION
24 Allocate and initialize a new Exec message port. You must
25 use DeletePort() to get rid of it.
27 INPUTS
28 name - The name of the new port. The string is not copied
29 pri - The priority of the port.
31 RESULT
32 A pointer to the new message port or NULL if no memory or
33 no signal was available.
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
42 DeletePort(), exec.library/CreateMsgPort(), exec.library/DeleteMsgPort()
44 INTERNALS
46 HISTORY
48 ******************************************************************************/
50 struct MsgPort * mp;
52 mp = CreateMsgPort ();
54 if (mp)
56 mp->mp_Node.ln_Name = name;
57 mp->mp_Node.ln_Pri = pri;
59 if (name)
60 AddPort (mp);
63 return mp;
64 } /* CreatePort */