home *** CD-ROM | disk | FTP | other *** search
- #include "diskwipe.h"
-
- struct MsgPort *NewPort()
- {
- UBYTE sigbit;
- struct MsgPort *port;
-
- if ((sigbit = AllocSignal(-1)) == -1)
- return(NULL);
-
- if ((port = (struct MsgPort *)
- AllocMem((ULONG)sizeof(struct MsgPort),
- MEMF_CLEAR|MEMF_PUBLIC)) == NULL)
- {
- FreeSignal(sigbit);
- return(NULL);
- }
-
- port->mp_Node.ln_Type = NT_MSGPORT;
- port->mp_Flags = PA_SIGNAL;
- port->mp_SigBit = sigbit;
- port->mp_SigTask = FindTask(0);
- NewList(&(port->mp_MsgList));
- return(port);
- }
-
- void DisposePort(port)
- struct MsgPort *port;
- {
- FreeSignal(port->mp_SigBit);
- FreeMem((char *)port, (ULONG)sizeof(*port));
- }
-
- struct IOExtTD *CreateIOExtTD(mp)
- struct MsgPort *mp;
- {
- struct IOExtTD *ioext;
- if ((ioext = (struct IOExtTD *)
- AllocMem(sizeof(struct IOExtTD),
- MEMF_CLEAR|MEMF_PUBLIC)) != NULL)
- {
- ioext->iotd_Req.io_Message.mn_Node.ln_Type = NT_MESSAGE;
- ioext->iotd_Req.io_Message.mn_ReplyPort = mp;
- }
- return(ioext);
- }
-