home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / hce.lha / HCE / LibSource / AmigaLib / EXTRAS / Source / CreateExtIO.c next >
Encoding:
C/C++ Source or Header  |  1992-09-02  |  574 b   |  25 lines

  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3. #include <exec/io.h>
  4. #include <exec/ports.h>
  5.  
  6. struct IORequest *CreateExtIO(ioReplyPort, size)
  7. struct MsgPort *ioReplyPort;
  8. ULONG size;
  9. {
  10.     struct IORequest *ioReq;
  11.  
  12.     if (!ioReplyPort)
  13.        return (NULL);
  14.  
  15.  ioReq = (struct IORequest *)AllocMem(size, (ULONG)MEMF_CLEAR|MEMF_PUBLIC);
  16.         if (!ioReq)
  17.             return(NULL);
  18.  
  19.             ioReq->io_Message.mn_Node.ln_Type = NT_MESSAGE;
  20.             ioReq->io_Message.mn_Length = size;
  21.             ioReq->io_Message.mn_ReplyPort = ioReplyPort;
  22.  
  23.     return (ioReq);
  24. }
  25.