home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-22 | 58.6 KB | 1,790 lines |
- Newsgroups: comp.sources.misc
- From: hm@hcshh.hcs.de (Hellmuth Michaelis)
- Subject: v39i100: cwish - Window Shell / Filemanager v1.00, Part04/04
- Message-ID: <1993Sep22.161653.26314@sparky.sterling.com>
- X-Md4-Signature: f30f0a7f18cae7ab273c202d1ad5a099
- Sender: kent@sparky.sterling.com (Kent Landfield)
- Reply-To: hm@hcshh.hcs.de
- Organization: HCS Hanseatischer Computerservice GmbH
- Date: Wed, 22 Sep 1993 16:16:53 GMT
- Approved: kent@sparky.sterling.com
-
- Submitted-by: hm@hcshh.hcs.de (Hellmuth Michaelis)
- Posting-number: Volume 39, Issue 100
- Archive-name: cwish/part04
- Environment: HP-UX, 386BSD, NETBSD, ANSI-C, SYSV-CURSES
-
- #! /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".
- # Contents: MANIFEST Makefile.386bsd Makefile.hpux complete.c config.h
- # control.h cursor.c dot-wishrc fkeys.c help.c patchlevel.h rcinit.h
- # showtime.c usage.c usrgrp.c
- # Wrapped by kent@sparky on Wed Sep 22 10:49:58 1993
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 4 (of 4)."'
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(1184 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- XFile Name Description
- X-----------------------------------------------------------
- XCOPYING GNU GENERAL PUBLIC LICENSE
- XMANIFEST This shipping list
- XMakefile.386bsd Makefile for 386BSD, NetBSD etc.
- XMakefile.hpux Makefile for HP-UX
- XREADME Intro
- Xchdir.c cd wildcard functions
- Xcommandline.c commandline window handling
- Xcomplete.c primitive filename completition
- Xconfig.c runtime configuration menu
- Xconfig.h header file for config.c
- Xcontrol.h control character defines
- Xcursor.c highlighting functions
- Xdot-wishrc sample .wishrc file
- Xfiles.c the directory scanner
- Xfkeys.c function key label handling
- Xheader.c header & attribute window misc
- Xhelp.c help screen
- Xhistory.c commandline history functions
- Xmovement.c current file movement functions
- Xpaging.c current directory linked list formatting
- Xpatchlevel.h the current patchlevel
- Xrcinit.c initialization file processing
- Xrcinit.h defines for rcinit.c
- Xshowtime.c signal handling for time display
- Xusage.c usage and copyright information
- Xusrgrp.c user and group name extraction & cacheing
- Xwish.1 the manual page
- Xwish.c program startup and main loop
- Xwish.h the global header file
- X
- END_OF_FILE
- if test 1184 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'Makefile.386bsd' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.386bsd'\"
- else
- echo shar: Extracting \"'Makefile.386bsd'\" \(4226 characters\)
- sed "s/^X//" >'Makefile.386bsd' <<'END_OF_FILE'
- X#---------------------------------------------------------------------------
- X#
- X# wish - windowing user friendly shell
- X# ------------------------------------
- X#
- X# Copyright (c) 1988-1993 Hellmuth Michaelis
- X#
- X# Eggerstedtstr. 28
- X# 22765 Hamburg
- X# Germany
- X#
- X# Tel: +49 / 40 / 384298 (private)
- X# Tel: +49 / 40 / 55903-170 (at work)
- X# e-mail: hm@hcshh.hcs.de
- X#
- X# --------oOo--------
- 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# Last edit-date: [Wed Sep 22 13:27:01 1993]
- X#
- X# Flags:
- X#
- X# CURSESBUG workaround for a bug in curses to re-enable
- X# sending of special keys after system(), commandline.c
- X#
- X#---------------------------------------------------------------------------
- X
- XCC= gcc2
- XNAME= wish
- XDEST= /usr/local/bin
- XMANDIR= /usr/local/man
- XMANBSD= cat1
- XMANHPUX= man1
- XPRINTPROG= cprps
- X
- X#-- 386BSD debugging -------------------------------------------------------
- XCFLAGS= -O2 -Wall -g -pipe -DCURSESBUG -I/usr/local/include
- XLFLAGS= -lncurses
- X
- X#-- 386BSD curses debugging ------------------------------------------------
- X#CFLAGS= -O2 -Wall -g -pipe -DCURSESBUG -I/usr/local/include
- X#LFLAGS= -ldncurses
- X
- X#-- 386BSD production ------------------------------------------------------
- X#CFLAGS= -O2 -Wall -pipe -DCURSESBUG -I/usr/local/include
- X#LFLAGS= -s -lncurses
- X
- X
- XCFILES= wish.c files.c movement.c commandline.c rcinit.c \
- X fkeys.c paging.c cursor.c header.c history.c help.c \
- X usrgrp.c showtime.c config.c chdir.c complete.c\
- X usage.c
- X
- XOFILES= wish.o files.o movement.o commandline.o rcinit.o \
- X fkeys.o paging.o cursor.o header.o history.o help.o \
- X usrgrp.o showtime.o config.o chdir.o complete.o\
- X usage.o
- X
- XHFILES= config.h control.h wish.h rcinit.h patchlevel.h
- X
- XMISCFILES= COPYING MANIFEST README \
- X Makefile.386bsd Makefile.hpux \
- X dot-wishrc
- X
- XMANFILE= wish.1
- X
- XBAKFILES= $(CFILES) $(HFILES) $(MISCFILES) $(MANFILE)
- X
- X$(NAME): $(OFILES)
- X $(CC) $(OFILES) $(LFLAGS) -o $(NAME)
- X
- Xupdate.h: Makefile $(CFILES) $(HFILES)
- X @/bin/sh -c "[ -f update.h ] || (echo 0 > update.h)"
- X @/bin/sh -c "expr `cat update.h` + 1 > update1.h && mv update1.h update.h"
- X @echo ""
- X @echo " compilation number updated to `cat update.h`"
- X @echo ""
- X
- X$(OFILES): wish.h
- Xwish.o: control.h
- Xusage.o: update.h patchlevel.h
- Xrcinit.o: rcinit.h
- Xconfig.o: config.h
- X
- Xinstall: $(NAME)
- X cp $(NAME) $(DEST)
- X strip $(DEST)/$(NAME)
- X chmod og-rw,a+x,u+rwx $(DEST)/$(NAME)
- X chown root $(DEST)/$(NAME)
- X chgrp bin $(DEST)/$(NAME)
- X @if [ -f /hp-ux ];\
- X then echo "installing HPUX man-page";make man-hpux;\
- X elif [ -f /386bsd -o /netbsd ];\
- X then echo "installing 386BSD man-page";make man-386bsd;fi
- X
- Xclean:
- X rm -f *.o wish trace core* lint.out
- X
- Xveryclean:
- X rm -f *.o wish trace core* update.h lint.out
- X
- Xman-hpux:
- X cp $(MANFILE) $(MANDIR)/$(MANHPUX)
- X
- Xman-386bsd:
- X nroff -mandoc $(MANFILE) >$(MANDIR)/$(MANBSD)/$(NAME).0
- X
- Xprint:
- X $(PRINTPROG) wish.h rcinit.h config.h $(CFILES)
- X
- Xlint:
- X lint -s -Aa -D_HPUX_SOURCE -DCURSESBUG $(CFILES) | tee lint.out
- X
- Xbackup:
- X @echo ""
- X @if [ -d BACKUP ];then rm -rf BACKUP-OLD;\
- X echo "moving BACKUP to BACKUP-OLD ...";\
- X mkdir BACKUP-OLD;\
- X mv BACKUP/* BACKUP-OLD;fi
- X @rm -rf BACKUP
- X @mkdir BACKUP
- X @echo "copying files to BACKUP ..."
- X @cp $(BAKFILES) BACKUP
- X @echo ""
- X
- X#-------------------------- E O F ---------------------------------------------
- END_OF_FILE
- if test 4226 -ne `wc -c <'Makefile.386bsd'`; then
- echo shar: \"'Makefile.386bsd'\" unpacked with wrong size!
- fi
- # end of 'Makefile.386bsd'
- fi
- if test -f 'Makefile.hpux' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'Makefile.hpux'\"
- else
- echo shar: Extracting \"'Makefile.hpux'\" \(4352 characters\)
- sed "s/^X//" >'Makefile.hpux' <<'END_OF_FILE'
- X#---------------------------------------------------------------------------
- X#
- X# wish - windowing user friendly shell
- X# ------------------------------------
- X#
- X# Copyright (c) 1988-1993 Hellmuth Michaelis
- X#
- X# Eggerstedtstr. 28
- X# 22765 Hamburg
- X# Germany
- X#
- X# Tel: +49 / 40 / 384298 (private)
- X# Tel: +49 / 40 / 55903-170 (at work)
- X# e-mail: hm@hcshh.hcs.de
- X#
- X# --------oOo--------
- 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# Last edit-date: [Mon Sep 20 17:04:45 1993]
- X#
- X# Flags:
- X#
- X# CURSESBUG workaround for a bug in curses to re-enable
- X# sending of special keys after system(), commandline.c
- X#
- X#---------------------------------------------------------------------------
- X
- XCC= cc
- XNAME= wish
- XDEST= /usr/local/bin
- XMANDIR= /usr/local/man
- XMANBSD= cat1
- XMANHPUX= man1
- XPRINTPROG= cprps
- X
- X#-- HPUX debugging (using HP's ANSI C-Compiler) -----------------------------
- X#CFLAGS= -g -z -Wc,-w1 -Aa +ESlit -D_HPUX_SOURCE -DCURSESBUG
- X#LFLAGS= -lcurses
- X
- X#-- HPUX production (using HP's ANSI C-Compiler) ----------------------------
- XCFLAGS= -O -z -Wc,-w1 -Aa +ESlit -D_HPUX_SOURCE -DCURSESBUG
- XLFLAGS= -lcurses
- X
- X#-- HPUX debugging (using GCC 2.2.2 or GCC 2.3.3) --------------------------
- X#CFLAGS= -Wall -g -D_HPUX_SOURCE -DCURSESBUG -pipe
- X#LFLAGS= -lcurses
- X
- X#-- HPUX production (using GCC 2.2.2 or GCC 2.3.3) -------------------------
- X#CFLAGS= -O2 -D_HPUX_SOURCE -DCURSESBUG -pipe
- X#LFLAGS= -lcurses
- X
- X
- XCFILES= wish.c files.c movement.c commandline.c rcinit.c \
- X fkeys.c paging.c cursor.c header.c history.c help.c \
- X usrgrp.c showtime.c config.c chdir.c complete.c\
- X usage.c
- X
- XOFILES= wish.o files.o movement.o commandline.o rcinit.o \
- X fkeys.o paging.o cursor.o header.o history.o help.o \
- X usrgrp.o showtime.o config.o chdir.o complete.o\
- X usage.o
- X
- XHFILES= config.h control.h wish.h rcinit.h patchlevel.h
- X
- XMISCFILES= COPYING MANIFEST README \
- X Makefile.386bsd Makefile.hpux \
- X dot-wishrc
- X
- XMANFILE= wish.1
- X
- XBAKFILES= $(CFILES) $(HFILES) $(MISCFILES) $(MANFILE)
- X
- X$(NAME): $(OFILES)
- X $(CC) $(OFILES) $(LFLAGS) -o $(NAME)
- X
- Xupdate.h: Makefile $(CFILES) $(HFILES)
- X @/bin/sh -c "[ -f update.h ] || (echo 0 > update.h)"
- X @/bin/sh -c "expr `cat update.h` + 1 > update1.h && mv update1.h update.h"
- X @echo ""
- X @echo " compilation number updated to `cat update.h`"
- X @echo ""
- X
- X$(OFILES): wish.h
- Xwish.o: control.h
- Xusage.o: update.h patchlevel.h
- Xrcinit.o: rcinit.h
- Xconfig.o: config.h
- X
- Xinstall: $(NAME)
- X cp $(NAME) $(DEST)
- X strip $(DEST)/$(NAME)
- X chmod og-rw,a+x,u+rwx $(DEST)/$(NAME)
- X chown root $(DEST)/$(NAME)
- X chgrp bin $(DEST)/$(NAME)
- X @if [ -f /hp-ux ];\
- X then echo "installing HPUX man-page";make man-hpux;\
- X elif [ -f /386bsd -o /netbsd ];\
- X then echo "installing 386BSD man-page";make man-386bsd;fi
- X
- Xclean:
- X rm -f *.o wish trace core* lint.out
- X
- Xveryclean:
- X rm -f *.o wish trace core* update.h lint.out
- X
- Xman-hpux:
- X cp $(MANFILE) $(MANDIR)/$(MANHPUX)
- X
- Xman-386bsd:
- X nroff -mandoc $(MANFILE) >$(MANDIR)/$(MANBSD)/$(NAME).0
- X
- Xprint:
- X $(PRINTPROG) wish.h rcinit.h config.h $(CFILES)
- X
- Xlint:
- X lint -s -Aa -D_HPUX_SOURCE -DCURSESBUG $(CFILES) | tee lint.out
- X
- Xbackup:
- X @echo ""
- X @if [ -d BACKUP ];then rm -rf BACKUP-OLD;\
- X echo "moving BACKUP to BACKUP-OLD ...";\
- X mkdir BACKUP-OLD;\
- X mv BACKUP/* BACKUP-OLD;fi
- X @rm -rf BACKUP
- X @mkdir BACKUP
- X @echo "copying files to BACKUP ..."
- X @cp $(BAKFILES) BACKUP
- X @echo ""
- X
- X#-------------------------- E O F ---------------------------------------------
- END_OF_FILE
- if test 4352 -ne `wc -c <'Makefile.hpux'`; then
- echo shar: \"'Makefile.hpux'\" unpacked with wrong size!
- fi
- # end of 'Makefile.hpux'
- fi
- if test -f 'complete.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'complete.c'\"
- else
- echo shar: Extracting \"'complete.c'\" \(4025 characters\)
- sed "s/^X//" >'complete.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * --------------------------------------
- X *
- X * (c) Copyright Hellmuth Michaelis 1989 - 1993
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * All rights are reserved except as explicitly granted
- X * by written permission of the author.
- X *
- X * See the file COPYING, distributed with wish, for
- X * restriction and warranty information
- X *
- X *---------------------------------------------------------------------------*
- X *
- X * last edit-date: [Wed Sep 22 13:27:37 1993]
- X *
- X * -hm primitive filename completition
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#include "wish.h" /* local includes */
- X
- Xstatic char *wild(char *path, char *wildname);
- X
- X/*---------------------------------------------------------------------------*
- X * complete name to first matching filename
- X *----------------------------------------------------------------------------*/
- Xvoid complete(void)
- X{
- X char *cptr; /* ptr to start of line after prompt */
- X char *cend; /* ptr to end of commandline */
- X char *p,*q; /* gp ptr */
- X char *csave; /* filename start position */
- X char path[MAXPATHLEN+1];/* path portion */
- X char name[MAXPATHLEN+1];/* name portion */
- X
- X cptr = cbuff+3; /* init start ptr */
- X cend = cptr + strlen(cptr); /* int end ptr */
- X
- X while(cend > cptr) /* end of commandline */
- X {
- X cend--;
- X if(isspace(*cend)) /* start of filename ? */
- X break;
- X }
- X if(cend <= cptr) /* hmm ... */
- X return;
- X
- X cend++; /* first char of filename */
- X csave = cend; /* save position for later compare */
- X
- X if((p = strrchr(cend, '/')) == NULL)
- X {
- X path[0] = '\0'; /* setup path part */
- X strcpy(name, cend); /* setup name part */
- X }
- X else
- X {
- X q = path; /* setup path part */
- X while(cend <= p)
- X *q++ = *cend++;
- X *q = '\0';
- X
- X q = name; /* setup name part */
- X while(*cend)
- X *q++ = *cend++;
- X *q = '\0';
- X }
- X strcat(name, "*"); /* add wildcard char */
- X
- X if((q = wild(path, name)) == NULL) /* resolve wildcards */
- X return; /* not found */
- X
- X while(*csave && *q && (*csave++ == *q++)) /* skip same chars */
- X ;
- X
- X while(*q && (cmdline(*q++) == GOOD)) /* rest to commandline */
- X ;
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * check if "wildname" matches any name in directory "path"
- X * return concatenated "path" and matched name from dir
- X * if directory found, append a '/' to resulting name
- X *----------------------------------------------------------------------------*/
- Xstatic char *wild(char *path, char *wildname)
- X{
- X register struct direct *dp; /* dir access */
- X register DIR *dirp; /* dir access */
- X struct stat fdbuffer; /* stat buffer */
- X static char wtry[MAXPATHLEN+1]; /* try buffer */
- X char rpath[MAXPATHLEN+1]; /* resulting path */
- X
- X strcpy(rpath, path); /* path -> result path */
- X strcat(rpath, "."); /* for readdir */
- X
- X if((dirp = opendir(rpath)) == NULL)
- X return(NULL); /* cannot open directory */
- X
- X for(dp = readdir(dirp); dp != NULL; dp = readdir(dirp))
- X {
- X if((!(strcmp(dp->d_name, "."))) || (!(strcmp(dp->d_name, ".."))))
- X continue;
- X
- X if(wildmat(dp->d_name, wildname) == TRUE) /* hit ? */
- X {
- X strcpy(wtry, path); /* pathname */
- X strcat(wtry, dp->d_name); /* matchname */
- X if(stat(wtry, &fdbuffer) < 0)
- X continue; /* not accessible */
- X closedir(dirp); /* close */
- X if(S_ISDIR(fdbuffer.st_mode)) /* directory ? */
- X strcat(wtry, "/"); /* yes, append / */
- X return(wtry); /* return result */
- X }
- X }
- X closedir(dirp); /* close */
- X return(NULL); /* failed */
- X}
- X
- X/*---------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 4025 -ne `wc -c <'complete.c'`; then
- echo shar: \"'complete.c'\" unpacked with wrong size!
- fi
- # end of 'complete.c'
- fi
- if test -f 'config.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'config.h'\"
- else
- echo shar: Extracting \"'config.h'\" \(4528 characters\)
- sed "s/^X//" >'config.h' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * --------------------------------------
- X *
- X * (c) Copyright Hellmuth Michaelis 1989 - 1993
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * All rights are reserved except as explicitly granted
- X * by written permission of the author.
- X *
- X * See the file COPYING, distributed with wish, for
- X * restriction and warranty information
- X *
- X *---------------------------------------------------------------------------*
- X *
- X * Last Edit-Date: [Mon Aug 30 11:36:22 1993]
- X *
- X * -hm initial creation
- X * -hm debug / streamline
- X * -hm wildcards
- X *
- X *----------------------------------------------------------------------------*/
- X
- Xstruct item {
- X int row; /* name row position */
- X int col; /* name column position */
- X char *name; /* field name */
- X int nl; /* name length */
- X int type; /* item type */
- X#define ITEM_ONOFF 0 /* YES / NO */
- X#define ITEM_STRING 1 /* a string */
- X#define ITEM_CHAR 2 /* a character */
- X#define ITEM_NOCHANGE 0x80 /* user cannot chage item at run-time */
- X int *value; /* pointer to variable [...hmmm] */
- X char *help; /* help/description string */
- X struct item *next; /* ptr to next item struct */
- X struct item *prev; /* ptr to previous item struct */
- X};
- X
- Xstruct item i_ret, i_attr, i_pres, i_fkey, i_link, i_point, i_pager, i_editor,
- X i_delim, i_wild, i_wldon, i_cdrom, i_cdnop, i_dotfn;
- X
- X#define FIRST_I (&i_ret)
- X
- X/* ----- changable ON/OFF ----- */
- X
- Xstruct item i_ret = {
- X 2, 0, " Return: ", 11, ITEM_ONOFF, (int *)&opt_return,
- X "Specify wait for RETURN/ENTER key after executing an external command",
- X &i_pres, &i_delim
- X};
- X
- Xstruct item i_pres = {
- X 2, 26, " Preserve: ", 11, ITEM_ONOFF, (int *)&opt_preserve,
- X "Preserve current directory when moving up in directory tree",
- X &i_link, &i_ret
- X};
- X
- Xstruct item i_link = {
- X 2, 52, " Links: ", 11, ITEM_ONOFF, (int *)&opt_links,
- X "Enable detection and display of links in the attribute window",
- X &i_point, &i_pres
- X};
- X
- Xstruct item i_point = {
- X 4, 0, " Dot: ", 11, ITEM_ONOFF, (int *)&opt_point,
- X "Enable to display the current directory as a dot",
- X &i_wldon, &i_link
- X};
- X
- Xstruct item i_wldon = {
- X 4, 26, "WildEnabl: ", 11, ITEM_ONOFF, (int *)&opt_wildon,
- X "Enable wildcard filename display filtering",
- X &i_delim, &i_point
- X};
- X
- Xstruct item i_delim = {
- X 4, 52, "Delimiter: ", 11, ITEM_CHAR, (int *)&opt_delimiter,
- X "Character to be used a a horizontal delimiter between windows",
- X &i_cdrom, &i_wldon
- X};
- X
- Xstruct item i_cdrom = {
- X 6, 0, " CD-Rom: ", 11, ITEM_ONOFF, (int *)&opt_cdrom,
- X "Do special filename processing for cdrom filenames containing ';'",
- X &i_cdnop, &i_delim
- X};
- X
- Xstruct item i_cdnop = {
- X 6, 26, "CDNoProgs: ", 11, ITEM_ONOFF, (int *)&opt_cdnoprog,
- X "Take all executable programs on CDROM as data files for display",
- X &i_dotfn, &i_cdrom
- X};
- X
- Xstruct item i_dotfn = {
- X 6, 52, " DotNames: ", 11, ITEM_ONOFF, (int *)&opt_dotnames,
- X "Display Filenames starting with a Dot",
- X &i_wild, &i_cdnop
- X};
- X
- X/* ----- changable STRING ----- */
- X
- Xstruct item i_wild = {
- X 8, 0, " Wildcard: ", 11, ITEM_STRING, (int *)&opt_wild[0],
- X "Wildcard string for files being displayed in the file window",
- X &i_attr, &i_dotfn
- X};
- X
- X
- X/* ----- NOT changeable ON/OFF ----- */
- X
- Xstruct item i_attr = {
- X 12, 0, " Attribs: ", 11, ITEM_ONOFF | ITEM_NOCHANGE, (int *)&opt_attrib,
- X "Display the current file's attributes and Permissions (NOT CHANGEABLE)",
- X &i_fkey, &i_wild
- X};
- X
- Xstruct item i_fkey = {
- X 12, 40, " Fkeys: ", 11, ITEM_ONOFF | ITEM_NOCHANGE, (int *)&opt_labels,
- X "Display virtual function key labels at bottom of the screen (NOT CHANGEABLE)",
- X &i_pager, &i_attr
- X};
- X
- X/*----------------------- string variables -------------------------------*/
- X
- Xstruct item i_pager = {
- X 14, 0, " Pager: ", 11, ITEM_STRING | ITEM_NOCHANGE, (int *)&opt_more[0],
- X "External command for program to display text (NOT CHANGEABLE)",
- X &i_editor, &i_fkey
- X};
- X
- Xstruct item i_editor = {
- X 16, 0, " Editor: ", 11, ITEM_STRING | ITEM_NOCHANGE, (int *)&opt_edit[0],
- X "External command for program to edit text (NOT CHANGEABLE)",
- X &i_ret, &i_pager
- X};
- X
- X/*---------------------------------- EOF ------------------------------------*/
- END_OF_FILE
- if test 4528 -ne `wc -c <'config.h'`; then
- echo shar: \"'config.h'\" unpacked with wrong size!
- fi
- # end of 'config.h'
- fi
- if test -f 'control.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'control.h'\"
- else
- echo shar: Extracting \"'control.h'\" \(1499 characters\)
- sed "s/^X//" >'control.h' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * --------------------------------------
- X *
- X * (c) Copyright Hellmuth Michaelis 1989 - 1993
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * All rights are reserved except as explicitly granted
- X * by written permission of the author.
- X *
- X * See the file COPYING, distributed with wish, for
- X * restriction and warranty information
- X *
- X *---------------------------------------------------------------------------*/
- X
- X#define CNTRL_@ 0x00
- X#define CNTRL_A 0x01
- X#define CNTRL_B 0x02
- X#define CNTRL_C 0x03
- X#define CNTRL_D 0x04
- X#define CNTRL_E 0x05
- X#define CNTRL_F 0x06
- X#define CNTRL_G 0x07
- X#define CNTRL_H 0x08
- X#define CNTRL_I 0x09
- X#define CNTRL_J 0x0A
- X#define CNTRL_K 0x0B
- X#define CNTRL_L 0x0C
- X#define CNTRL_M 0x0D
- X#define CNTRL_N 0x0E
- X#define CNTRL_O 0x0F
- X#define CNTRL_P 0x10
- X#define CNTRL_Q 0x11
- X#define CNTRL_R 0x12
- X#define CNTRL_S 0x13
- X#define CNTRL_T 0x14
- X#define CNTRL_U 0x15
- X#define CNTRL_V 0x16
- X#define CNTRL_W 0x17
- X#define CNTRL_X 0x18
- X#define CNTRL_Y 0x19
- X#define CNTRL_Z 0x1A
- X
- X
- X/*--------------------------- EOF -----------------------------*/
- END_OF_FILE
- if test 1499 -ne `wc -c <'control.h'`; then
- echo shar: \"'control.h'\" unpacked with wrong size!
- fi
- # end of 'control.h'
- fi
- if test -f 'cursor.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cursor.c'\"
- else
- echo shar: Extracting \"'cursor.c'\" \(4494 characters\)
- sed "s/^X//" >'cursor.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * --------------------------------------
- X *
- X * (c) Copyright Hellmuth Michaelis 1989 - 1993
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * All rights are reserved except as explicitly granted
- X * by written permission of the author.
- X *
- X * See the file COPYING, distributed with wish, for
- X * restriction and warranty information
- X *
- X *---------------------------------------------------------------------------*
- X *
- X * Last Edit-Date: [Fri Jul 9 15:56:23 1993]
- X *
- X * -hm conversion to multiple curses windows
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X
- X/*---------------------------------------------------------------------------*
- X * make current file name inverse, fill file attributes
- X *---------------------------------------------------------------------------*/
- Xvoid cur_inv(struct onefile *current)
- X{
- X wmove(file_w,current->orow,current->ocol);
- X
- X if(current->tag)
- X wattrset(file_w, A_UNDERLINE);
- X else
- X wattron(file_w, A_REVERSE);
- X
- X waddstr(file_w, &(current->onam[1]));
- X wattrset(file_w, A_NORMAL);
- X attribs(0);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * make current file name blink
- X *---------------------------------------------------------------------------*/
- Xvoid cur_blink(struct onefile *current)
- X{
- X wmove(file_w,current->orow,current->ocol);
- X wattrset(file_w, A_BLINK | A_REVERSE);
- X waddstr(file_w, &(current->onam[1]));
- X wattrset(file_w, A_NORMAL);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * make current filename normal again
- X *---------------------------------------------------------------------------*/
- Xvoid cur_norm(struct onefile *current)
- X{
- X wmove(file_w, current->orow, current->ocol);
- X
- X if(current->tag)
- X wattrset(file_w, A_REVERSE);
- X else
- X wattrset(file_w, A_NORMAL);
- X
- X waddstr(file_w, &(current->onam[1]));
- X wattrset(file_w, A_REVERSE);
- X
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * tag current filename and print as tagged
- X *---------------------------------------------------------------------------*/
- Xvoid tag_current(struct onefile *current)
- X{
- X wmove(file_w, current->orow, current->ocol);
- X
- X if(current->tag) /* current filename already tagged ? */
- X {
- X wattron(file_w, A_REVERSE);
- X waddstr(file_w, &(current->onam[1]));
- X wattroff(file_w, A_REVERSE);
- X current->tag = 0; /* was tagged, now untag */
- X }
- X else
- X {
- X wattron(file_w, A_UNDERLINE);
- X waddstr(file_w, &(current->onam[1]));
- X wattroff(file_w, A_UNDERLINE);
- X current->tag = 1; /* was not tagged, now tag */
- X }
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * if filename tagged, print as tagged, else print normal
- X *---------------------------------------------------------------------------*/
- Xvoid is_tagged(struct onefile *current)
- X{
- X wmove(file_w, current->orow, current->ocol);
- X
- X if(current->tag) /* current filename tagged ? */
- X {
- X wattron(file_w, A_REVERSE);
- X waddstr(file_w, &(current->onam[1]));
- X wattroff(file_w, A_REVERSE);
- X }
- X else
- X {
- X waddstr(file_w, &(current->onam[1]));
- X }
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * untag ALL tagged filenames
- X *---------------------------------------------------------------------------*/
- Xvoid untag_all(void)
- X{
- X struct onefile *cur_ptr;
- X
- X int thispage = ((cur_file->page) & PAGEMASK);
- X
- X cur_ptr = first; /* first file in dir */
- X
- X while(cur_ptr != NULL)
- X {
- X if(cur_ptr->tag)
- X {
- X if((cur_ptr->page == thispage) || (cur_ptr->page == (thispage | FIRST)))
- X {
- X wmove(file_w, cur_ptr->orow,((cur_ptr->ocol)-1));
- X wattroff(file_w,A_REVERSE);
- X waddch(file_w,SPACE);
- X wattroff(file_w,A_REVERSE);
- X waddstr(file_w,&(cur_ptr->onam[1]));
- X wattroff(file_w,A_REVERSE);
- X waddch(file_w,SPACE);
- X wattroff(file_w,A_REVERSE);
- X }
- X }
- X cur_ptr->tag = 0;
- X cur_ptr = cur_ptr->next;
- X }
- X cur_inv(cur_file); /* just for shure ... */
- X}
- X
- X/*---------------------------------- EOF -------------------------------------*/
- X
- END_OF_FILE
- if test 4494 -ne `wc -c <'cursor.c'`; then
- echo shar: \"'cursor.c'\" unpacked with wrong size!
- fi
- # end of 'cursor.c'
- fi
- if test -f 'dot-wishrc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'dot-wishrc'\"
- else
- echo shar: Extracting \"'dot-wishrc'\" \(1696 characters\)
- sed "s/^X//" >'dot-wishrc' <<'END_OF_FILE'
- X#-------------------------------------------------------------------------------
- X#
- X# .wishrc - "wish" runtime initialization file ($HOME - directory)
- X#
- X# last edit-date: [Mon Aug 30 11:47:38 1993]
- X#
- X#-------------------------------------------------------------------------------
- Xattributes=on # enable the display of file attributes in a
- X # separate window at the bottom of the screen
- X
- Xpreserve=on # when moving the directory tree up, place the
- X # current file at the directory we came from
- X
- Xfkeys=on # enable the display of function key labels in
- X # a separate window at the bootom of the screen
- X
- Xlinks=on # enable detection of links for display in the
- X # attribute window (slows reading down)
- X
- Xpoint=off # do not show "." directory in file window
- X
- Xreturn=on # wait for return on external command
- X
- Xshell=/bin/ksh # shell to be used for executing commands
- X
- Xpager=/usr/local/bin/less # pager to be used for display data
- X
- Xeditor=/usr/local/bin/emacs # editor to be used for editing data
- X
- X# delimiter=~ # delimiter to be used to delimit the windows
- X # horizontally, normally got from terminfo
- X
- Xwildenable=off # enable filename wildcard matching, directories
- X # are displayed as usual
- X
- Xwildcard=* # wildcard specification string, see also
- X # wildenable above (slows reading down if enabled)
- X
- Xcdrom=off # cdrom special filename processing enable (some
- X # systems place a ';' in the filename i.e HPUX)
- X
- Xcdnoprog=on # display all executables on cdrom in files sect
- X # (some systems tag data files as executables)
- X
- Xdotnames=on # display filenames starting with a "."
- X
- X#-------------------------------------------------------------------------------
- END_OF_FILE
- if test 1696 -ne `wc -c <'dot-wishrc'`; then
- echo shar: \"'dot-wishrc'\" unpacked with wrong size!
- fi
- # end of 'dot-wishrc'
- fi
- if test -f 'fkeys.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'fkeys.c'\"
- else
- echo shar: Extracting \"'fkeys.c'\" \(3867 characters\)
- sed "s/^X//" >'fkeys.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * --------------------------------------
- X *
- X * (c) Copyright Hellmuth Michaelis 1989 - 1993
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * All rights are reserved except as explicitly granted
- X * by written permission of the author.
- X *
- X * See the file COPYING, distributed with wish, for
- X * restriction and warranty information
- X *
- X *---------------------------------------------------------------------------*
- X *
- X * last edit-date: [Tue Aug 24 09:50:09 1993]
- X *
- X * -hm modifying function key label layout
- X * -hm consistent fkey labels ( just 8 ! )
- X * -hm flabel.c -> fkeys.c
- X * -hm hpterm support
- X * -hm interactive configuration
- X * -hm fkey label structures
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X
- X/*---------------------------------------------------------------------------*
- X * write string to function key label
- X *---------------------------------------------------------------------------*/
- Xvoid fnclabel(int n, char *string)
- X{
- X char xmit[5]; /* transmitted string ( ESC 'p'...'w' ) */
- X char result[50]; /* result buffer */
- X
- X /* check if we are on an hp-terminal or lookalike */
- X
- X if(termtype == TERM_HP || termtype == TERM_PCVT || termtype == TERM_HPX)
- X {
- X if(n < 1 || n > 8) /* and it must be a legal key number */
- X return;
- X if((strlen(string)) != 16)
- X return;
- X
- X xmit[0] = ESC;
- X xmit[1] = 'o' + n;
- X xmit[2] = '\0';
- X sprintf(result,"%c&f0a%dk16d2L%s%s",ESC,n,string,xmit);
- X write(2,result,strlen(result));
- X sprintf(result,"%c&jB",ESC); /* display user function keys */
- X write(2,result,strlen(result));
- X return;
- X }
- X else if(opt_labels) /* if virtual f-key labels .. */
- X {
- X if(n < 1 || n > 8) /* and it must be a legal key number */
- X return;
- X
- X if((strlen(string)) != 9)
- X return;
- X
- X wmove(flbl_w, 0, ((n-1)*10)); /* last line */
- X
- X wattron(flbl_w, A_REVERSE);
- X waddstr(flbl_w, string);
- X wattroff(flbl_w, A_REVERSE);
- X wrefresh(flbl_w);
- X }
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * function key labels initialization
- X *---------------------------------------------------------------------------*/
- Xvoid init_flabels(void)
- X{
- X int i;
- X for(i = 0; i < 8; i++)
- X {
- X if(termtype == TERM_HP || termtype == TERM_PCVT || termtype == TERM_HPX)
- X fnclabel(i+1, (*cur_fktab)[i].label_16);
- X else if(opt_labels)
- X fnclabel(i+1, (*cur_fktab)[i].label_8);
- X else
- X break;
- X }
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * restore function key labels
- X *---------------------------------------------------------------------------*/
- Xvoid fini_flabels(void)
- X{
- X static char modes[] = { ESC, '&', 'j', 'A', '\0'};
- X
- X /* check if we are on an hp-terminal */
- X
- X if(termtype == TERM_HP || termtype == TERM_PCVT || termtype == TERM_HPX)
- X write(2,modes,strlen(modes));
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * system function keys table
- X *---------------------------------------------------------------------------*/
- X
- Xstruct fk_tab sys_keys[] = {
- X {" Edit File ", "Edit File"},
- X {" Echo Filename", "Echo Name"},
- X {" Help Commands", "Help Cmds"},
- X {" Config Screen ", "Conf Scrn"},
- X {" Mark Filename", "Mark File"},
- X {" Unmark allmarkd", "UnmarkAll"},
- X {" ", " "},
- X {" Close CurDir ", "Close Dir"}
- X};
- X
- X/*---------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 3867 -ne `wc -c <'fkeys.c'`; then
- echo shar: \"'fkeys.c'\" unpacked with wrong size!
- fi
- # end of 'fkeys.c'
- fi
- if test -f 'help.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'help.c'\"
- else
- echo shar: Extracting \"'help.c'\" \(5040 characters\)
- sed "s/^X//" >'help.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * Last Edit-Date: [Mon Aug 30 19:50:42 1993]
- X *
- X * -hm fkey labels for help screen
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X
- X#define MAXHELPL 20
- X
- X
- X/*---------------------------------------------------------------------------*
- X * help function keys
- X *---------------------------------------------------------------------------*/
- X
- Xstatic struct fk_tab help_keys[] = {
- X {" ", " "},
- X {" ", " "},
- X {" ", " "},
- X {" ", " "},
- X {" ", " "},
- X {" ", " "},
- X {" ", " "},
- X {" ", " "}
- X};
- X
- Xstatic char *helpstr[MAXHELPL] = {
- X" ----------------------- Command Window Commands: -------------------------",
- X"",
- X" Backspace - Delete left Character Delete - Delete Cursor Character",
- X" Control-F - Character forward Control-B - Character backward",
- X" Control-A - Begin of Line Control-E - End of Line",
- X" Control-N - Next Line Control-P - Previous Line",
- X" Control-K - Kill Line from Cursor Control-Y - Yank back killed Line",
- X" Control-D - Exit back to System \"%\" is the marked files wildcard char",
- X"",
- X" ------------------------- File Window Commands: --------------------------",
- X"",
- X" Cursor up, Cursor down, Cursor right, Cursor left - Select a file",
- X" Page Up - Previous file page Page Down - Next file page",
- X" F1 - Edit current file F2 - Echo name to commandline",
- X" F3 - Display this help F4 - Enter configuration menu",
- X" F5 - Mark the current file F6 - Unmark all marked files",
- X" F7 - F8 - Close current directory",
- X"",
- X" Alternate Invocation of F1...F8 by pressing ESCAPE and then '1'...'8'",
- X" Alternate Invocation of Page up/down by pressing ESCAPE and then 'N' or 'P'",
- X};
- X
- Xchar *contin = {"Press any Key to continue ..."};
- X
- X/*---------------------------------------------------------------------------*
- X * help page
- X *---------------------------------------------------------------------------*/
- Xvoid help(void)
- X{
- X int i;
- X
- X suspend_time(); /* stop updating time */
- X
- X cur_fktab = &help_keys; /* help screen fkey label table */
- X init_flabels();
- X
- X wmove(stdscr, 0, 0); /* first line */
- X wclear(stdscr); /* clear window */
- X touchwin(stdscr);
- X wnoutrefresh(stdscr);
- X
- X move(0, 0); /* first line */
- X attron(A_REVERSE); /* highlight on */
- X addstr(headerline); /* program/copyright header */
- X attroff(A_REVERSE); /* highlight off */
- X
- X for(i = 0; i < MAXHELPL; i++)
- X mvaddstr(2+i, 0, helpstr[i]); /* print help screen */
- X
- X move(LINES-1, 0); /* last line */
- X
- X attron(A_REVERSE); /* highlight on */
- X addstr(contin);
- X attroff(A_REVERSE); /* highlight on */
- X move(LINES-1, strlen(contin)); /* last line */
- X refresh(); /* show it */
- X
- X getch(); /* get any char from user */
- X
- X wmove(stdscr, 0, 0); /* first line */
- X wclear(stdscr); /* clear window */
- X touchwin(stdscr);
- X wnoutrefresh(stdscr);
- X
- X touchwin(cmnd_w);
- X touchwin(fst_w);
- X touchwin(file_w);
- X if(opt_attrib)
- X touchwin(attr_w);
- X if(opt_labels)
- X touchwin(flbl_w);
- X
- X resume_time(); /* restart updating time */
- X
- X header(); /* new header */
- X dis_hist(); /* display current commandline */
- X fresh_files(); /* refresh files */
- X attribs(1); /* new attributes */
- X update_all(); /* update complete screen */
- X
- X cur_fktab = &sys_keys; /* system fkey label table */
- X init_flabels();
- X}
- X
- X/*----------------------- E O F -------------------------------------------*/
- END_OF_FILE
- if test 5040 -ne `wc -c <'help.c'`; then
- echo shar: \"'help.c'\" unpacked with wrong size!
- fi
- # end of 'help.c'
- fi
- if test -f 'patchlevel.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patchlevel.h'\"
- else
- echo shar: Extracting \"'patchlevel.h'\" \(1734 characters\)
- sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * Last Edit-Date: [Mon Sep 20 16:55:05 1993]
- X *
- X * -hm added patchlevel.h for submission
- X *
- X *----------------------------------------------------------------------------*/
- X
- X/* first public release to comp.sources.misc in September 1993 */
- X
- X#define PATCHLEVEL "1.00"
- X
- X/*--------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 1734 -ne `wc -c <'patchlevel.h'`; then
- echo shar: \"'patchlevel.h'\" unpacked with wrong size!
- fi
- # end of 'patchlevel.h'
- fi
- if test -f 'rcinit.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'rcinit.h'\"
- else
- echo shar: Extracting \"'rcinit.h'\" \(2259 characters\)
- sed "s/^X//" >'rcinit.h' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * Last Edit-Date: [Mon Aug 30 19:52:11 1993]
- X *
- X * -hm init file ".wishrc"
- X * -hm wildcards
- X * -hm cdrom processing for ';' chars
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#define WISHRC ".wishrc" /* our config file */
- X
- X#define RC_ON "on"
- X#define RC_OFF "off"
- X
- X/* booolean variables (on/off) */
- X
- X#define RC_ATTR "attributes"
- X#define RC_PRESERVE "preserve"
- X#define RC_FKEYS "fkeys"
- X#define RC_LINKS "links"
- X#define RC_POINT "point"
- X#define RC_RETURN "return"
- X#define RC_WILDON "wildenable"
- X#define RC_CDROM "cdrom"
- X#define RC_CDNOPROG "cdnoprog"
- X#define RC_DOTNAMES "dotnames"
- X
- X/* string variables */
- X
- X#define RC_PAGER "pager"
- X#define RC_EDITOR "editor"
- X#define RC_WILDCARD "wildcard"
- X
- X/* character variables */
- X
- X#define RC_DELIMITER "delimiter"
- X
- X/*---------------------------------- EOF ------------------------------------*/
- END_OF_FILE
- if test 2259 -ne `wc -c <'rcinit.h'`; then
- echo shar: \"'rcinit.h'\" unpacked with wrong size!
- fi
- # end of 'rcinit.h'
- fi
- if test -f 'showtime.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'showtime.c'\"
- else
- echo shar: Extracting \"'showtime.c'\" \(3438 characters\)
- sed "s/^X//" >'showtime.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * last edit-date: [Mon Aug 30 19:52:27 1993]
- X *
- X *---------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X
- Xvoid timeout_hdlr(int sig);
- Xstatic void make_time(void);
- X
- X/*---------------------------------------------------------------------------*
- X * init time display in header
- X *---------------------------------------------------------------------------*/
- Xvoid init_time(void)
- X{
- X signal(SIGALRM, &timeout_hdlr);
- X make_time();
- X alarm(30);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * print current time into header
- X *---------------------------------------------------------------------------*/
- Xstatic void make_time(void)
- X{
- X static struct tm *tmptr;
- X static time_t t;
- X static char buf[6];
- X
- X time(&t);
- X tmptr = localtime(&t);
- X sprintf(buf,"%02d:%02d", tmptr->tm_hour,tmptr->tm_min);
- X
- X strcpy(headerline+75,buf);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * the timeout handler
- X *---------------------------------------------------------------------------*/
- Xvoid timeout_hdlr(int sig)
- X{
- X static int i;
- X
- X signal(SIGALRM, SIG_IGN);
- X
- X make_time();
- X
- X if(!errorflag)
- X {
- X i = 0;
- X if(COLS > 80)
- X i = (COLS - 80)/2;
- X wmove(cmnd_w, C_HEAD, 75+i );
- X wattron(cmnd_w, A_REVERSE);
- X waddstr(cmnd_w, headerline+75);
- X wattroff(cmnd_w, A_REVERSE);
- X wmove(cmnd_w, C_LINE, curcol());
- X wrefresh(cmnd_w);
- X }
- X alarm(30);
- X signal(SIGALRM, timeout_hdlr);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * stop updating the time
- X *---------------------------------------------------------------------------*/
- Xvoid suspend_time(void)
- X{
- X signal(SIGALRM, SIG_IGN);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * restart updating the time
- X *---------------------------------------------------------------------------*/
- Xvoid resume_time(void)
- X{
- X signal(SIGALRM, &timeout_hdlr);
- X make_time();
- X}
- X
- X/*---------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 3438 -ne `wc -c <'showtime.c'`; then
- echo shar: \"'showtime.c'\" unpacked with wrong size!
- fi
- # end of 'showtime.c'
- fi
- if test -f 'usage.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'usage.c'\"
- else
- echo shar: Extracting \"'usage.c'\" \(4355 characters\)
- sed "s/^X//" >'usage.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * Last Edit-Date: [Mon Sep 20 16:52:10 1993]
- X *
- X * -hm adding compilation revision numbers
- X * -hm prototyping, updating, vt220 support
- X * -hm 386bsd intro
- X * -hm hpterm, hpux 9.0
- X * -hm interactive configuration
- X * -hm altcharset in config.c on hpux
- X * -hm preserve bug fixed in hpux
- X * -hm multiple extension support in commandline.c
- X * -hm fkey label structures
- X * -hm wildcards
- X * -hm cdrom options
- X * -hm primitive filename completition
- X * -hm option display dot-filenames
- X * -hm option processing
- X * -hm added patchlevel.h for submission
- X * -hm released to comp.sources.misc
- X *
- X *----------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X#include "patchlevel.h"
- X
- X/*---------------------------------------------------------------------------*
- X * format the headerline
- X *---------------------------------------------------------------------------*/
- Xvoid init_header(void)
- X{
- X sprintf(headerline, "Wish %s.%02d (c)Copyright 1988-1993 Hellmuth Michaelis, Hamburg [%6.6s] ",
- X PATCHLEVEL,
- X#include "update.h"
- X ,term_string);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * format & print the usage display
- X *---------------------------------------------------------------------------*/
- Xvoid usage(void)
- X{
- X fprintf(stderr,"\n Wish - WindowShell Revision %s.%02d, %s, %s\n",
- X PATCHLEVEL,
- X#include "update.h"
- X ,__DATE__,__TIME__);
- X fprintf(stderr,"Copyright (c) 1988 - 1993 by Hellmuth Michaelis, Hamburg, Germany\n\n");
- X fprintf(stderr," Wish comes with ABSOLUTELY NO WARRANTY; for details see the file\n");
- X fprintf(stderr," COPYING, which should have come with the source for this program.\n");
- X fprintf(stderr," This is free software, and you are welcome to redistribute it\n");
- X fprintf(stderr," under certain conditions; see file COPYING for details.\n\n");
- X fprintf(stderr," Usage: wish [[+ | -] [acCdflnprw]] | [-?]\n\n");
- X fprintf(stderr," Options: +/-a file attributes display window on/off\n");
- X fprintf(stderr," +/-c enable special cdrom filename processing (\";\") on/off\n");
- X fprintf(stderr," +/-C on cdrom handle programs as data files on/off\n");
- X fprintf(stderr," +/-d preserve current directory when \"cd ..\" on/off\n");
- X fprintf(stderr," +/-f display virtual fkey labels window on/off\n");
- X fprintf(stderr," +/-l file link detection enable on/off\n");
- X fprintf(stderr," +/-n display filenames beginning with a dot (\".\") on/off\n");
- X fprintf(stderr," +/-p display the current directory (as a \".\") on/off\n");
- X fprintf(stderr," +/-r wait for return after external command on/off\n");
- X fprintf(stderr," +/-w enable wildcard filename processing on/off\n");
- X fprintf(stderr," -? display this help text\n\n");
- X exit(99);
- X}
- X
- X/*---------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 4355 -ne `wc -c <'usage.c'`; then
- echo shar: \"'usage.c'\" unpacked with wrong size!
- fi
- # end of 'usage.c'
- fi
- if test -f 'usrgrp.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'usrgrp.c'\"
- else
- echo shar: Extracting \"'usrgrp.c'\" \(4639 characters\)
- sed "s/^X//" >'usrgrp.c' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------*
- X *
- X * wish - windowing user friendly shell
- X * ------------------------------------
- X *
- X * Copyright (c) 1988-1993 Hellmuth Michaelis
- X *
- X * Eggerstedtstr. 28
- X * 22765 Hamburg
- X * Germany
- X *
- X * Tel: +49 / 40 / 384298 (private)
- X * Tel: +49 / 40 / 55903-170 (at work)
- X * e-mail: hm@hcshh.hcs.de
- X *
- X * --------oOo--------
- 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 * This is based on some file i got from some Berkley distribution years ago,
- X * i really forgot which one, and i forgot the name of the file this is from,
- X * so i just copied the copyright notice from some other file:
- X *
- X * Copyright (c) 1988 The Regents of the University of California.
- X * All rights reserved.
- X *
- X * Redistribution and use in source and binary forms are permitted
- X * provided that: (1) source distributions retain this entire copyright
- X * notice and comment, and (2) distributions including binaries display
- X * the following acknowledgement: ``This product includes software
- X * developed by the University of California, Berkeley and its contributors''
- X * in the documentation or other materials provided with the distribution
- X * and in all advertising materials mentioning features or use of this
- X * software. Neither the name of the University nor the names of its
- X * contributors may be used to endorse or promote products derived
- X * from this software without specific prior written permission.
- X * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- X * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- X *
- X *---------------------------------------------------------------------------*
- X *
- X * last edit-date: [Wed Sep 22 13:28:38 1993]
- X *
- X * -hm caching uid/gid entries
- X * -hm new calling sequence
- X *
- X *---------------------------------------------------------------------------*/
- X
- X#include "wish.h"
- X
- X#ifndef min
- X#define min(x, y) (((x) < (y)) ? (x) : (y))
- X#endif
- X
- X#define NCACHE 256
- X#define MASK (NCACHE - 1)
- X#define NAMELENGTH 16
- X
- X/*---------------------------------------------------------------------------*
- X * make a user id string from the numeric user id (and cache a bit)
- X *---------------------------------------------------------------------------*/
- Xchar *user_from_uid(uid_t uid, int size)
- X{
- X static struct ncache
- X {
- X uid_t uid;
- X char name[NAMELENGTH];
- X } c_uid[NCACHE];
- X
- X static char nbuf[15];
- X register struct passwd *pw;
- X register struct ncache *cp;
- X int length = min(NAMELENGTH, size);
- X
- X cp = (c_uid + (uid & MASK));
- X
- X if (cp->uid != uid || !*cp->name)
- X {
- X if (!(pw = getpwuid(uid)))
- X {
- X sprintf(nbuf, "%-*u", length, uid);
- X return(nbuf);
- X }
- X cp->uid = uid;
- X sprintf(cp->name, "%-*s", NAMELENGTH, pw->pw_name);
- X }
- X strncpy(nbuf, cp->name, length);
- X return(nbuf);
- X}
- X
- X/*---------------------------------------------------------------------------*
- X * make a group id string from the numeric group id (and cache a bit)
- X *---------------------------------------------------------------------------*/
- Xchar *group_from_gid(gid_t gid, int size)
- X{
- X static struct ncache
- X {
- X gid_t gid;
- X char name[NAMELENGTH];
- X } c_gid[NCACHE];
- X
- X static char nbuf[15];
- X register struct group *gr;
- X register struct ncache *cp;
- X int length = min(NAMELENGTH, size);
- X
- X cp = c_gid + (gid & MASK);
- X if (cp->gid != gid || !*cp->name)
- X {
- X if (!(gr = getgrgid(gid)))
- X {
- X sprintf(nbuf, "%-*u", length, gid);
- X return(nbuf);
- X }
- X cp->gid = gid;
- X sprintf(cp->name, "%-*s", NAMELENGTH, gr->gr_name);
- X }
- X
- X strncpy(nbuf, cp->name, length);
- X return(nbuf);
- X}
- X
- X/*---------------------------------- EOF -------------------------------------*/
- END_OF_FILE
- if test 4639 -ne `wc -c <'usrgrp.c'`; then
- echo shar: \"'usrgrp.c'\" unpacked with wrong size!
- fi
- # end of 'usrgrp.c'
- fi
- echo shar: End of archive 4 \(of 4\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-