prism2.device: Compiler delint
[AROS.git] / workbench / demos / notify.c
blob3618c3a5261f77441c3ec394bebda72cadbae2a8
1 /*
2 Copyright © 2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Test program for ram.handler notification.
6 */
8 #include <proto/exec.h>
9 #include <exec/memory.h>
10 #include <stdio.h>
11 #include <dos/dos.h>
12 #include <dos/dosextens.h>
13 #include <dos/notify.h>
14 #include <proto/exec.h>
15 #include <proto/dos.h>
17 #include <stdlib.h>
20 int main(int argc, char* argv[])
22 struct NotifyRequest *nr = AllocVec(sizeof(struct NotifyRequest),
23 MEMF_CLEAR);
24 BPTR lock;
26 if (nr == NULL)
28 printf("Could not allocate memory.\n");
29 exit(1);
32 nr->nr_Name = "Olle";
33 nr->nr_Flags = NRF_SEND_SIGNAL;
34 nr->nr_stuff.nr_Signal.nr_Task = FindTask(NULL);
35 nr->nr_stuff.nr_Signal.nr_SignalNum = SIGB_SINGLE;
37 lock = Lock("Ram Disk:", SHARED_LOCK);
39 if (lock == BNULL)
41 printf("Could not lock Ram Disk:\n");
42 exit(1);
45 CurrentDir(lock);
47 StartNotify(nr);
49 printf("Waiting for notification\n");
51 Wait(SIGF_SINGLE);
53 printf("Got notification!\n");
55 return 0;