ml@brumuc.bru.sub.org (Marc Laukien) (01/22/91)
#!/bin/sh # this is chat.02 (part 2 of UnixChat) # do not concatenate these parts, unpack them in order with /bin/sh # file cm/int.c continued # if touch 2>&1 | fgrep 'amc' > /dev/null then TOUCH=touch else TOUCH=true fi if test ! -r shar3_seq_.tmp; then echo "Please unpack part 1 first!" exit 1 fi (read Scheck if test "$Scheck" != 2; then echo "Please unpack part $Scheck next!" exit 1 else exit 0 fi ) < shar3_seq_.tmp || exit 1 echo "x - Continuing file cm/int.c" sed 's/^X//' << 'SHAR_EOF' >> cm/int.c && X if(userlist[j].pid!= -1 && userlist[j].pid!= msg->pid) X send_msg(&umsg,&userlist[j]);/* senden */ X } X break; X X case CNAME: /* Namen aendern */ X i=0; X while(userlist[i].pid != msg->pid && i<MAXUSER) X i++; /* Eintrag suchen */ X X if(i!=MAXUSER) /* gefunden ? */ X { X UMSG umsg; X X sprintf(umsg.text,"%s %s",userlist[i].cname,msg->text); X umsg.typ=CNAME; /* Message aufbereiten */ X X strcpy(userlist[i].cname,msg->text); /* neuer Name */ X X for(j=0;j<MAXUSER;j++) /* alle User durchgehen */ X if(userlist[j].pid!= -1 && userlist[j].pid!= msg->pid) X send_msg(&umsg,&userlist[j]);/* senden */ X X write_conf(); /* Conf-Datei neu anlegen */ X } X break; X X case KILL: /* User rauswerfen */ X i=0; X while(userlist[i].pid != msg->pid && i<MAXUSER) X i++; /* Eintrag suchen */ X X if(i!=MAXUSER) /* gefunden ? */ X { X int k; X UMSG umsg,umsg2; X X /* --- rauswerfen ----------------------------- */ X sprintf(umsg.text,"%s",userlist[i].cname); X umsg.typ=QUIT; /* Message aufbereiten */ X X for(j=0;j<MAXUSER;j++) /* alle User durchgehen */ X if(!strcmp(userlist[j].name,msg->text) && userlist[j].pid!= -1) X { X send_msg(&umsg,&userlist[j]);/* senden */ X X /* --- anderen mitteilen -------------- */ X sprintf(umsg2.text,"%s",userlist[j].cname); X umsg2.typ=KILL; /* Message aufbereiten */ X X userlist[j].pid= -1; /* Daten loeschen */ X usernr--; /* ein User weniger */ X X for(k=0;k<MAXUSER;k++) /* alle User durchgehen */ X if(userlist[k].pid!= -1) /* senden */ X send_msg(&umsg2,&userlist[k]); X } X X write_conf(); /* Conf-Datei neu anlegen */ X } X break; X X } /* Ende switch */ X } X while(msg->typ != QUIT); X} X X/*----------------------------------------------------------------------*/ X/* Konferenzdatei neuschreiben */ X/*----------------------------------------------------------------------*/ X Xvoid write_conf() X X{ X char str[STRLEN]; X FILE *fp; /* Filepointer */ X int i; X X sprintf(str,"confdir/%s",conf); /* Konferenz-File */ X X fp=fopen(str,"w"); /* oeffnen */ X X if(fp==(FILE *)0) /* schon belegt ? */ X { X fprintf(stderr,"%s: %s\n",pname,sys_errlist[errno]); X deinit(); X exit(2); X } X X fprintf(fp,"%ld\n",key); /* Key schreiben */ X fprintf(fp,"%s\n",password); /* Password schreiben */ X X for(i=0;i<MAXUSER;i++) /* alle User durchgehen */ X if(userlist[i].pid!= -1) /* Name schreiben */ X fprintf(fp,"%s %s\n", X userlist[i].name,userlist[i].cname); X X fclose(fp); /* schliessen */ X} SHAR_EOF echo "File cm/int.c is complete" && $TOUCH -am 0806102590 cm/int.c && chmod 0600 cm/int.c || echo "restore of cm/int.c failed" set `wc -c cm/int.c`;Wc_c=$1 if test "$Wc_c" != "5033"; then echo original size 5033, current size $Wc_c fi # ============= cm/main.c ============== echo "x - extracting cm/main.c (Text)" sed 's/^X//' << 'SHAR_EOF' > cm/main.c && X/*----------------------------------------------------------------------*/ X/* */ X/* Name: ChatManager V2.9 */ X/* */ X/* Programmteil: Hauptprogramm */ X/* */ X/* Library: UNIX V */ X/* */ X/* Autor: Marc Laukien */ X/* */ X/*----------------------------------------------------------------------*/ X X#include <sys/types.h> X#include <stdio.h> X#include <signal.h> X#include "cm.h" X Xextern char *getcwd(); X X/* globale Variablen */ X Xchar *pname; /* Programmname: argv[0] */ Xchar *cwd; /* Working Directory */ Xchar conf[STRLEN]="sysconf"; /* Konferenzname */ Xint conf_on=0; /* 0: Konferenz noch nicht an */ Xint stop=1; /* 1 = nach WAITTIME anhalten */ Xchar password[STRLEN]=STDPASS; /* Passwort */ X Xlong key= -1; /* Key der Manager-FIFO */ Xint fifofd= -1; /* Manager FIFO fd */ X XUSER userlist[MAXUSER]; /* Liste aller Teilnehmer */ Xint usernr=0; /* Number of Users */ X X/*----------------------------------------------------------------------*/ X/* Hauptprogramm */ X/*----------------------------------------------------------------------*/ X Xint main(argc,argv,envp) X Xint argc; Xchar *argv[]; Xchar *envp[]; X{ X extern char *optarg; X extern int optind,opterr; X char ch; X X cwd=getcwd((char *)0,STRLEN); /* Directory retten */ X chdir(LIBDIR); /* Directory einstellen */ X X signal(SIGHUP,interrupt); /* Interrupt einstellen */ X signal(SIGINT,interrupt); X signal(SIGQUIT,interrupt); X signal(SIGTERM,interrupt); X X pname=argv[0]; /* Programmname */ X X /* Optionen einlesen *******************************************/ X X opterr=1; X while((ch=getopt(argc,argv,"p:c:n"))!=EOF) X switch(ch) X { X case 'c': /* andere Konferenz */ X strcpy(conf,optarg); X break; X X case 'p': /* andere Konferenz */ X strcpy(password,optarg); X break; X X case 'n': /* nicht aufhoeren */ X stop=0; X break; X X case '?': /* Fehler */ X opterr++; X break; X } X X if(opterr>1) /* falsche Optionen */ X { X fprintf(stderr, X "usage: %s [-c conf] [-p password] [-n]\n",pname); X exit(2); X } X X /* Ende Optionen einlesen **************************************/ X X if(strlen(conf)>10) /* Name zu lang ? */ X { X fprintf(stderr,"%s: conference name too long\n",pname); X exit(2); X } X X init(); /* Initialisierungen */ X X msg_int(); /* Messageinterpreter */ X X deinit(); /* Deinitialisierungen */ X X return(0); /* Tschuess */ X} X X/*----------------------------------------------------------------------*/ X/* Interruptroutine */ X/*----------------------------------------------------------------------*/ X Xvoid interrupt() X X{ X deinit(); X exit(0); X} X SHAR_EOF $TOUCH -am 0806102590 cm/main.c && chmod 0600 cm/main.c || echo "restore of cm/main.c failed" set `wc -c cm/main.c`;Wc_c=$1 if test "$Wc_c" != "2689"; then echo original size 2689, current size $Wc_c fi # ============= cm/comm.c ============== echo "x - extracting cm/comm.c (Text)" sed 's/^X//' << 'SHAR_EOF' > cm/comm.c && X/*----------------------------------------------------------------------*/ X/* */ X/* Name: ChatManager V2.9 */ X/* */ X/* Programmteil: Kommunikation */ X/* */ X/* Library: UNIX V */ X/* */ X/* Autor: Marc Laukien */ X/* */ X/*----------------------------------------------------------------------*/ X X#include <stdio.h> X#include <fcntl.h> X#include <errno.h> X#include <setjmp.h> X#include <signal.h> X#include "cm.h" X Xjmp_buf env; /* Environment */ X X/*----------------------------------------------------------------------*/ X/* Message empfangen */ X/*----------------------------------------------------------------------*/ X XMSG *recv_msg() X{ X static MSG msg; /* Message */ X int ret; /* Return von read() */ X X if(usernr==0 && stop) /* nach WAITTIME secs beenden */ X { /* falls kein User mehr */ X signal(SIGALRM,interrupt);/* Interrupt setzen */ X alarm(WAITTIME); /* Wecker setzen */ X } X X if(setjmp(env)==0) /* Interrupt ? */ X { X while((ret=read(fifofd,&msg,sizeof(MSG)))==0) X /* empfangen */ X sleep(2); X X if(ret == -1) X { X fprintf(stderr,"%s: %s (recv_msg)\n" X ,pname,sys_errlist[errno]); X deinit(); X exit(2); /* Fehler */ X } X } X else X msg.typ=QUIT; /* Aussteigen */ X X signal(SIGALRM,SIG_IGN); /* Interrupt ruecksetzen */ X X return(&msg); /* Message als Returnwert */ X} X Xstatic void interrupt() X{ X longjmp(env,1); /* Ruecksprung */ X} X X/*----------------------------------------------------------------------*/ X/* Message senden */ X/*----------------------------------------------------------------------*/ X Xvoid send_msg(umsg,user) X XMSG *umsg; /* zu sendende Message */ XUSER *user; /* Benutzer */ X{ X int fd; X char str[STRLEN]; X X sprintf(str,"fifodir/%ld",user->key); X fd=open(str,O_WRONLY | O_NDELAY); /* FIFO oeffnen */ X if(fd== -1) /* Fehler ? */ X { X user->pid= -1; /* Daten loeschen */ X usernr--; /* ein User weniger */ X } X X if(write(fd,umsg,sizeof(UMSG)) == -1) /* senden */ X { X fprintf(stderr,"%s: %s (send_msg)\n",pname,sys_errlist[errno]); X user->pid= -1; /* User sperren */ X X write_conf(); /* Conf-Datei neu anlegen */ X } X else /* senden gelungen */ X kill(user->pid,SIGUSR1); /* unterbrechen */ X X close(fd); X} SHAR_EOF $TOUCH -am 0106163991 cm/comm.c && chmod 0600 cm/comm.c || echo "restore of cm/comm.c failed" set `wc -c cm/comm.c`;Wc_c=$1 if test "$Wc_c" != "2311"; then echo original size 2311, current size $Wc_c fi # ============= ch/lex.l ============== echo "x - extracting ch/lex.l (Text)" sed 's/^X//' << 'SHAR_EOF' > ch/lex.l && X/*----------------------------------------------------------------------*/ X/* */ X/* Name: Chat V2.9 */ X/* */ X/* Programmteil: externe Strings einlesen */ X/* */ X/* Library: UNIX V + lex */ X/* */ X/* Autor: Marc Laukien */ X/* */ X/*----------------------------------------------------------------------*/ X X%{ X#include <string.h> X#include <ctype.h> X Xextern char *malloc(); Xextern void exit(); X Xextern char *pname; /* Programmname */ Xextern char lang[]; /* langinitionfile */ Xextern int errno; /* Fehlernummer */ Xextern char *sys_errlist[]; /* Fehlertexte */ X Xextern int atoi(); X Xvoid lex(); Xstatic void insert(); Xstatic int getnr(); X Xstatic char str[100]; /* String */ X Xchar *cmds; /* Kommandos */ Xchar *prompt; /* Prompt */ Xchar *press_key; /* Tastendruck */ Xchar *conf_name; /* Konferenzname */ Xchar *password; /* Passwort */ Xchar *arr; /* Ankunft */ Xchar *dep; /* Verlassen */ Xchar *start; /* Startmeldung */ Xchar *fire; /* Rauswurf */ Xchar *help; /* helpfile */ Xchar *menufile; /* Menuefile */ Xchar *invit; /* Einladung */ Xchar *who; /* Who-Kommando */ Xchar *msg; /* msg-Kommando */ Xchar *inv; /* invitation-Kommando */ Xchar *nouser; /* User gibt es nicht */ Xchar *not_online; /* User nicht online */ Xchar *nocmd; /* Fehler */ Xchar *nomode; /* Unbekannter Modus */ Xchar *nomsg; /* Messages gesperrt */ Xchar *members; /* Teilnehmer */ Xchar *msg_from; /* Nachricht von */ X X%} X XT [ \t] XS \".*\" XN "["[0-9]*"]" X%% X#.*\n { ; /* Kommentar */ } X"cmds"{T}*{S} { insert(&cmds); } X"prompt"{T}*{S} { insert(&prompt); } X"press_key"{T}*{S} { insert(&press_key); } X"conf_name"{T}*{S} { insert(&conf_name); } X"password"{T}*{S} { insert(&password); } X"arrival"{T}*{S} { insert(&arr); } X"departure"{T}*{S} { insert(&dep); } X"kill"{T}*{S} { insert(&fire); } X"start"{T}*{S} { insert(&start); } X"help"{T}*{S} { insert(&help); } X"menu"{T}*{S} { insert(&menufile); } X"invit"{T}*{S} { insert(&invit); } X"who"{T}*{S} { insert(&who); } X"msg"{T}*{S} { insert(&msg); } X"inv"{T}*{S} { insert(&inv); } X"nouser"{T}*{S} { insert(&nouser); } X"not_online"{T}*{S} { insert(¬_online); } X"nocmd"{T}*{S} { insert(&nocmd); } X"nomsg"{T}*{S} { insert(&nomsg); } X"nomode"{T}*{S} { insert(&nomode); } X"members"{T}*{S} { insert(&members); } X"msg_from"{T}*{S} { insert(&msg_from); } X X[ \t\n] { ; /* Leerstellen, Tabs und Newline ignorieren */ } X. { fprintf(stderr, X "%s: syntax error in %s at line %d\n" X ,pname,str,yylineno); X deinit(); X exit(1); X } /* Fehler */ X%% X Xvoid lex() X{ X FILE *fp; /* Filepointer */ X X sprintf(str,"def.%s",lang); /* aufbereiten */ X if((fp=fopen(str,"r"))==(FILE *)0) /* oeffnen */ X { X fprintf(stderr,"%s: %s\n",pname,sys_errlist[errno]); X deinit(); X exit(1); X } X X yyin = fp; /* Input setzen */ X X yylex(); X X fclose(fp); /* schliessen */ X} X Xstatic void insert(pt) /* String einfuegen */ Xchar **pt; X{ X char st[100]; X char *s; X int i; X X s=st; X X strcpy(s,yytext); X while(*s != '"') X s++; X s++; X X i=0; X while(s[i] != '"') X i++; X s[i]=0; X X *pt=(char *)malloc((unsigned)(strlen(s)+1)); X strcpy(*pt,s); X} X Xstatic int getnr() /* Stringnummer holen */ X{ X char st[100]; X char *s; X int i; X X s=st; X X strcpy(s,yytext); X while(!isdigit(*s)) X s++; X X i=0; X while(isdigit(s[i])) X i++; X s[i]=0; X X return(atoi(s)); X} X SHAR_EOF $TOUCH -am 0806174890 ch/lex.l && chmod 0600 ch/lex.l || echo "restore of ch/lex.l failed" set `wc -c ch/lex.l`;Wc_c=$1 if test "$Wc_c" != "3456"; then echo original size 3456, current size $Wc_c fi # ============= ch/ch.h ============== echo "x - extracting ch/ch.h (Text)" sed 's/^X//' << 'SHAR_EOF' > ch/ch.h && X/* Headerdatei zur Verwendung von Chatter V2.9 */ X X#include "std.h" /* Standarddefinitionen */ X#include "ipc.h" /* Interprozesskommunikation */ X X#define CLEAR {putp(clear_screen);putp(cursor_home);} X X#define ESC 27 /* Escape */ X#define RET 13 /* Return */ X#define NL 10 /* Linefeed */ X#define BS 8 /* Backspace */ X#define DEL 127 /* Delete */ X#define BELL 7 /* Bell */ X#define TAB 9 /* Tabulator */ X X#define REVERSE 1 /* Eingabe invers statt Bold */ X#define JUMP 2 /* Scrollen der Eingabezeile */ X#define BEEPER 4 /* Beep bei Messages */ X#define STDMODE (BEEPER|JUMP) /* Standardmodus */ X Xextern int terminfo; /* Falls 1: Terminfo ist an */ Xextern struct termio term,oterm; /* Terminaldaten */ X Xextern char *pname; /* Programmname: argv[0] */ Xextern char *cwd; /* Working Directory */ Xextern char lang[]; /* Sprache */ Xextern char conf[]; /* Konferenzname */ Xextern char cname[]; /* Chatname */ X Xextern char *cmds; /* Kommandos */ Xextern char *prompt; /* Prompt */ Xextern char *press_key; /* Tastendruck */ Xextern char *conf_name; /* Konferenzname */ Xextern char *password; /* Passwort */ Xextern char *arr; /* Ankunft */ Xextern char *dep; /* Verlassen */ Xextern char *start; /* Startmeldung */ Xextern char *fire; /* Rauswurf */ Xextern char *help; /* Helpfile */ Xextern char *menufile; /* Menuefile */ Xextern char *invit; /* Einladung */ Xextern char *who; /* Who-Kommando */ Xextern char *msg; /* write-Kommando */ Xextern char *inv; /* invitation-Kommando */ Xextern char *nouser; /* User gibt es nicht */ Xextern char *not_online; /* User nicht online */ Xextern char *nocmd; /* Falsches Kommando */ Xextern char *nomsg; /* Messages gesperrt */ Xextern char *nomode; /* Unbekannter Modus */ Xextern char *members; /* Teilnehmer */ Xextern char *msg_from; /* Nachricht von */ X Xextern int len; /* Laenge der letzten Zeile */ Xextern char *fkey[]; /* Funktionstasten */ X Xextern int mode; /* Modus */ Xextern int superuser; /* falls 1: Super-User */ Xextern int guest; /* falls 1: Gast */ Xextern int menu; /* falls 1: Menue aufrufen */ Xextern char pw[STRLEN]; /* Passwort */ X Xextern long key; /* Key der Manager-FIFO */ Xextern int fifofd; /* Manager FIFO fd */ Xextern long pkey; /* Key der privaten FIFO */ Xextern int pfifofd; /* private FIFO fd */ X Xextern UMSG *recv_msg(); /* Message empfangen */ X Xextern int main(); /* Hauptprogramm */ Xextern int output(); /* Messageausgabe */ Xextern int conf_init(); /* Konf. Initial. */ Xextern int grep(); /* eigenes grep */ X Xextern char *read_string(); /* String einlesen */ X Xextern void lex(); /* Strings einlesen */ Xextern void interrupt(); /* Interrupt */ Xextern void init(); /* Initialisierungen */ Xextern void conf_deinit(); /* Konf. Deinitial. */ Xextern void conf_members(); /* Konferenzteilnehmer */ Xextern void deinit(); /* Deinitialisierungen */ Xextern void chat_menu(); /* Chatmenue */ Xextern void menu_key(); /* Tastendruck */ Xextern void input(); /* Eingabe */ Xextern void input_str(); /* String eingeben */ Xextern void send_msg(); /* Message senden */ Xextern void announce(); /* Anmelden */ Xextern void give_notice(); /* Abmelden */ Xextern void pub_msg(); /* oeffentl. Message */ Xextern void noprompt_msg(); /* oef. Mes. o. prompt */ Xextern void priv_msg(); /* private Message */ Xextern void chat_help(); /* Hilfestellung */ Xextern void chat_mode(); /* Parser fuer Modi */ Xextern void chat_fkey(); /* Funktionstasten */ Xextern void chat_pr_fkey(); /* F-Tasten progr. */ Xextern void change_name(); /* Namensaenderung */ Xextern void kill_user(); /* User rauswerfen */ Xextern void invite(); /* User einladen */ Xextern void message(); /* Nachricht schicken */ SHAR_EOF $TOUCH -am 0806175790 ch/ch.h && chmod 0600 ch/ch.h || echo "restore of ch/ch.h failed" set `wc -c ch/ch.h`;Wc_c=$1 if test "$Wc_c" != "3789"; then echo original size 3789, current size $Wc_c fi # ============= cm/cm.h ============== echo "x - extracting cm/cm.h (Text)" sed 's/^X//' << 'SHAR_EOF' > cm/cm.h && X/* Headerdatei zur Verwendung von ChatManager V2.9 */ X X#include "std.h" /* Standarddefinitionen */ X#include "ipc.h" /* Interprozesskommunikation */ X X#define MAXUSER 100 /* Maximale Anzahl der Teilnehmer */ X#define WAITTIME 30 /* Beendigungszeit, falls kein User */ X Xtypedef struct /* Userstructur */ X{ X int pid; /* Process ID */ X char name[STRLEN]; /* Loginname */ X char cname[STRLEN]; /* Chatname */ X long key; /* FIFO Key */ X} USER; X Xextern char *pname; /* Programmname: argv[0] */ Xextern char *cwd; /* Working Directory */ Xextern char conf[]; /* Konferenzname */ Xextern int conf_on; /* 0: Konferenz noch nicht an */ Xextern int stop; /* 1 = nach WAITTIME anhalten */ Xextern char password[STRLEN]; /* Passwort */ X Xextern long key; /* Key der Manager-FIFO */ Xextern int fifofd; /* Manager FIFO fd */ X Xextern USER userlist[]; /* Liste aller Teilnehmer */ Xextern int usernr; /* Anzahl der Users */ X Xextern MSG *recv_msg(); /* Message empfangen */ X Xextern int main(); /* Hauptprogramm */ X Xextern void interrupt(); /* Interrupt */ Xextern void init(); /* Initialisierungen */ Xextern void deinit(); /* Deinitialisierungen */ Xextern void send_msg(); /* Message senden */ Xextern void msg_int(); /* Message-Interpreter */ Xextern void write_conf(); /* Konferenz schreiben */ SHAR_EOF $TOUCH -am 0806110790 cm/cm.h && chmod 0600 cm/cm.h || echo "restore of cm/cm.h failed" set `wc -c cm/cm.h`;Wc_c=$1 if test "$Wc_c" != "1318"; then echo original size 1318, current size $Wc_c fi # ============= hdrs/ipc.h ============== if test ! -d 'hdrs'; then echo "x - creating directory hdrs" mkdir 'hdrs' fi echo "x - extracting hdrs/ipc.h (Text)" sed 's/^X//' << 'SHAR_EOF' > hdrs/ipc.h && X/* Headerdatei fuer Interprozesskommunikation */ X X#define EMPTY 0 /* leer */ X#define ARRIVAL 1 /* Anmeldung */ X#define DEPARTURE 2 /* Abmeldung */ X#define MESSAGE 3 /* Nachricht */ X#define NOPROMPT 4 /* Nachricht ohne Prompt*/ X#define CNAME 5 /* Namen aendern */ X#define QUIT 6 /* Konference beenden */ X#define KILL 7 /* Rauswerfen */ X#define NOUSER 8 /* User existiert nicht */ X X/* Headerdatei mit Messagedefinitionen */ X Xtypedef struct /* Messagestructur */ X{ X int pid; /* Process ID */ X int typ; /* Messagetyp */ X X char text[TEXTLEN]; /* Messagetext */ X} MSG; X Xtypedef struct /* Messagestructur an die User */ X{ X int typ; /* Messagetyp */ X X char text[TEXTLEN]; /* Messagetext */ X} UMSG; SHAR_EOF $TOUCH -am 0604100390 hdrs/ipc.h && chmod 0600 hdrs/ipc.h || echo "restore of hdrs/ipc.h failed" set `wc -c hdrs/ipc.h`;Wc_c=$1 if test "$Wc_c" != "745"; then echo original size 745, current size $Wc_c fi # ============= hdrs/std.h ============== echo "x - extracting hdrs/std.h (Text)" sed 's/^X//' << 'SHAR_EOF' > hdrs/std.h && X/* Headerdatei fuer Standarddefinitionen */ X X#ifndef LIBDIR /* Arbeitsdirectory */ X#define LIBDIR "." X#endif X X#ifndef BINDIR /* Arbeitsdirectory */ X#define BINDIR "." X#endif X X#define STDPASS "~'#$%&(%&?='`" /* Standardpasswort */ X X#define STRLEN 100 /* Laenge von Strings */ X#define TEXTLEN 140 /* Laenge des Messagetextes */ X#define MAXBYTES (sizeof(MSG)*8) /* Max. Anz. von Bytes in Queue */ X#define MAXTRYS 10 /* Max. Anz. von Schreibvers. */ X#define MODE 0600 /* Creation Mode */ X X#define FOREVER while(1) /* Endlosschleife */ X Xextern int errno; /* Fehlernummer */ Xextern char *sys_errlist[]; /* Fehlertexte */ X Xextern void exit(); /* Programmende */ X Xextern char getopt(); /* Option einlesen */ X Xextern char *getlogin(); /* Loginnnamen holen */ Xextern char *getcwd(); /* get current workdir. */ Xextern char *getenv(); /* get environment */ X X X SHAR_EOF $TOUCH -am 0604100490 hdrs/std.h && chmod 0600 hdrs/std.h || echo "restore of hdrs/std.h failed" set `wc -c hdrs/std.h`;Wc_c=$1 if test "$Wc_c" != "889"; then echo original size 889, current size $Wc_c fi # ============= def.german ============== echo "x - extracting def.german (Text)" sed 's/^X//' << 'SHAR_EOF' > def.german && X# ---------------------- X# Strings fuer Chat V2.9 X# (c) 1990 by M. Laukien X# ---------------------- X X# Kommandos: X# 1. Ende X# 2. Hilfe X# 3. Wer ist im System X# 4. Wer ist im Chat X# 5. clear X# 6. Blitzmeldung X# 7. Einladung X# 8. Namensaenderung X# 9. Kill X# 10. Message ohne Prompt X# 11. Mode X# 12. F-Key programmieren X# 13. F-Key abrufen Xcmds "x?wsctinkampf" X X# Unix-Kommndos Xwho "/bin/who" # who-cmd. X X# Fehlermeldungen Xnouser "*** Fehler: %s: diesen User gibt es nicht ***" Xnot_online "*** Fehler: %s ist nicht online ***" Xnomsg "*** Fehler: %s hat Mitteilungen gesperrt ***" Xnocmd "*** Fehler: Unbekanntes Kommando (:? fuer Hilfe) ***" Xnomode "*** Fehler: Unbekannter Modus ***" X X# Diverse Strings Xstart "UNIX-Chat V2.9 :? fuer Hilfe" # Startmeldung Xprompt "> " # Prompt-String Xpress_key "<Taste>" # Tastendruck Xconf_name "Konferenzname : " # Konferenzname Xpassword "Passwort : " # Passwort Xarrival "betritt die Konferenz" # Betreten Xdeparture "verlaesst die Konferenz" # Verlassen Xkill "verlaesst unfreiwillig die Konferenz" # Kill Xmembers "Konferenzteilnehmer:" # Konferenzteilnehmer Xinv "Einladung zur Konferenz" # Einladung Xmenu "menu.german" # Menuetext Xhelp "help.german" # Hilfstext Xmsg_from "Nachricht von %s" # Nachricht von SHAR_EOF $TOUCH -am 0122160391 def.german && chmod 0600 def.german || echo "restore of def.german failed" set `wc -c def.german`;Wc_c=$1 if test "$Wc_c" != "1269"; then echo original size 1269, current size $Wc_c fi # ============= def.english ============== echo "x - extracting def.english (Text)" sed 's/^X//' << 'SHAR_EOF' > def.english && X# ---------------------- X# Strings fuer Chat V2.9 X# (c) 1990 by M. Laukien X# ---------------------- X X# Kommandos: X# 1. Ende X# 2. Hilfe X# 3. Wer ist im System X# 4. Wer ist im Chat X# 5. clear X# 6. Blitzmeldung X# 7. Einladung X# 8. Namensaenderung X# 9. Kill X# 10. Message ohne Prompt X# 11. Mode X# 12. F-Key programmieren X# 13. F-Key abrufen Xcmds "x?wsctinkampf" X X# Unix-Kommndos Xwho "/bin/who" # who-cmd. X X# Fehlermeldungen Xnouser "*** error: %s: no such user ***" Xnot_online "*** error: %s is not online ***" Xnomsg "*** error: %s denies messages ***" Xnocmd "*** error: unknown command (:? for help) ***" Xnomode "*** error: unknown mode ***" X X# Diverse Strings Xstart "UNIX-Chat V2.9 :? for help" # Startmeldung Xprompt "> " # Prompt-String Xpress_key "<press any key>" # Tastendruck Xconf_name "conference name : " # Konferenzname Xpassword "password : " # Passwort Xarrival "enters the conference" # Betreten Xdeparture "leaves the conference" # Verlassen Xkill "has been killed" # Kill Xmembers "conferencemembers:" # Konferenzteilnehmer Xinv "invitation to conference" # Einladung Xmenu "menu.english" # Menuetext Xhelp "help.english" # Hilfstext Xmsg_from "message from %s" # Nachricht von SHAR_EOF $TOUCH -am 0122160391 def.english && chmod 0600 def.english || echo "restore of def.english failed" set `wc -c def.english`;Wc_c=$1 if test "$Wc_c" != "1212"; then echo original size 1212, current size $Wc_c fi # ============= help.german ============== echo "x - extracting help.german (Text)" sed 's/^X//' << 'SHAR_EOF' > help.german && X------------------------------------------------------------------------------ XUNIX-Chat V2.9 (c) 1990 by M. Laukien X------------------------------------------------------------------------------ X:? Hilfe :x Ende X:n Namen aendern :s Wer ist in der Konferenz X:w Wer ist im System :t Blitzmeldung X:i Konferenzeinladung :a Nachricht ohne Prompt X:c Bildschirm loeschen X------------------------------------------------------------------------------ X:f Funktionstastenbelegung :f0-9 Funktionstasten ausgeben X:p0-9 Funktionstasten programmieren X------------------------------------------------------------------------------ X:m Modus: jump - Eingabezeile scrollen X nojump - Eingabezeile nicht scrollen X bold - Eingabezeile hell X reverse - Eingabezeile invers X beep - Beep senden X nobeep - Beep aus X------------------------------------------------------------------------------ SHAR_EOF $TOUCH -am 0806175590 help.german && chmod 0600 help.german || echo "restore of help.german failed" set `wc -c help.german`;Wc_c=$1 if test "$Wc_c" != "885"; then echo original size 885, current size $Wc_c fi # ============= help.english ============== echo "x - extracting help.english (Text)" sed 's/^X//' << 'SHAR_EOF' > help.english && X------------------------------------------------------------------------------ XUNIX-Chat V2.9 (c) 1990 by M. Laukien X------------------------------------------------------------------------------ X:? help :x exit X:n change name :s who is in the conference X:w who is in the system :t write to user X:i invitation to conference :a message without prompt X:c clear screen X------------------------------------------------------------------------------ X:f display functionkeys :f0-9 functionkeys X:p0-9 setup functionkeys X------------------------------------------------------------------------------ X:m mode: jump - scroll input line X nojump - do not scroll input line X bold - bold input X reverse - reverse input X beep - beep on X nobeep - beep off X------------------------------------------------------------------------------ SHAR_EOF $TOUCH -am 0122160791 help.english && chmod 0600 help.english || echo "restore of help.english failed" set `wc -c help.english`;Wc_c=$1 if test "$Wc_c" != "835"; then echo original size 835, current size $Wc_c fi # ============= menu.german ============== echo "x - extracting menu.german (Text)" sed 's/^X//' << 'SHAR_EOF' > menu.german && XUNIX-Chat V2.9 (c) 1990 by M. Laukien X X[1] Systemkonferenz betreten X[2] Andere Konferenz besuchen X[3] Neue Konferenz eroeffnen X[4] Neue private Konferenz eroeffnen X[5] Konferenzen anzeigen X X[X] Ende SHAR_EOF $TOUCH -am 0122155491 menu.german && chmod 0600 menu.german || echo "restore of menu.german failed" set `wc -c menu.german`;Wc_c=$1 if test "$Wc_c" != "231"; then echo original size 231, current size $Wc_c fi # ============= menu.english ============== echo "x - extracting menu.english (Text)" sed 's/^X//' << 'SHAR_EOF' > menu.english && XUNIX-Chat V2.9 (c) 1990 by M. Laukien X X[1] Join the system conference X[2] Join other conference X[3] Start a new conference X[4] Start a new private conference X[5] Display active conferences X X[X] quit SHAR_EOF $TOUCH -am 0122155491 menu.english && chmod 0600 menu.english || echo "restore of menu.english failed" set `wc -c menu.english`;Wc_c=$1 if test "$Wc_c" != "231"; then echo original size 231, current size $Wc_c fi # ============= super.user ============== echo "x - extracting super.user (Text)" sed 's/^X//' << 'SHAR_EOF' > super.user && Xroot Xrootcsh Xsysop Xcosysop SHAR_EOF $TOUCH -am 0117133691 super.user && chmod 0600 super.user || echo "restore of super.user failed" set `wc -c super.user`;Wc_c=$1 if test "$Wc_c" != "27"; then echo original size 27, current size $Wc_c fi # ============= name.list ============== echo "x - extracting name.list (Text)" sed 's/^X//' << 'SHAR_EOF' > name.list && Xsysop Xcosysop Xroot Xrootcsh Xgast Xguest SHAR_EOF $TOUCH -am 0122161391 name.list && chmod 0600 name.list || echo "restore of name.list failed" set `wc -c name.list`;Wc_c=$1 if test "$Wc_c" != "38"; then echo original size 38, current size $Wc_c fi # ============= guest.list ============== echo "x - extracting guest.list (Text)" sed 's/^X//' << 'SHAR_EOF' > guest.list && Xguest Xgast SHAR_EOF $TOUCH -am 0806175590 guest.list && chmod 0600 guest.list || echo "restore of guest.list failed" set `wc -c guest.list`;Wc_c=$1 if test "$Wc_c" != "11"; then echo original size 11, current size $Wc_c fi # ============= README.ger ============== echo "x - extracting README.ger (Text)" sed 's/^X//' << 'SHAR_EOF' > README.ger && X ------------------------------- X Installieren von UNIX-Chat V2.9 X ------------------------------- X Xo Eintraege im Makefile ueberpruefen, und ggf. aendern, falls X z.B. andere Pfade gewuenscht sind. X Xo Mit 'make' zum Test im aktuellen Directory installieren X Xo Mit 'make install' installieren (Wichtig: Nicht von Hand X installieren, da sonst die Pfade nicht richtig gesetzt X werden). X Xo Die Systemkonferenz starten mit 'chman -n &'. X Xo Chat mit 'chat -m' aufrufen. X Xo Wichtig: Prozesse nie mit 'kill -9 <pid>' beenden, sondern nur X mit 'kill <pid>'. X Xo Fehler und Verbesserungsvorschlaege bitte an 'ml@brumuc.bru.sub.org' X senden. SHAR_EOF $TOUCH -am 0122154891 README.ger && chmod 0600 README.ger || echo "restore of README.ger failed" set `wc -c README.ger`;Wc_c=$1 if test "$Wc_c" != "633"; then echo original size 633, current size $Wc_c fi # ============= README.eng ============== echo "x - extracting README.eng (Text)" sed 's/^X//' << 'SHAR_EOF' > README.eng && X ------------------------------ X Installation of UNIX-Chat V2.9 X ------------------------------ X Xo Check the Makefile, and make the necessary changes, i.e. other X pathnames. X Xo For testing, install with 'make' in the working directory. X Xo If everything works fine, install with 'make install'. X Important: Don't copy the files by hand, because the pathnames X will not be set correctly. X Xo Start the system conference with 'chman -n &'. X Xo Start the chat with 'chat -m'. X Xo Important: Never kill processes with 'kill -9 <pid>', use always X 'kill <pid>'. X Xo Please send bugreports to 'ml@brumuc.bru.sub.org'. SHAR_EOF $TOUCH -am 0117135491 README.eng && chmod 0600 README.eng || echo "restore of README.eng failed" set `wc -c README.eng`;Wc_c=$1 if test "$Wc_c" != "610"; then echo original size 610, current size $Wc_c fi # ============= Makefile ============== echo "x - extracting Makefile (Text)" sed 's/^X//' << 'SHAR_EOF' > Makefile && X# --------------------------------------------------------------------- X# X# Name: Chat V2.9 X# X# Programmteil: Makefile X# X# Autor: Marc Laukien X# X# --------------------------------------------------------------------- X X# ----------------- Ab hier Eintragungen vornehmen -------------------- X# ----------------- Make the necessary changes -------------------- X XNAME = chat XLANG = english X XLIBDIR = /usr/local/lib/Chat XBINDIR = /usr/local/bin X XFLAGS = -O XLIB = -lcurses X#FLAGS = -O -DM_TERMINFO X#LIB = -ltinfo X XSHAR = shar -n UnixChat -o $(NAME) -L 50 -a X X# ----------------- Keine Aenderung ab hier !!! ------------------------ X# ----------------- Don't touch the rest !!! ------------------------ X XSHELL = /bin/sh X XCFLAGS = $(FLAGS) -Ihdrs -DSTDLANG=\"$(LANG)\" X XALLSRCS1 = ch/init.c ch/input.c ch/main.c ch/comm.c ch/utility.c \ X ch/output.c ch/menu.c ch/invite.c ch/grep.c X XALLSRCS2 = cm/init.c cm/int.c cm/main.c cm/comm.c X XALLSRCS = $(ALLSRCS1) $(ALLSRCS2) X XALLARCH = $(ALLSRCS) ch/lex.l \ X ch/ch.h cm/cm.h hdrs/ipc.h hdrs/std.h \ X def.german def.english help.german help.english \ X menu.german menu.english \ X super.user name.list guest.list \ X README.ger README.eng Makefile X XALLOBJ1 = ch/init.o ch/input.o ch/comm.o ch/utility.o \ X ch/output.o ch/invite.o ch/grep.o ch/lex.o X XALLOBJ2 = cm/init.o cm/int.o cm/comm.o X Xall: $(NAME) chman X X$(NAME): $(ALLOBJ1) ch/main.o ch/menu.o X -mkdir userdir X X $(CC) $(CFLAGS) -o $(NAME) $(ALLOBJ1) ch/menu.o ch/main.o \ X $(LIB) -ll X chmod 4711 $(NAME) X Xchman: $(ALLOBJ2) cm/main.o X -mkdir confdir X -mkdir fifodir X X $(CC) $(CFLAGS) -o chman $(ALLOBJ2) cm/main.o X chmod 4711 chman X Xlint.out: $(ALLSRCS1) $(ALLSRCS2) X lint $(ALLSRCS1) > lint.out X lint $(ALLSRCS2) >> lint.out X Xinstall: all cm/main2.o ch/main2.o ch/menu2.o X -mkdir $(BINDIR) X -mkdir $(LIBDIR) X chmod 700 $(LIBDIR) X -mkdir $(LIBDIR)/confdir X -mkdir $(LIBDIR)/fifodir X -mkdir $(LIBDIR)/userdir X chmod 700 $(LIBDIR)/confdir X chmod 700 $(LIBDIR)/fifodir X chmod 700 $(LIBDIR)/userdir X X $(CC) $(CFLAGS) -o $(BINDIR)/$(NAME) \ X $(ALLOBJ1) ch/main2.o ch/menu2.o $(LIB) -ll X chmod 4711 $(BINDIR)/$(NAME) X X $(CC) $(CFLAGS) -o $(BINDIR)/chman \ X $(ALLOBJ2) cm/main2.o X chmod 4711 $(BINDIR)/chman X X cp def.* $(LIBDIR) X cp help.* $(LIBDIR) X cp menu.* $(LIBDIR) X cp super.user $(LIBDIR) X cp name.list $(LIBDIR) X cp guest.list $(LIBDIR) X chmod 600 $(LIBDIR)/help.* $(LIBDIR)/def.* \ X $(LIBDIR)/menu.* \ X $(LIBDIR)/super.user $(LIBDIR)/name.list \ X $(LIBDIR)/guest.list X Xremove: X -rm -rf $(LIBDIR)/confdir X -rm -rf $(LIBDIR)/fifodir X -rm -rf $(LIBDIR)/userdir X -rm -f $(BINDIR)/$(NAME) X -rm -f $(BINDIR)/chman X -rm -f $(LIBDIR)/def.* X -rm -f $(LIBDIR)/help.* X -rm -f $(LIBDIR)/menu.* X -rm -f $(LIBDIR)/super.user X -rm -f $(LIBDIR)/name.list X -rm -f $(LIBDIR)/guest.list X Xdist: $(ALLARCH) X $(SHAR) $(ALLARCH) X Xchat.arc: $(ALLARCH) X -rm -f chat.arc X arc -a chat.arc $(ALLARCH) X Xchat.zoo: $(ALLARCH) X -rm -f chat.zoo X zoo -add chat.zoo $(ALLARCH) X Xchat.tar: $(ALLARCH) X tar cvf chat.tar $(ALLARCH) X Xchat.tar.z: chat.tar X @if test -r chat.tar.z ;\ X then \ X rm -f chat.tar.z ;\ X fi X pack chat.tar X Xchat.tar.Z: chat.tar X @if test -r chat.tar.Z ;\ X then \ X rm -f chat.tar.Z ;\ X fi X compress chat.tar X Xclean: X -rm -f ch/*.o cm/*.o X Xclobber: clean X -rm -f $(NAME) X -rm -f chman X -rm -f cm/ma2.c X -rm -f ch/ma2.c X -rm -f ch/mn2.c X -rm -f lint.out X -rm -f man.$(MANUAL) X -rm -f core X -rm -f mon.out X -rm -f lint.out X -rm -f *.bak X -rm -r -f confdir X -rm -r -f fifodir X -rm -r -f userdir X Xch/main2.c: ch/main.c X ln ch/main.c ch/main2.c X Xch/main2.o: ch/main2.c X $(CC) $(CFLAGS) -DLIBDIR=\"$(LIBDIR)\" -c ch/main2.c X mv main2.o ch X Xch/menu2.c: ch/menu.c X ln ch/menu.c ch/menu2.c X Xch/menu2.o: ch/menu2.c X $(CC) $(CFLAGS) -DBINDIR=\"$(BINDIR)\" -c ch/menu2.c X mv menu2.o ch X Xcm/main2.c: cm/main.c X ln cm/main.c cm/main2.c X Xcm/main2.o: cm/main2.c X $(CC) $(CFLAGS) -DLIBDIR=\"$(LIBDIR)\" -c cm/main2.c X mv main2.o cm X X# Build a list of .h file dependencies. Xdepend: X echo $(CC) $(CFLAGS) X @echo 'make depend is running on the following files: ' X @echo $(ALLSRCS) X @rm -f makedep eddep X @for i in $(ALLSRCS); do\ X $(CC) -E $(CFLAGS) $$i |\ X grep '^#' |\ X awk '{ print $$3 }' |\ X grep '^"' |\ X grep -v "/usr/include" |\ X sed -e 's|/[^/]*/\.\.||g' -e 's|"||g' |\ X sort -u |\ X awk "BEGIN { of = \"`basename $$i .c`\" \".o: \"; rec = of } \ X { rec = rec \" \" \$$0 } \ X END { print \"`dirname $$i`/\" rec ; \ X print \" $$(CC) $$(CFLAGS) -c $$i\" ; \ X print \" mv `basename $$i .c`.o `dirname $$i`\" }" \ X >> makedep ; \ X done X @echo '$$r makedep' >>eddep X @echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >>eddep X @echo '$$r makedep' >>eddep X @echo 'w' >>eddep X @cp Makefile Makefile.bak X @ed - Makefile < eddep X @rm -f eddep makedep X X# DO NOT DELETE THIS LINE -- make depend uses it Xch/init.o: ch/ch.h ch/init.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/init.c X mv init.o ch Xch/input.o: ch/ch.h ch/input.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/input.c X mv input.o ch Xch/main.o: ch/ch.h ch/main.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/main.c X mv main.o ch Xch/comm.o: ch/ch.h ch/comm.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/comm.c X mv comm.o ch Xch/utility.o: ch/ch.h ch/utility.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/utility.c X mv utility.o ch Xch/output.o: ch/ch.h ch/output.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/output.c X mv output.o ch Xch/menu.o: ch/ch.h ch/menu.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/menu.c X mv menu.o ch Xch/invite.o: ch/ch.h ch/invite.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/invite.c X mv invite.o ch Xch/grep.o: ch/ch.h ch/grep.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c ch/grep.c X mv grep.o ch Xcm/init.o: cm/cm.h cm/init.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c cm/init.c X mv init.o cm Xcm/int.o: cm/cm.h cm/int.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c cm/int.c X mv int.o cm Xcm/main.o: cm/cm.h cm/main.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c cm/main.c X mv main.o cm Xcm/comm.o: cm/cm.h cm/comm.c hdrs/ipc.h hdrs/std.h X $(CC) $(CFLAGS) -c cm/comm.c X mv comm.o cm SHAR_EOF $TOUCH -am 0122160891 Makefile && chmod 0600 Makefile || echo "restore of Makefile failed" set `wc -c Makefile`;Wc_c=$1 if test "$Wc_c" != "6399"; then echo original size 6399, current size $Wc_c fi rm -f shar3_seq_.tmp echo "You have unpacked the last part" exit 0 -- / | -: Marc Laukien :- | /__ | | _ _ __ / \ /_ / / | ml@brumuc.bru.sub.org | / \/ | / / / /____/ / /__/ | sigma@salyko.doit.sub.org | / | /__/ /__