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 >
Wrap
C/C++ Source or Header
|
1996-01-30
|
1KB
|
49 lines
;/* ASyncExample.c - Execute me to compile me with SAS/C 6.56
sc NMINC STRMERGE STREQ NOSTKCHK SAVEDS IGNORE=73 ASyncExample.c
slink FROM LIB:c.o,ASyncExample.o TO ASyncExample LIBRARY LIB:sc.lib,LIB:amiga.lib,asyncio.o
quit ;*/
/*
(c) Copyright 1992 Commodore-Amiga, Inc. All rights reserved.
The information contained herein is subject to change without notice,
and is provided "as is" without warranty of any kind, either expressed
or implied. The entire risk as to the use of this information is
assumed by the user.
*/
#include <exec/types.h>
#include <exec/exec.h>
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <stdio.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include "asyncio.h"
#ifdef LATTICE
int CXBRK(void) { return(0); } /* Disable Lattice CTRL/C handling */
int chkabort(void) { return(0); }
#endif
VOID main(VOID)
{
struct AsyncFile *in;
LONG num;
struct AsyncFile *out;
if (in = OpenAsync("s:Startup-Sequence", MODE_READ, 8192))
{
if (out = OpenAsync("t:test_sync", MODE_WRITE, 8192))
{
while ((num = ReadCharAsync(in)) >= 0)
{
WriteCharAsync(out,num);
}
CloseAsync(out);
}
CloseAsync(in);
}
}