home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / alt / sources / 3066 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  4.7 KB

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!rutgers!modus!lpds!wcp
  2. From: wcp@lpds.sublink.org (Walter C. Pelissero)
  3. Newsgroups: alt.sources
  4. Subject: mgetty - A modular getty v1.0, Part04/04
  5. Message-ID: <1993Jan22.162351.1026@lpds.sublink.org>
  6. Date: 22 Jan 93 16:23:51 GMT
  7. Organization: Sweet home under white clouds
  8. Lines: 187
  9. Phone: + 39 2 8464117 - 8435411 (work)    8267089 (home)
  10. Postal-Address: Via G. de Ruggiero 87, 20142 Milano - Italia
  11.  
  12. Submitted-by: wcp@lpds
  13. Archive-name: mgetty-1.0/part04
  14.  
  15. ---- Cut Here and feed the following to sh ----
  16. #!/bin/sh
  17. # this is mgetty10.04 (part 4 of mgetty-1.0)
  18. # do not concatenate these parts, unpack them in order with /bin/sh
  19. # file zyxel.c continued
  20. #
  21. if test ! -r _shar_seq_.tmp; then
  22.     echo 'Please unpack part 1 first!'
  23.     exit 1
  24. fi
  25. (read Scheck
  26.  if test "$Scheck" != 4; then
  27.     echo Please unpack part "$Scheck" next!
  28.     exit 1
  29.  else
  30.     exit 0
  31.  fi
  32. ) < _shar_seq_.tmp || exit 1
  33. if test ! -f _shar_wnt_.tmp; then
  34.     echo 'x - still skipping zyxel.c'
  35. else
  36. echo 'x - continuing file zyxel.c'
  37. sed 's/^X//' << 'SHAR_EOF' >> 'zyxel.c' &&
  38. X  "NO DIAL TONE",
  39. X  "BUSY",
  40. X  "NO ANSWER",
  41. X  "+FCON",
  42. X  "+FDCS:",
  43. X  "+FDIS:",
  44. X  "+FCFR",
  45. X  "+FTSI:",
  46. X  "+FCSI:",
  47. X  "+FPTS:",
  48. X  "+FET:",
  49. X  "+FHNG:",
  50. X  "VCON",
  51. X  0
  52. X};
  53. X
  54. Xshort C2_resolution = -1, C2_baud = -1, C2_width, C2_length, C2_compression;
  55. Xshort C2_errCorr, C2_eop = -1;
  56. Xchar C2_caller[30] = "";
  57. X
  58. XModemReturnCode receive(unsigned t, int fd)
  59. X{
  60. X  ModemReturnCode ret;
  61. X
  62. X  if (mdread(t, fd, ModemAnswers, &ret))
  63. X    {
  64. X      switch (ret)
  65. X    {
  66. X      char *p;
  67. X      static char sep[] = ", ";
  68. X
  69. X    case MDFDCS:
  70. X      p = strstr(mdread_buffer, "+FDCS:") + strlen("+FDCS:");
  71. X      *strpbrk(p, "\r;\n") = '\0'; /* null terminate */
  72. X      C2_resolution = atoi(strtok(p, sep));
  73. X      C2_baud = atoi(strtok(0, sep));
  74. X      C2_width = atoi(strtok(0, sep));
  75. X      C2_length = atoi(strtok(0, sep));
  76. X      C2_compression = atoi(strtok(0, sep));
  77. X      C2_errCorr = atoi(strtok(0, sep));
  78. X      break;
  79. X    case MDFDIS:
  80. X    case MDFCFR:
  81. X      break;
  82. X    case MDFTSI:
  83. X      p = strstr(mdread_buffer, "+FTSI:") + strlen("+FTSI:");
  84. X      *strchr(p, '\r') = '\0';
  85. X      strncpy(C2_caller, p, sizeof(C2_caller));
  86. X      C2_caller[sizeof(C2_caller) - 1] = '\0';
  87. X      break;
  88. X    case MDFCSI:
  89. X    case MDFPTS:
  90. X      break;
  91. X    case MDFET:
  92. X      p = strstr(mdread_buffer, "+FET:") + strlen("+FET:");
  93. X      *strpbrk(p, "\r,;\n") = '\0';
  94. X      C2_eop = atoi(p);
  95. X      break;
  96. X    case MDFHNG:
  97. X    case MDVCON:
  98. X    default:
  99. X      break;
  100. X    }
  101. X      return ret;
  102. X    }
  103. X  return MDERROR;
  104. X}
  105. SHAR_EOF
  106. echo 'File zyxel.c is complete' &&
  107. true || echo 'restore of zyxel.c failed'
  108. rm -f _shar_wnt_.tmp
  109. fi
  110. # ============= zyxel.h ==============
  111. if test -f 'zyxel.h' -a X"$1" != X"-c"; then
  112.     echo 'x - skipping zyxel.h (File already exists)'
  113.     rm -f _shar_wnt_.tmp
  114. else
  115. > _shar_wnt_.tmp
  116. echo 'x - extracting zyxel.h (Text)'
  117. sed 's/^X//' << 'SHAR_EOF' > 'zyxel.h' &&
  118. X/*
  119. X * @(#)$Id: zyxel.h,v 1.1 1993/01/06 18:18:07 wcp Exp $
  120. X *
  121. X * Copyright (C) 1993    Walter Pelissero
  122. X *
  123. X * This program is free software; you can redistribute it and/or modify
  124. X * it under the terms of the GNU General Public License as published by
  125. X * the Free Software Foundation; either version 2 of the License, or
  126. X * (at your option) any later version.
  127. X *
  128. X * This program is distributed in the hope that it will be useful,
  129. X * but WITHOUT ANY WARRANTY; without even the implied warranty of
  130. X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  131. X * GNU General Public License for more details.
  132. X *
  133. X * You should have received a copy of the GNU General Public License
  134. X * along with this program; if not, write to the Free Software
  135. X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  136. X */
  137. X
  138. X/*
  139. X * $Log: zyxel.h,v $
  140. X * Revision 1.1  1993/01/06  18:18:07  wcp
  141. X * Initial revision
  142. X *
  143. X */
  144. X
  145. X#ifndef _zyxel_h_INCLUDED
  146. X#define _zyxel_h_INCLUDED
  147. X
  148. Xtypedef enum {
  149. X  MDERROR,
  150. X  MDOK,
  151. X  MDRING,
  152. X  MDCONNECT1200,
  153. X  MDCONNECT2400,
  154. X  MDCONNECT4800,
  155. X  MDCONNECT9600,
  156. X  MDCONNECT19200,
  157. X  MDCONNECT7200,
  158. X  MDCONNECT12000,
  159. X  MDCONNECT14400,
  160. X  MDCONNECT16800,
  161. X  MDCONNECT38400,
  162. X  MDCONNECT57600,
  163. X  MDCONNECT76800,
  164. X  MDCONNECT,
  165. X  MDNOCARRIER,
  166. X  MDNODIALTONE,
  167. X  MDBUSY,
  168. X  MDNOANSWER,
  169. X  MDFCON,
  170. X  MDFDCS,
  171. X  MDFDIS,
  172. X  MDFCFR,
  173. X  MDFTSI,
  174. X  MDFCSI,
  175. X  MDFPTS,
  176. X  MDFET,
  177. X  MDFHNG,
  178. X  MDVCON,
  179. X  MDLAST_ANS = MDVCON
  180. X  } ModemReturnCode;
  181. X
  182. Xextern const char *ModemAnswers[];
  183. Xextern ModemReturnCode receive(unsigned, int);
  184. Xextern short C2_resolution, C2_eop, C2_baud, C2_width, C2_length;
  185. Xextern short C2_compression, C2_errCorr;
  186. Xextern char C2_caller[];
  187. X
  188. X#endif /* _zyxel_h_INCLUDED */
  189. SHAR_EOF
  190. true || echo 'restore of zyxel.h failed'
  191. rm -f _shar_wnt_.tmp
  192. fi
  193. rm -f _shar_seq_.tmp
  194. echo You have unpacked the last part
  195. exit 0
  196.  
  197. -- 
  198. P4 32 8 @A ^@@A ^@@Ax^@@A ^@DA"^@D]%xJe&H1\236\331\306
  199.