home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / Connectivity / GateKeeper-2.1 / MODEM.tproj / m.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-26  |  2.4 KB  |  131 lines

  1. //************************************************************************
  2. //
  3. //    m.h.  
  4. //
  5. //        by    Felipe A. Rodriguez        
  6. //
  7. //    This is a Multi-tasked, Multi-threaded tool which acts as a frontend 
  8. //    to a serial port, a rearend for Terminal.app and which avails itself  
  9. //    to GateKeeper through the distributed objects mechanism.
  10. //
  11. //
  12. //    This code is supplied "as is" the author makes no warranty as to its 
  13. //    suitability for any purpose.  This code is free and may be distributed 
  14. //    in accordance with the terms of the:
  15. //        
  16. //            GNU GENERAL PUBLIC LICENSE
  17. //            Version 2, June 1991
  18. //            copyright (C) 1989, 1991 Free Software Foundation, Inc.
  19. //             675 Mass Ave, Cambridge, MA 02139, USA
  20. //
  21. //************************************************************************
  22.  
  23. #import <sys/ttydev.h>
  24.  
  25.  
  26. any_t gateThread(any_t arg);
  27. void childDidExit(void);
  28. void fdHandler (int theFd);
  29. void Init();                        // init ourselves 
  30. void openSerialPort(const char *deviceName);
  31. void sendScriptToModem(char *buffer);
  32. void strToScript(const char *buffer);
  33. void initThreaded(void);
  34. void catchalarm(int a);                    // timeout handler while sending script
  35. int lockPort(const char *dev);            // create uucp style lock on ser port
  36. void unlockPort();
  37. int translate_speed(int bps);
  38.  
  39.  
  40. /*
  41.  * List of valid speeds.
  42.  */
  43. struct speed {
  44.     int speed_int, speed_val;
  45. } speeds[] = {
  46. #ifdef B50
  47.     { 50, B50 },
  48. #endif
  49. #ifdef B75
  50.     { 75, B75 },
  51. #endif
  52. #ifdef B110
  53.     { 110, B110 },
  54. #endif
  55. #ifdef B134
  56.     { 134, B134 },
  57. #endif
  58. #ifdef B150
  59.     { 150, B150 },
  60. #endif
  61. #ifdef B200
  62.     { 200, B200 },
  63. #endif
  64. #ifdef B300
  65.     { 300, B300 },
  66. #endif
  67. #ifdef B600
  68.     { 600, B600 },
  69. #endif
  70. #ifdef B1200
  71.     { 1200, B1200 },
  72. #endif
  73. #ifdef B1800
  74.     { 1800, B1800 },
  75. #endif
  76. #ifdef B2000
  77.     { 2000, B2000 },
  78. #endif
  79. #ifdef B2400
  80.     { 2400, B2400 },
  81. #endif
  82. #ifdef B3600
  83.     { 3600, B3600 },
  84. #endif
  85. #ifdef B4800
  86.     { 4800, B4800 },
  87. #endif
  88. #ifdef B7200
  89.     { 7200, B7200 },
  90. #endif
  91. #ifdef B9600
  92.     { 9600, B9600 },
  93. #endif
  94. #ifdef B19200
  95.     { 19200, B19200 },
  96. #endif
  97. #ifdef B38400
  98.     { 38400, B38400 },
  99. #endif
  100. #ifdef EXTA
  101.     { 19200, EXTA },
  102. #endif
  103. #ifdef EXTB
  104.     { 38400, EXTB },
  105. #endif
  106. #ifdef B14400
  107.     { 14400, B14400 },
  108. #endif
  109. #ifdef B28800
  110.     { 28800, B28800 },
  111. #endif
  112. #ifdef B43200
  113.     { 43200, B43200 },
  114. #endif
  115. #ifdef B57600
  116.     { 57600, B57600 },
  117. #endif
  118. /*
  119. #ifndef B115200
  120. #warning Defining B115200
  121. #define B115200 20
  122. #endif
  123. */
  124. #ifdef B115200
  125.     { 115200, B115200 },
  126. #endif
  127.     { 0, 0 }
  128. };
  129.  
  130.  
  131.