2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
6 #include "iffparse_intern.h"
8 /*****************************************************************************
11 #include <proto/iffparse.h>
13 AROS_LH1(struct ClipboardHandle
*, OpenClipboard
,
16 AROS_LHA(LONG
, unitNumber
, D0
),
19 struct Library
*, IFFParseBase
, 41, IFFParse
)
22 Opens the clipboard.device with the specified unit.
23 Allocates and initializes a ClipboardHandle struct which should
24 be put into the iff_Stream field of the IFFHandle when the
25 handle is initialized with InitIFFasClip().
29 unitNumber - a clipboard device unit number (usually PRIMARY_CLIP).
32 ch - pointer to ClipboarHandle struct or NULL if unsuccessfull.
41 InitIFFasClip(), CloseClipboard()
45 *****************************************************************************/
48 struct ClipboardHandle
* ch
;
49 struct IOClipReq
* req
;
50 struct Task
* thistask
;
52 /* Allocate a ClipBoardHandle */
56 sizeof (struct ClipboardHandle
),
57 MEMF_ANY
| MEMF_CLEAR
| MEMF_PUBLIC
61 /* Get a ponter to the ioClipReq, so we
62 don't need all that type casting.
67 thistask
= FindTask(0L);
69 if (InitPort( &(ch
->cbh_CBport
), thistask
, IPB(IFFParseBase
)))
71 if (InitPort( &(ch
->cbh_SatisfyPort
), thistask
, IPB(IFFParseBase
)))
73 /* Initialize the IORequest structure.
74 Basically CreateIORequest without memory allocation.
76 req
->io_Message
.mn_ReplyPort
= &(ch
->cbh_CBport
);
77 req
->io_Message
.mn_Length
= sizeof(struct IOClipReq
);
84 (struct IORequest
*)req
,
93 ClosePort( &(ch
->cbh_SatisfyPort
), IPB(IFFParseBase
));
96 ClosePort( &(ch
->cbh_CBport
), IPB(IFFParseBase
));
98 FreeMem(ch
, sizeof (struct ClipboardHandle
));
104 } /* OpenClipboard */