--- os2sdk/demos/examples/asyncio/asyncio.c 2018/08/09 12:25:13 1.1.1.1 +++ os2sdk/demos/examples/asyncio/asyncio.c 2018/08/09 12:26:12 1.1.1.2 @@ -1,17 +1,22 @@ /* - * Example of DOSWRITEASYNC. (DOSREADASYNC is not demonstrated, + * Example of DosWriteAsync. (DosReadAsync is not demonstrated, * but has identical usage). * - * In this example, the program uses DOSWRITEASYNC to write a + * In this example, the program uses DosWriteAsync to write a * large block of data to the screen asynchronously, while the * main program sits in a loop beeping. * * Compile as: cl -AL -G2 -Lp async.c * - * Copyright (C) Microsoft Corp. 1986 + * Created by Microsoft Corp. 1986 */ -#include +#define INCL_DOSPROCESS +#define INCL_DOSFILEMGR +#define INCL_DOSSEMAPHORES + +#include +#include #define FREQ 440 #define DURATION 500L @@ -29,14 +34,14 @@ main() cbuf[i] = 'x'; sem = 0; - DOSSEMSET((unsigned long)&sem); /* set semaphore */ - DOSWRITEASYNC(1,&sem,&rc,cbuf,sizeof(cbuf),&bytecount); + DosSemSet((HSEM)&sem); /* set semaphore */ + DosWriteAsync(1,&sem,&rc,cbuf,sizeof(cbuf),&bytecount); for(i = 0; i < 10; i++) { - DOSBEEP(FREQ, DURATION); - DOSSLEEP(DURATION); + DosBeep(FREQ, DURATION); + DosSleep(DURATION); } - DOSSEMWAIT((unsigned long)&sem, -1L); + DosSemWait((HSEM)&sem, -1L); printf("return code = %d, bytes written = %d\n", rc, bytecount); }