home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / reference / amiga_mail_vol2 / ii-107 / asyncexample.c < prev    next >
C/C++ Source or Header  |  1996-01-30  |  1KB  |  48 lines

  1. ;/* ASyncExample.c - Execute me to compile me with SAS/C 6.56
  2. sc data=near nominc strmer streq nostkchk saveds ign=73 AsyncExample.c
  3. slink FROM LIB:c.o,ASyncExample.o TO ASyncExample LIBRARY lib:sc.lib,LIB:Amiga.lib,asyncio.o
  4. quit ;*/
  5.  
  6. /* (c)  Copyright 1993 Commodore-Amiga, Inc.   All rights reserved. */
  7. /* The information contained herein is subject to change without    */
  8. /* notice, and is provided "as is" without warranty of any kind,    */
  9. /* either expressed or implied.  The entire risk as to the use of   */
  10. /* this information is assumed by the user.                         */
  11.  
  12.  
  13. #include <exec/types.h>
  14. #include <exec/exec.h>
  15. #include <dos/dos.h>
  16. #include <dos/dosextens.h>
  17. #include <stdio.h>
  18.  
  19. #include <clib/exec_protos.h>
  20. #include <clib/dos_protos.h>
  21.  
  22. #include "asyncio.h"
  23.  
  24. #ifdef LATTICE
  25. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  26. int chkabort(void) { return(0); }
  27. #endif
  28.  
  29. VOID main(VOID)
  30. {
  31. struct AsyncFile *in;
  32. LONG              num;
  33. struct AsyncFile *out;
  34.  
  35.     if (in = OpenAsync("x", MODE_READ, 8192))
  36.     {
  37.         if (out = OpenAsync("t:test_sync", MODE_WRITE, 8192))
  38.         {
  39.             while ((num = ReadCharAsync(in)) >= 0)
  40.             {
  41.                 WriteCharAsync(out,num);
  42.             }
  43.             CloseAsync(out);
  44.         }
  45.         CloseAsync(in);
  46.     }
  47. }
  48.