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

  1. ;/* ASyncExample.c - Execute me to compile me with SAS/C 6.56
  2. sc NMINC STRMERGE STREQ NOSTKCHK SAVEDS IGNORE=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. /*
  7. (c)  Copyright 1992 Commodore-Amiga, Inc.   All rights reserved.
  8. The information contained herein is subject to change without notice,
  9. and is provided "as is" without warranty of any kind, either expressed
  10. or implied.  The entire risk as to the use of this information is
  11. assumed by the user.
  12. */
  13.  
  14. #include <exec/types.h>
  15. #include <exec/exec.h>
  16. #include <dos/dos.h>
  17. #include <dos/dosextens.h>
  18. #include <stdio.h>
  19.  
  20. #include <clib/exec_protos.h>
  21. #include <clib/dos_protos.h>
  22.  
  23. #include "asyncio.h"
  24.  
  25. #ifdef LATTICE
  26. int CXBRK(void) { return(0); }  /* Disable Lattice CTRL/C handling */
  27. int chkabort(void) { return(0); }
  28. #endif
  29.  
  30. VOID main(VOID)
  31. {
  32. struct AsyncFile *in;
  33. LONG              num;
  34. struct AsyncFile *out;
  35.  
  36.     if (in = OpenAsync("s:Startup-Sequence", MODE_READ, 8192))
  37.     {
  38.         if (out = OpenAsync("t:test_sync", MODE_WRITE, 8192))
  39.         {
  40.             while ((num = ReadCharAsync(in)) >= 0)
  41.             {
  42.                 WriteCharAsync(out,num);
  43.             }
  44.             CloseAsync(out);
  45.         }
  46.         CloseAsync(in);
  47.     }
  48. }
  49.