home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!rutgers!modus!lpds!wcp
- From: wcp@lpds.sublink.org (Walter C. Pelissero)
- Newsgroups: alt.sources
- Subject: mgetty - A modular getty v1.0, Part04/04
- Message-ID: <1993Jan22.162351.1026@lpds.sublink.org>
- Date: 22 Jan 93 16:23:51 GMT
- Organization: Sweet home under white clouds
- Lines: 187
- Phone: + 39 2 8464117 - 8435411 (work) 8267089 (home)
- Postal-Address: Via G. de Ruggiero 87, 20142 Milano - Italia
-
- Submitted-by: wcp@lpds
- Archive-name: mgetty-1.0/part04
-
- ---- Cut Here and feed the following to sh ----
- #!/bin/sh
- # this is mgetty10.04 (part 4 of mgetty-1.0)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file zyxel.c continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 4; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping zyxel.c'
- else
- echo 'x - continuing file zyxel.c'
- sed 's/^X//' << 'SHAR_EOF' >> 'zyxel.c' &&
- X "NO DIAL TONE",
- X "BUSY",
- X "NO ANSWER",
- X "+FCON",
- X "+FDCS:",
- X "+FDIS:",
- X "+FCFR",
- X "+FTSI:",
- X "+FCSI:",
- X "+FPTS:",
- X "+FET:",
- X "+FHNG:",
- X "VCON",
- X 0
- X};
- X
- Xshort C2_resolution = -1, C2_baud = -1, C2_width, C2_length, C2_compression;
- Xshort C2_errCorr, C2_eop = -1;
- Xchar C2_caller[30] = "";
- X
- XModemReturnCode receive(unsigned t, int fd)
- X{
- X ModemReturnCode ret;
- X
- X if (mdread(t, fd, ModemAnswers, &ret))
- X {
- X switch (ret)
- X {
- X char *p;
- X static char sep[] = ", ";
- X
- X case MDFDCS:
- X p = strstr(mdread_buffer, "+FDCS:") + strlen("+FDCS:");
- X *strpbrk(p, "\r;\n") = '\0'; /* null terminate */
- X C2_resolution = atoi(strtok(p, sep));
- X C2_baud = atoi(strtok(0, sep));
- X C2_width = atoi(strtok(0, sep));
- X C2_length = atoi(strtok(0, sep));
- X C2_compression = atoi(strtok(0, sep));
- X C2_errCorr = atoi(strtok(0, sep));
- X break;
- X case MDFDIS:
- X case MDFCFR:
- X break;
- X case MDFTSI:
- X p = strstr(mdread_buffer, "+FTSI:") + strlen("+FTSI:");
- X *strchr(p, '\r') = '\0';
- X strncpy(C2_caller, p, sizeof(C2_caller));
- X C2_caller[sizeof(C2_caller) - 1] = '\0';
- X break;
- X case MDFCSI:
- X case MDFPTS:
- X break;
- X case MDFET:
- X p = strstr(mdread_buffer, "+FET:") + strlen("+FET:");
- X *strpbrk(p, "\r,;\n") = '\0';
- X C2_eop = atoi(p);
- X break;
- X case MDFHNG:
- X case MDVCON:
- X default:
- X break;
- X }
- X return ret;
- X }
- X return MDERROR;
- X}
- SHAR_EOF
- echo 'File zyxel.c is complete' &&
- true || echo 'restore of zyxel.c failed'
- rm -f _shar_wnt_.tmp
- fi
- # ============= zyxel.h ==============
- if test -f 'zyxel.h' -a X"$1" != X"-c"; then
- echo 'x - skipping zyxel.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting zyxel.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'zyxel.h' &&
- X/*
- X * @(#)$Id: zyxel.h,v 1.1 1993/01/06 18:18:07 wcp Exp $
- X *
- X * Copyright (C) 1993 Walter Pelissero
- X *
- X * This program is free software; you can redistribute it and/or modify
- X * it under the terms of the GNU General Public License as published by
- X * the Free Software Foundation; either version 2 of the License, or
- X * (at your option) any later version.
- X *
- X * This program is distributed in the hope that it will be useful,
- X * but WITHOUT ANY WARRANTY; without even the implied warranty of
- X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X * GNU General Public License for more details.
- X *
- X * You should have received a copy of the GNU General Public License
- X * along with this program; if not, write to the Free Software
- X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- X */
- X
- X/*
- X * $Log: zyxel.h,v $
- X * Revision 1.1 1993/01/06 18:18:07 wcp
- X * Initial revision
- X *
- X */
- X
- X#ifndef _zyxel_h_INCLUDED
- X#define _zyxel_h_INCLUDED
- X
- Xtypedef enum {
- X MDERROR,
- X MDOK,
- X MDRING,
- X MDCONNECT1200,
- X MDCONNECT2400,
- X MDCONNECT4800,
- X MDCONNECT9600,
- X MDCONNECT19200,
- X MDCONNECT7200,
- X MDCONNECT12000,
- X MDCONNECT14400,
- X MDCONNECT16800,
- X MDCONNECT38400,
- X MDCONNECT57600,
- X MDCONNECT76800,
- X MDCONNECT,
- X MDNOCARRIER,
- X MDNODIALTONE,
- X MDBUSY,
- X MDNOANSWER,
- X MDFCON,
- X MDFDCS,
- X MDFDIS,
- X MDFCFR,
- X MDFTSI,
- X MDFCSI,
- X MDFPTS,
- X MDFET,
- X MDFHNG,
- X MDVCON,
- X MDLAST_ANS = MDVCON
- X } ModemReturnCode;
- X
- Xextern const char *ModemAnswers[];
- Xextern ModemReturnCode receive(unsigned, int);
- Xextern short C2_resolution, C2_eop, C2_baud, C2_width, C2_length;
- Xextern short C2_compression, C2_errCorr;
- Xextern char C2_caller[];
- X
- X#endif /* _zyxel_h_INCLUDED */
- SHAR_EOF
- true || echo 'restore of zyxel.h failed'
- rm -f _shar_wnt_.tmp
- fi
- rm -f _shar_seq_.tmp
- echo You have unpacked the last part
- exit 0
-
- --
- P4 32 8 @A ^@@A ^@@Ax^@@A ^@DA"^@D]%xJe&H1\236\331\306
-