home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: Volker.Schuermann@unnet.w.open.de@unnet (Volker Schuermann)
- Subject: v29i072: mbox - A Bulletin Board System for UNIX and MINIX, Part10/10
- Message-ID: <1992Apr5.183802.223@sparky.imd.sterling.com>
- X-Md4-Signature: c6ccfe4ccdb082c5134c7742ff53404a
- Date: Sun, 5 Apr 1992 18:38:02 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: Volker.Schuermann@unnet.w.open.de@unnet (Volker Schuermann)
- Posting-number: Volume 29, Issue 72
- Archive-name: mbox/part10
- Environment: MINIX, ISC, ESIX, SVR3
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: Announcement Quick.Start etc/active etc/inews.sh etc/intro
- # etc/mbd.log etc/mbox.calls etc/mbox.editors etc/mbox.seq
- # etc/mbox.who etc/pd.log etc/pd.script etc/reflector.log
- # etc/rmail.sh etc/tset src/HISTORY src/baudrate.c src/coreleft.c
- # src/games.c src/getch.c src/mbrsh.c src/patchlevel.h src/test.c
- # src/undef.c
- # Wrapped by kent@sparky on Sun Apr 5 11:57:48 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 10 (of 10)."'
- if test -f 'Announcement' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Announcement'\"
- else
- echo shar: Extracting \"'Announcement'\" \(701 characters\)
- sed "s/^X//" >'Announcement' <<'END_OF_FILE'
- XThis is the ix/MBox BBS for MINIX-386 (1.5.10 patched by BDE) and other
- XUNIX-Systems (SYSV/Sys7) without 64k segment limitation.
- X
- XRead the ANNOUNCEMENT (Message-ID: <295A0201.18@unnet.w.open.de> 26. Dec. 91)
- Xto get further information.
- X
- XHow to unpack:
- X
- X1. UUD the following 5 articles (you should get 'mbox.xa*')
- X2. Use the script ...
- X
- X--- cut here ---
- X
- Xcat mbox.x* > mbox.tar.Z
- Xmkdir /mbox # Use this directory to minimize problems
- Xcp *.Z /mbox
- Xcd /mbox
- Xuncompress *.Z
- Xtar ovx *.tar
- X. Quick.Start
- X
- X--- cut again ---
- X
- XDon't blame me for not using SHAR etc. ... primary this source was made and
- Xposted for MINIX-Freaks and so I use pure MINIX-Stuff to offer this package!
- X
- XRegard(s|less), Volker
- END_OF_FILE
- if test 701 -ne `wc -c <'Announcement'`; then
- echo shar: \"'Announcement'\" unpacked with wrong size!
- fi
- # end of 'Announcement'
- fi
- if test -f 'Quick.Start' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Quick.Start'\"
- else
- echo shar: Extracting \"'Quick.Start'\" \(497 characters\)
- sed "s/^X//" >'Quick.Start' <<'END_OF_FILE'
- X# If [/mbox] shouldn't be the HOME, you have to change the following files:
- X#
- X# [HOME/src/Makefile] -> Entry MBOXHOME
- X# [HOME/src/mbox.h] -> Entry HOME
- X#
- X# DON'T use this script, if you've made the changes!!!
- X
- X
- X# Create the ix/MBox (BBS) HOME-Directory
- X
- Xmkdir /mbox
- X
- X# Copy the Package to HOME
- X
- Xcp mbox.tar.Z /mbox
- X
- X# Jump there ...
- X
- Xcd /mbox
- X
- X# Unpack all
- X
- Xuncompress *.Z
- Xrm *.Z
- Xtar ovx *
- Xrm *.tar
- X
- X# Install the BBS (wrong ID etc. - i.e. testing only)
- X
- Xmake inst
- X
- X# Try to start ...
- X
- Xmbox
- X
- X
- X
- X
- END_OF_FILE
- if test 497 -ne `wc -c <'Quick.Start'`; then
- echo shar: \"'Quick.Start'\" unpacked with wrong size!
- fi
- # end of 'Quick.Start'
- fi
- if test -f 'etc/active' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/active'\"
- else
- echo shar: Extracting \"'etc/active'\" \(0 characters\)
- sed "s/^X//" >'etc/active' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/active'`; then
- echo shar: \"'etc/active'\" unpacked with wrong size!
- fi
- # end of 'etc/active'
- fi
- if test -f 'etc/inews.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/inews.sh'\"
- else
- echo shar: Extracting \"'etc/inews.sh'\" \(701 characters\)
- sed "s/^X//" >'etc/inews.sh' <<'END_OF_FILE'
- X#---------------------------------------------------------------------------
- X#
- X# ix/MBox I N E W S . S H
- X# Mailbox-Programm fuer UNIX(-Derivate)
- X#
- X# Volker Schuermann
- X# Wuppertal, FRG, 08.12.1991
- X#
- X#---------------------------------------------------------------------------
- X# Dieses Script uebergibt einen neuen Artikel an INEWS. Dieser Artikel
- X# enthaelt bereits einen (fast) kompletten Header.
- X#---------------------------------------------------------------------------
- X# Parameter:
- X#
- X# $1 -> Newsgroup, an die die Datei gesendet werden soll
- X# $2 -> Datei mit Artikel (s.o.)
- X#
- X# Beispiel:
- X#
- X# /usr/lib/news/inews -h < $2
- X
- X/usr/lib/news/inews -h < $2
- X
- END_OF_FILE
- if test 701 -ne `wc -c <'etc/inews.sh'`; then
- echo shar: \"'etc/inews.sh'\" unpacked with wrong size!
- fi
- # end of 'etc/inews.sh'
- fi
- if test -f 'etc/intro' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/intro'\"
- else
- echo shar: Extracting \"'etc/intro'\" \(24 characters\)
- sed "s/^X//" >'etc/intro' <<'END_OF_FILE'
- XWellcome to ix/MBox BBS
- END_OF_FILE
- if test 24 -ne `wc -c <'etc/intro'`; then
- echo shar: \"'etc/intro'\" unpacked with wrong size!
- fi
- # end of 'etc/intro'
- fi
- if test -f 'etc/mbd.log' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/mbd.log'\"
- else
- echo shar: Extracting \"'etc/mbd.log'\" \(0 characters\)
- sed "s/^X//" >'etc/mbd.log' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/mbd.log'`; then
- echo shar: \"'etc/mbd.log'\" unpacked with wrong size!
- fi
- # end of 'etc/mbd.log'
- fi
- if test -f 'etc/mbox.calls' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/mbox.calls'\"
- else
- echo shar: Extracting \"'etc/mbox.calls'\" \(0 characters\)
- sed "s/^X//" >'etc/mbox.calls' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/mbox.calls'`; then
- echo shar: \"'etc/mbox.calls'\" unpacked with wrong size!
- fi
- # end of 'etc/mbox.calls'
- fi
- if test -f 'etc/mbox.editors' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/mbox.editors'\"
- else
- echo shar: Extracting \"'etc/mbox.editors'\" \(627 characters\)
- sed "s/^X//" >'etc/mbox.editors' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* Diese Datei enthaelt die Liste der verfuegbaren Editoren. Die Struktur */
- X/* ist folgende: */
- X/* */
- X/* Name Pfad zum Editor */
- X/* ======================================================================= */
- X/* Led /usr/bin/led */
- X/* Vi /usr/bin/vi */
- X/* */
- X/* ACHTUNG: Zwischen Kommentar und Liste EINE Leerzeile einfuegen ! */
- X/***************************************************************************/
- X
- XLed /usr/bin/bled
- XMined /usr/bin/mined
- XVi /usr/bin/vi
- XMicroEmacs /usr/bin/me
- END_OF_FILE
- if test 627 -ne `wc -c <'etc/mbox.editors'`; then
- echo shar: \"'etc/mbox.editors'\" unpacked with wrong size!
- fi
- # end of 'etc/mbox.editors'
- fi
- if test -f 'etc/mbox.seq' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/mbox.seq'\"
- else
- echo shar: Extracting \"'etc/mbox.seq'\" \(2 characters\)
- sed "s/^X//" >'etc/mbox.seq' <<'END_OF_FILE'
- X1
- END_OF_FILE
- if test 2 -ne `wc -c <'etc/mbox.seq'`; then
- echo shar: \"'etc/mbox.seq'\" unpacked with wrong size!
- fi
- # end of 'etc/mbox.seq'
- fi
- if test -f 'etc/mbox.who' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/mbox.who'\"
- else
- echo shar: Extracting \"'etc/mbox.who'\" \(0 characters\)
- sed "s/^X//" >'etc/mbox.who' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/mbox.who'`; then
- echo shar: \"'etc/mbox.who'\" unpacked with wrong size!
- fi
- # end of 'etc/mbox.who'
- fi
- if test -f 'etc/pd.log' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/pd.log'\"
- else
- echo shar: Extracting \"'etc/pd.log'\" \(0 characters\)
- sed "s/^X//" >'etc/pd.log' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/pd.log'`; then
- echo shar: \"'etc/pd.log'\" unpacked with wrong size!
- fi
- # end of 'etc/pd.log'
- fi
- if test -f 'etc/pd.script' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/pd.script'\"
- else
- echo shar: Extracting \"'etc/pd.script'\" \(0 characters\)
- sed "s/^X//" >'etc/pd.script' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/pd.script'`; then
- echo shar: \"'etc/pd.script'\" unpacked with wrong size!
- fi
- # end of 'etc/pd.script'
- fi
- if test -f 'etc/reflector.log' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/reflector.log'\"
- else
- echo shar: Extracting \"'etc/reflector.log'\" \(0 characters\)
- sed "s/^X//" >'etc/reflector.log' <<'END_OF_FILE'
- END_OF_FILE
- if test 0 -ne `wc -c <'etc/reflector.log'`; then
- echo shar: \"'etc/reflector.log'\" unpacked with wrong size!
- fi
- # end of 'etc/reflector.log'
- fi
- if test -f 'etc/rmail.sh' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/rmail.sh'\"
- else
- echo shar: Extracting \"'etc/rmail.sh'\" \(727 characters\)
- sed "s/^X//" >'etc/rmail.sh' <<'END_OF_FILE'
- X#---------------------------------------------------------------------------
- X#
- X# ix/MBox R M A I L . S H
- X# Mailbox-Programm fuer UNIX(-Derivate)
- X#
- X# Volker Schuermann
- X# Wuppertal, FRG, 08.12.1991
- X#
- X#---------------------------------------------------------------------------
- X# Dieses Script uebergibt eine "persoenliche Mail" und eine Empfaenger-
- X# Adresse an das Programm RMAIL. Die "persoenliche Mail" enthaelt bereits
- X# einen (fast) kompletten Header !
- X#---------------------------------------------------------------------------
- X# Parameter:
- X#
- X# $1 -> Name der Datei ("persoenliche Mail" s.o.)
- X# $2 -> Empfaenger der Mail
- X#
- X# Beispiel:
- X#
- X# rmail -d -i $1 $2
- X
- Xrmail -d -i $1 $2
- END_OF_FILE
- if test 727 -ne `wc -c <'etc/rmail.sh'`; then
- echo shar: \"'etc/rmail.sh'\" unpacked with wrong size!
- fi
- # end of 'etc/rmail.sh'
- fi
- if test -f 'etc/tset' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'etc/tset'\"
- else
- echo shar: Extracting \"'etc/tset'\" \(21 characters\)
- sed "s/^X//" >'etc/tset' <<'END_OF_FILE'
- XTERM=$1
- Xexport TERM
- X
- END_OF_FILE
- if test 21 -ne `wc -c <'etc/tset'`; then
- echo shar: \"'etc/tset'\" unpacked with wrong size!
- fi
- chmod +x 'etc/tset'
- # end of 'etc/tset'
- fi
- if test -f 'src/HISTORY' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/HISTORY'\"
- else
- echo shar: Extracting \"'src/HISTORY'\" \(1757 characters\)
- sed "s/^X//" >'src/HISTORY' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/Mbox */
- X/* DATEI HISTORY */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 20.02.1992 */
- X/***************************************************************************/
- X
- X20.04.1991 -> Erste Versuche einen NEWS-Reader im Stil der alten "PC-Boxen"
- X zu basteln (sind positiv verlaufen)
- X
- X21.04.1991 -> Schreiben an NGs via PNEWS
- X
- X22.04.1991 -> REPLY via PNEWS
- X
- X23.04.1991 -> SH-unabhaengiges Accounting
- X
- X26.04.1991 -> Persoenliche Mail lesen, schreiben, beantworten
- X
- X11.05.1991 -> Inhalt/Datum, Status
- X
- X01.06.1991 -> Vorbereitung fuer die Portierung
- X
- X02.06.1991 -> Erste BETA-Test Version an die Portierer/Tester verschickt
- X
- X18.06.1991 -> Makro-Befehle implementiert
- X
- X15.08.1991 -> SVR3 einigermassen angepasst, LOCK-Mechanismus eingebaut,
- X NNPOST und RMAIL ermoeglicht, versuchweise _SYS_ACCOUNT
- X integriert
- X
- X21.09.1991 -> Scanner-Datum beim LOGOUT aktuallisieren, nicht mehr bei
- X init_user()
- X
- X21.10.1991 -> Option fuer Online-Spiele implementiert
- X
- X26.10.1991 -> Endlich ein "anstaendiges" Makefile:-)
- X
- X12.11.1991 -> Die Anspassung an SVR3 laeuft auf Hochtouren
- X
- X16.11.1991 -> Referenzversion 1.6.0 ueber "sub.os.minix" gepostet
- X
- X17.11.1991 -> Patchlevel PL1 fertiggestellt
- X
- X27.11.1991 -> Patchlevel PL3 mit schnellerem MB-DAEMON ausgeliefert
- X
- X06.12.1991 -> Umgestellt auf RMAIL & INEWS (Header mit Refs. etc.)
- X
- X28.12.1991 -> Internationale Version (DEFINES, README, etc.) ausgeliefert
- X
- X04.01.1992 -> MAIL- & NEWS-Header editierbar (Followup etc.)
- X
- X20.02.1992 -> Eigener DOWNLOAD-Befehl. MB-DAEMON erstellt LIB online (opt.)
- END_OF_FILE
- if test 1757 -ne `wc -c <'src/HISTORY'`; then
- echo shar: \"'src/HISTORY'\" unpacked with wrong size!
- fi
- # end of 'src/HISTORY'
- fi
- if test -f 'src/baudrate.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/baudrate.c'\"
- else
- echo shar: Extracting \"'src/baudrate.c'\" \(1710 characters\)
- sed "s/^X//" >'src/baudrate.c' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/Mbox */
- X/* DATEI baudrate.c */
- X/* FUNKTIONEN baudrate() */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 16.03.1992 */
- X/***************************************************************************/
- X
- X#include <stdio.h>
- X#include <time.h>
- X
- X#include "mbox.h"
- X
- X
- X#ifdef _SYS7 /* UNIX System 7 (MINIX, COHERENT, ...) */
- X
- X#include <sgtty.h>
- Xstatic struct sgttyb told;
- X
- X#else /* UNIX System V (UNIX, XENIX, ESIX, ...) */
- X
- X#include <sys/termio.h>
- Xstatic struct termio told;
- X
- X#endif
- X
- X
- X#define BYTE 0377 /* Don't ask me, ask Andy !! */
- X
- X
- Xint baudrate( try )
- Xint try;
- X{
- X int i, j = 0;
- X int guess = -1;
- X long ts, tn;
- X
- X
- X if(BAUDRATE != 0) return BAUDRATE;
- X
- X#ifdef _SYS7
- X
- X ioctl( 0, TIOCGETP, &told );
- X guess = (int) (100 * (told.sg_ospeed & BYTE));
- X
- X#else
- X
- X ioctl( 0, TCGETA, &told );
- X
- X if(told.c_cflag &= B300) guess = (int) 300;
- X if(told.c_cflag &= B1200) guess = (int) 1200;
- X if(told.c_cflag &= B2400) guess = (int) 2400;
- X if(told.c_cflag &= B4800) guess = (int) 4800;
- X if(told.c_cflag &= B9600) guess = (int) 9600;
- X /*
- X if(told.c_cflag &= B14400) guess = (int) 14400;
- X */
- X if(told.c_cflag &= B19200) guess = (int) 19200;
- X if(told.c_cflag &= B38400) guess = (int) 38400;
- X
- X#endif
- X
- X#ifdef _BAUDRATE /* HST mit 'fixed baudrate 19.2k' */
- X
- X if((guess == MAX_BPS) || (guess == 0)){
- X
- X guess = 300;
- X
- X if(try > 300) guess = 1200;
- X if(try > 1200) guess = 2400;
- X if(try > 2400) guess = 9600;
- X if(try > 9600) guess = 14400;
- X if(try > 14400) guess = 19200;
- X }
- X
- X#endif
- X
- X return guess;
- X
- X}
- END_OF_FILE
- if test 1710 -ne `wc -c <'src/baudrate.c'`; then
- echo shar: \"'src/baudrate.c'\" unpacked with wrong size!
- fi
- # end of 'src/baudrate.c'
- fi
- if test -f 'src/coreleft.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/coreleft.c'\"
- else
- echo shar: Extracting \"'src/coreleft.c'\" \(657 characters\)
- sed "s/^X//" >'src/coreleft.c' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/MBox */
- X/* DATEI coreleft.c */
- X/* FUNKTIONEN coreleft() */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 24.11.1991 */
- X/***************************************************************************/
- X
- X#ifdef _SYS7
- X#include <stdlib.h>
- X#else
- X#include <stdio.h>
- X#include <malloc.h>
- X#endif
- X
- X
- Xint coreleft()
- X{
- X char *buffer;
- X long size = 32L;
- X
- X do{
- X size *= 2;
- X buffer = malloc(size);
- X if(buffer != NULL) free( buffer );
- X }while(buffer != NULL);
- X
- X return (int) size;
- X}
- X
- END_OF_FILE
- if test 657 -ne `wc -c <'src/coreleft.c'`; then
- echo shar: \"'src/coreleft.c'\" unpacked with wrong size!
- fi
- # end of 'src/coreleft.c'
- fi
- if test -f 'src/games.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/games.c'\"
- else
- echo shar: Extracting \"'src/games.c'\" \(1155 characters\)
- sed "s/^X//" >'src/games.c' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/Mbox */
- X/* DATEI games.c */
- X/* FUNKTIONEN games() */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 25.11.1991 */
- X/***************************************************************************/
- X
- X#include <stdio.h>
- X#include "mbox.h"
- X
- X
- Xgames()
- X{
- X FILE *fp;
- X int i, c;
- X
- X char s[STRING];
- X char GAME[MAX_GAMES][STRING];
- X
- X
- X headline( GA01_MSG );
- X printf("\n");
- X
- X fp = fopen(GAMES, "r");
- X if (fp == NULL) {
- X nerror("games.c", 19, "games", "Datei-Lesefehler", GAMES);
- X }
- X i = 0;
- X while((fgets(s, 80, fp) != NULL) && (s[0] == '/'));
- X while((i < MAX_GAMES) && (fscanf(fp, "%s %s", s, GAME[i]) > 0)){
- X i++;
- X printf(" %d - %s\n\n", i, s);
- X }
- X fclose(fp);
- X
- X ansi("md");
- X printf("\n%s > ", GA02_MSG);
- X ansi("me");
- X
- X c = getint();
- X if(c > 32) printf("%c", c);
- X c -= 49;
- X
- X if((c >= 0) && (c < i)){
- X printf("\n\n");
- X sprintf(s, "%s %s %d %d", RSH, GAME[c], OLDUID, OLDGID);
- X system(s);
- X }
- X else{
- X ansi("md");
- X printf(" %s\n", GA03_MSG);
- X ansi("me");
- X }
- X}
- X
- END_OF_FILE
- if test 1155 -ne `wc -c <'src/games.c'`; then
- echo shar: \"'src/games.c'\" unpacked with wrong size!
- fi
- # end of 'src/games.c'
- fi
- if test -f 'src/getch.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/getch.c'\"
- else
- echo shar: Extracting \"'src/getch.c'\" \(1728 characters\)
- sed "s/^X//" >'src/getch.c' <<'END_OF_FILE'
- X/*
- X * %Z% %M% %I% %D% %Q%
- X *
- X * Copyright (C) 1990 by Christian Schlichtherle
- X * (chriss@attron.ruhr.sub.org)
- X *
- X * %M% - C module for getch(S).
- X *
- X * "getch" is a DOS and curses(S) like function which reads
- X * a character and returns immediately without waiting for
- X * newline.
- X *
- X *
- X * MINIX-Version (this one) (!(c)) 4/1991
- X * by Volker Schuermann
- X * (volkers@unnet.ruhr.sub.org)
- X *
- X *
- X */
- X
- X
- X#if !defined(lint) && !defined(library)
- Xstatic char sccsid[] = "%Z% %M% %I% %D% %Q%";
- X#endif /* not lint and not library */
- X
- X#include <sys/types.h>
- X#include <stdio.h>
- X#include <unistd.h>
- X#include <errno.h>
- X#include <sgtty.h>
- X
- X
- X/*
- X * getch - Gets a character.
- X * This function gets one character and immediately returns
- X * without waiting for newline. The character is not echoed.
- X * This function can be used best when you want to input only one
- X * character within canonical input or if you need this function
- X * only very rarely.
- X * EOF is returned on errors or if an ignored signal occured.
- X */
- Xint getch()
- X{
- X static struct sgttyb told, tnew;
- X static int set = 0;
- X int rstat;
- X char c;
- X
- X if (!set) {
- X /* Get old terminal mode. */
- X
- X ioctl( 0, TIOCGETP, &told );
- X
- X
- X /*
- X * Set new terminal mode. Switch off
- X * canonical input and echoing.
- X */
- X tnew = told;
- X
- X tnew.sg_flags |= RAW;
- X tnew.sg_flags &= ~ECHO;
- X
- X /* Don't execute this part anymore. */
- X set = 1;
- X }
- X
- X /* Set new terminal mode. */
- X ioctl(0, TIOCSETP, &tnew);
- X
- X /* Read one character. */
- X rstat = read(0, &c, 1);
- X
- X /* Reset old terminal mode.
- X Don't get disturbed by ignored signals. */
- X while (ioctl(0, TIOCSETP, &told) == -1)
- X if (errno != EINTR)
- X return (EOF);
- X
- X if (rstat != 1)
- X return (EOF);
- X return((int)c);
- X}
- X
- X
- X
- END_OF_FILE
- if test 1728 -ne `wc -c <'src/getch.c'`; then
- echo shar: \"'src/getch.c'\" unpacked with wrong size!
- fi
- # end of 'src/getch.c'
- fi
- if test -f 'src/mbrsh.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/mbrsh.c'\"
- else
- echo shar: Extracting \"'src/mbrsh.c'\" \(725 characters\)
- sed "s/^X//" >'src/mbrsh.c' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/Mbox */
- X/* DATEI mbrsh.c */
- X/* FUNKTIONEN main() */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 16.11.1991 */
- X/***************************************************************************/
- X
- X#include <stdio.h>
- X#include <sys/types.h>
- X#include <unistd.h>
- X
- Xint main(argc, argv)
- Xint argc;
- Xchar *argv[];
- X{
- X char s[255];
- X int i, j;
- X
- X setgid( atoi(argv[argc -1]) );
- X setuid( atoi(argv[argc -2]) );
- X
- X strcpy(s, "exec ");
- X j = argc -2;
- X
- X for(i = 1; i < j; i++){
- X strcat(s, argv[i]);
- X strcat(s, " ");
- X }
- X
- X system( s );
- X
- X return 0;
- X}
- END_OF_FILE
- if test 725 -ne `wc -c <'src/mbrsh.c'`; then
- echo shar: \"'src/mbrsh.c'\" unpacked with wrong size!
- fi
- # end of 'src/mbrsh.c'
- fi
- if test -f 'src/patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/patchlevel.h'\"
- else
- echo shar: Extracting \"'src/patchlevel.h'\" \(602 characters\)
- sed "s/^X//" >'src/patchlevel.h' <<'END_OF_FILE'
- X/***************************************************************************/
- X/* PROGRAMM ix/MBox */
- X/* DATEI patchlevel.h */
- X/* AUTOR vs (Volker Schuermann/MINIX-Version) */
- X/* LETZTE AENDERUNG 28.02.1992 */
- X/***************************************************************************/
- X
- X/***************************************************************************/
- X/* PATCHLEVEL - Nummer der zuletzt installierten CDIFFS */
- X/***************************************************************************/
- X
- X#define PATCHLEVEL "PL9a"
- END_OF_FILE
- if test 602 -ne `wc -c <'src/patchlevel.h'`; then
- echo shar: \"'src/patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'src/patchlevel.h'
- fi
- if test -f 'src/test.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/test.c'\"
- else
- echo shar: Extracting \"'src/test.c'\" \(128 characters\)
- sed "s/^X//" >'src/test.c' <<'END_OF_FILE'
- Xmain()
- X{
- X char s[80];
- X int i;
- X
- X for( i = 0; i < 10; i++){
- X *(s + i) = 'B';
- X }
- X s[i] = '\0';
- X
- X printf("%s", s);
- X
- X
- X}
- END_OF_FILE
- if test 128 -ne `wc -c <'src/test.c'`; then
- echo shar: \"'src/test.c'\" unpacked with wrong size!
- fi
- # end of 'src/test.c'
- fi
- if test -f 'src/undef.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/undef.c'\"
- else
- echo shar: Extracting \"'src/undef.c'\" \(17 characters\)
- sed "s/^X//" >'src/undef.c' <<'END_OF_FILE'
- X#undef _MBOX
- X
- X
- X
- X
- END_OF_FILE
- if test 17 -ne `wc -c <'src/undef.c'`; then
- echo shar: \"'src/undef.c'\" unpacked with wrong size!
- fi
- # end of 'src/undef.c'
- fi
- echo shar: End of archive 10 \(of 10\).
- cp /dev/null ark10isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 10 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-