home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP40.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This example program is used to demonstrate the use of istxfull().
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "asiports.h"
- #include "ibmkeys.h"
- #include "gf.h"
-
- void main( void );
-
- void main()
- {
- int status;
-
- status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 1000, 1000,
- 1200L, P_NONE, 1, 8, OFF, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
-
- while ( !istxfull( COM1 ) )
- asiputc( COM1, 'X' );
- while ( !istxempty( COM1 ) ) {
- printf( "%4d characters left\r", 1000 - gettxfree( COM1 ) );
- timer( 2 );
- }
- printf("\n");
- }
-