home *** CD-ROM | disk | FTP | other *** search
- //************************************************************************
- //
- // m.h.
- //
- // by Felipe A. Rodriguez
- //
- // This is a Multi-tasked, Multi-threaded tool which acts as a frontend
- // to a serial port, a rearend for Terminal.app and which avails itself
- // to GateKeeper through the distributed objects mechanism.
- //
- //
- // This code is supplied "as is" the author makes no warranty as to its
- // suitability for any purpose. This code is free and may be distributed
- // in accordance with the terms of the:
- //
- // GNU GENERAL PUBLIC LICENSE
- // Version 2, June 1991
- // copyright (C) 1989, 1991 Free Software Foundation, Inc.
- // 675 Mass Ave, Cambridge, MA 02139, USA
- //
- //************************************************************************
-
- #import <sys/ttydev.h>
-
-
- any_t gateThread(any_t arg);
- void childDidExit(void);
- void fdHandler (int theFd);
- void Init(); // init ourselves
- void openSerialPort(const char *deviceName);
- void sendScriptToModem(char *buffer);
- void strToScript(const char *buffer);
- void initThreaded(void);
- void catchalarm(int a); // timeout handler while sending script
- int lockPort(const char *dev); // create uucp style lock on ser port
- void unlockPort();
- int translate_speed(int bps);
-
-
- /*
- * List of valid speeds.
- */
- struct speed {
- int speed_int, speed_val;
- } speeds[] = {
- #ifdef B50
- { 50, B50 },
- #endif
- #ifdef B75
- { 75, B75 },
- #endif
- #ifdef B110
- { 110, B110 },
- #endif
- #ifdef B134
- { 134, B134 },
- #endif
- #ifdef B150
- { 150, B150 },
- #endif
- #ifdef B200
- { 200, B200 },
- #endif
- #ifdef B300
- { 300, B300 },
- #endif
- #ifdef B600
- { 600, B600 },
- #endif
- #ifdef B1200
- { 1200, B1200 },
- #endif
- #ifdef B1800
- { 1800, B1800 },
- #endif
- #ifdef B2000
- { 2000, B2000 },
- #endif
- #ifdef B2400
- { 2400, B2400 },
- #endif
- #ifdef B3600
- { 3600, B3600 },
- #endif
- #ifdef B4800
- { 4800, B4800 },
- #endif
- #ifdef B7200
- { 7200, B7200 },
- #endif
- #ifdef B9600
- { 9600, B9600 },
- #endif
- #ifdef B19200
- { 19200, B19200 },
- #endif
- #ifdef B38400
- { 38400, B38400 },
- #endif
- #ifdef EXTA
- { 19200, EXTA },
- #endif
- #ifdef EXTB
- { 38400, EXTB },
- #endif
- #ifdef B14400
- { 14400, B14400 },
- #endif
- #ifdef B28800
- { 28800, B28800 },
- #endif
- #ifdef B43200
- { 43200, B43200 },
- #endif
- #ifdef B57600
- { 57600, B57600 },
- #endif
- /*
- #ifndef B115200
- #warning Defining B115200
- #define B115200 20
- #endif
- */
- #ifdef B115200
- { 115200, B115200 },
- #endif
- { 0, 0 }
- };
-
-
-