home *** CD-ROM | disk | FTP | other *** search
- /*
- * EXAMP67.C
- *
- * The Greenleaf Comm Library
- *
- * Copyright (C) 1989 Greenleaf Software Inc. All Rights Reserved.
- *
- * This program is a plain vanilla terminal emulator. It will receive
- * a file using Kermit by pressing the F1 key. You can exit the program
- * by pressing the ESC key. This demonstrates the KermitReceive() function.
- *
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include "asiports.h"
- #include "xfer.h"
- #include "ibmkeys.h"
- #include "gf.h"
-
- void message_guy( char *message );
- void main( void );
-
- void main()
- {
- int c;
- int status;
-
- status = asiopen( COM1, ASINOUT | BINARY | NORMALRX, 1050, 1050,
- 19200L, P_NONE, 1, 8, ON, ON);
- if ( status < ASSUCCESS ) {
- printf( "Failed to open the port. Status = %d\n", status );
- exit( 1 );
- }
- asixon( COM1, 30, 70, XON, XOFF );
- for ( ; ; ) {
- if ( gfkbhit() ) {
- c = getkey();
- if ( c == ESC )
- exit( 0 );
- else if ( c == F1 )
- KermitReceive( COM1, message_guy, NULL, 3 );
- else
- asiputc( COM1, c );
- }
- c = asigetc( COM1 );
- if ( c >= ASSUCCESS )
- putc( c, stdout );
- }
- }
-
- void message_guy( char *message )
- {
- printf( "%s\n", message );
- }
-
-