Added missing properties and fixed a few typos.
[cake.git] / rom / intuition / startscreennotifytaglist.c
blob92af2fb6d64261a2389a3c2045b98f38e93370d8
1 /*
2 Copyright 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
6 Add a Intuition Notification.
7 */
9 #include <intuition/intuition.h>
11 #include "intuition_intern.h"
13 /*****************************************************************************
15 NAME */
17 #include <proto/exec.h>
18 #include <proto/intuition.h>
19 #include <proto/utility.h>
21 AROS_LH1(IPTR, StartScreenNotifyTagList,
23 /* SYNOPSIS */
24 AROS_LHA(struct TagItem *, tags, A0),
26 /* LOCATION */
27 struct IntuitionBase *, IntuitionBase, 161, Intuition)
29 /* FUNCTION
30 Add Notifications to Intuitionn.
32 INPUTS
33 taglist - A OS4 Styled Taglist for
35 RESULT
36 the value is private only a test against ZERO is allowed and means Failure
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 EndScreenNotify()
46 INTERNALS
48 HISTORY
50 *****************************************************************************/
52 AROS_LIBFUNC_INIT
53 struct IntScreenNotify *notify;
55 notify = (struct IntScreenNotify *) AllocVec(sizeof(struct IntScreenNotify), MEMF_CLEAR);
57 if (notify)
59 notify->port = (struct MsgPort *) GetTagData(SNA_MsgPort, 0, tags);
60 notify->sigbit = (BYTE) GetTagData(SNA_SigBit, 0, tags);
61 notify->sigtask = (struct Task *) GetTagData(SNA_SigTask, 0, tags);
62 notify->flags = (ULONG) GetTagData(SNA_Notify, 0, tags);
63 notify->userdata = (IPTR) GetTagData(SNA_UserData, 0, tags);
64 notify->hook = (struct Hook *) GetTagData(SNA_Hook, 0, tags);
65 notify->node.ln_Pri = (BYTE) GetTagData(SNA_Priority, 0, tags);
66 notify->pubname = NULL;
68 char *pubname = (char *) GetTagData(SNA_PubName, 0, tags);
69 if (pubname)
71 notify->pubname = AllocVec(strlen(pubname) + 1, MEMF_CLEAR);
72 if (notify->pubname)
74 strcpy(notify->pubname, pubname);
76 else
78 FreeVec(notify);
79 notify = NULL;
82 if (notify)
84 ObtainSemaphore(&GetPrivIBase(IntuitionBase)->ScreenNotificationListLock);
85 Enqueue(&GetPrivIBase(IntuitionBase)->ScreenNotificationList, (struct Node *) notify);
86 ReleaseSemaphore(&GetPrivIBase(IntuitionBase)->ScreenNotificationListLock);
90 ReturnPtr ("StartScreenNotifyTagList", APTR, notify);
92 AROS_LIBFUNC_EXIT
93 } /* StartScreenNotifyTagList */