home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-14 | 50.7 KB | 1,624 lines |
- Newsgroups: comp.sources.x
- From: ferguson@cs.rochester.edu (George Ferguson)
- Subject: v20i048: xarchie - An X browser interface to Archie, v2.0.6, Part20/24
- Message-ID: <1993Jun15.223521.1743@sparky.imd.sterling.com>
- X-Md4-Signature: 40bd1b7b5e1110381ce07f51ce784b8e
- Sender: chris@sparky.imd.sterling.com (Chris Olson)
- Organization: Sterling Software
- Date: Tue, 15 Jun 1993 22:35:21 GMT
- Approved: chris@sparky.imd.sterling.com
-
- Submitted-by: ferguson@cs.rochester.edu (George Ferguson)
- Posting-number: Volume 20, Issue 48
- Archive-name: xarchie/part20
- Environment: X11
- Supersedes: xarchie: Volume 14, Issue 82-90
-
- Submitted-by: ferguson@cs.rochester.edu
- Archive-name: xarchie-2.0.6/part20
-
- #!/bin/sh
- # this is Part.20 (part 20 of xarchie-2.0.6)
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file xarchie-2.0.6/FWF/Dir/Directory.h continued
- #
- if test ! -r _shar_seq_.tmp; then
- echo 'Please unpack part 1 first!'
- exit 1
- fi
- (read Scheck
- if test "$Scheck" != 20; then
- echo Please unpack part "$Scheck" next!
- exit 1
- else
- exit 0
- fi
- ) < _shar_seq_.tmp || exit 1
- if test ! -f _shar_wnt_.tmp; then
- echo 'x - still skipping xarchie-2.0.6/FWF/Dir/Directory.h'
- else
- echo 'x - continuing file xarchie-2.0.6/FWF/Dir/Directory.h'
- sed 's/^X//' << 'SHAR_EOF' >> 'xarchie-2.0.6/FWF/Dir/Directory.h' &&
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- X
- #ifndef _DIRECTORY_H_
- #define _DIRECTORY_H_
- X
- #include <stdio.h>
- #include <sys/param.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- X
- #if defined(SYSV) || defined(SVR4)
- # ifndef __sgi
- # ifndef getwd
- # define getwd(path) getcwd(path, MAXPATHLEN)
- # endif
- # endif
- #endif
- X
- #ifndef NO_DIRENT
- #include <dirent.h>
- #else
- #include <sys/dir.h>
- #define dirent direct
- #endif
- X
- #ifndef _SYS_NAME_MAX
- #ifndef MAXNAMLEN
- ERROR, ONE OF THESE MUST BE DEFINED
- #else
- #define MAX_NAME_LENGTH MAXNAMLEN
- #endif
- #else
- #define MAX_NAME_LENGTH _SYS_NAME_MAX
- #endif
- X
- #ifndef TRUE
- #define TRUE 1
- #endif
- X
- #ifndef FALSE
- #define FALSE 0
- #endif
- X
- #define PERM_READ 4
- #define PERM_WRITE 2
- #define PERM_EXECUTE 1
- X
- #define F_TYPE_DIR 1
- #define F_TYPE_FILE 2
- #define F_TYPE_CHAR_SPECIAL 3
- #define F_TYPE_BLOCK_SPECIAL 4
- #define F_TYPE_SYM_LINK 5
- #define F_TYPE_SOCKET 6
- #define F_TYPE_FIFO 7
- X
- /*--------------------------------------------------------------------------*
- X
- X D A T A T Y P E A C C E S S M A C R O S
- X
- X *--------------------------------------------------------------------------*/
- X
- X /* Directory: Directory Iterator */
- X
- #define DirectoryDir(dp) ((dp)->filep)
- #define DirectoryPath(dp) ((dp)->path)
- X
- X /* FileInfo: Information About A File Or Link */
- X
- #define FileInfoProt(fi) ((fi)->protections)
- #define FileInfoOrigMode(fi) ((fi)->orig_mode)
- #define FileInfoUserID(fi) ((fi)->user_id)
- #define FileInfoGroupID(fi) ((fi)->group_id)
- #define FileInfoFileSize(fi) ((fi)->size)
- #define FileInfoLastAccess(fi) ((fi)->last_access)
- #define FileInfoLastModify(fi) ((fi)->last_modify)
- #define FileInfoLastStatusChange(fi) ((fi)->last_status_change)
- X
- #define FIProt(fi) FileInfoProt(fi)
- #define FIOrigMode(fi) FileInfoOrigMode(fi)
- #define FIUserID(fi) FileInfoUserID(fi)
- #define FIGroupID(fi) FileInfoGroupID(fi)
- #define FIFileSize(fi) FileInfoFileSize(fi)
- #define FILastAccess(fi) FileInfoLastAccess(fi)
- #define FILastModify(fi) FileInfoLastModify(fi)
- #define FILastStatusChange(fi) FileInfoLastStatusChange(fi)
- X
- X /* FType: File Type Macros */
- X
- #define FTypeIsDir(ft) ((ft) == F_TYPE_DIR)
- #define FTypeIsFile(ft) ((ft) == F_TYPE_FILE)
- #define FTypeIsCharSpecial(ft) ((ft) == F_TYPE_CHAR_SPECIAL)
- #define FTypeIsBlockSpecial(ft) ((ft) == F_TYPE_BLOCK_SPECIAL)
- #define FTypeIsSymLink(ft) ((ft) == F_TYPE_SYM_LINK)
- #define FTypeIsSocket(ft) ((ft) == F_TYPE_SOCKET)
- #define FTypeIsFifo(ft) ((ft) == F_TYPE_FIFO)
- X
- X /* DirEntry: Information About A Item In A Directory */
- X
- #define DirEntryFileName(fi) ((fi)->filename)
- #define DirEntryType(fi) ((fi)->file_type)
- #define DirEntrySelfInfo(fi) (&((fi)->self_info))
- #define DirEntryActualInfo(fi) (&((fi)->actual_info))
- X
- #define DirEntryIsBrokenLink(fi) ((fi)->broken_link)
- #define DirEntryIsDirectoryLink(fi) ((fi)->directory_link)
- #define DirEntryIsDir(fi) (FTypeIsDir(DirEntryType(fi)))
- #define DirEntryIsFile(fi) (FTypeIsFile(DirEntryType(fi)))
- #define DirEntryIsCharSpecial(fi) (FTypeIsCharSpecial(DirEntryType(fi)))
- #define DirEntryIsBlockSpecial(fi) (FTypeIsBlockSpecial(DirEntryType(fi)))
- #define DirEntryIsSymLink(fi) (FTypeIsSymLink(DirEntryType(fi)))
- #define DirEntryIsSocket(fi) (FTypeIsSocket(DirEntryType(fi)))
- #define DirEntryIsFifo(fi) (FTypeIsFifo(DirEntryType(fi)))
- #define DirEntryLeadsToDir(fi) (DirEntryIsDir(fi) || \
- X DirEntryIsDirectoryLink(fi))
- X
- #define DirEntryProt(d) FIProt(DirEntrySelfInfo(d))
- #define DirEntryOrigMode(d) FIOrigMode(DirEntrySelfInfo(d))
- #define DirEntryUserID(d) FIUserID(DirEntrySelfInfo(d))
- #define DirEntryGroupID(d) FIGroupID(DirEntrySelfInfo(d))
- #define DirEntryFileSize(d) FIFileSize(DirEntrySelfInfo(d))
- #define DirEntryLastAccess(d) FILastAccess(DirEntrySelfInfo(d))
- #define DirEntryLastModify(d) FILastModify(DirEntrySelfInfo(d))
- #define DirEntryLastStatusChange(d) FILastStatusChange(DirEntrySelfInfo(d))
- X
- /*--------------------------------------------------------------------------*
- X
- X D A T A T Y P E D E F I N I T I O N S
- X
- X *--------------------------------------------------------------------------*/
- X
- X /* Directory: Directory Iterator */
- X
- typedef struct
- {
- X DIR *filep;
- X char path[MAXPATHLEN + 2];
- } DIRECTORY;
- X
- typedef DIRECTORY Directory;
- X
- X /* FileInfo: Information About A File Or Link */
- X
- typedef struct
- {
- X short protections;
- X short orig_mode;
- X short user_id;
- X short group_id;
- X long size;
- X time_t last_access;
- X time_t last_modify;
- X time_t last_status_change;
- } FILE_INFO;
- X
- typedef FILE_INFO FileInfo;
- X
- X /* DirEntry: Information About A Item In A Directory */
- X
- typedef struct
- {
- X char filename[MAX_NAME_LENGTH + 1];
- X short file_type;
- X short broken_link;
- X short directory_link;
- X FileInfo self_info;
- X FileInfo actual_info;
- } DIR_ENTRY;
- X
- typedef DIR_ENTRY DirEntry;
- X
- /*--------------------------------------------------------------------------*
- X
- X L O W L E V E L D I R E C T O R Y I N T E R F A C E
- X
- X *--------------------------------------------------------------------------*/
- X
- #if (!NeedFunctionPrototypes)
- X
- int DirectoryOpen();
- void DirectoryRestart();
- void DirectoryClose();
- long DirectoryTellPosition();
- void DirectorySetPosition();
- int DirectoryReadNextEntry();
- char * DirectoryPathExpand();
- void DirEntryDump();
- X
- #else
- X
- int DirectoryOpen(char *dir_name, Directory *dp);
- void DirectoryRestart(Directory *dp);
- void DirectoryClose(Directory *dp);
- long DirectoryTellPosition(Directory *dp);
- void DirectorySetPosition(Directory *dp, long int pos);
- int DirectoryReadNextEntry(Directory *dp, DirEntry *de);
- char * DirectoryPathExpand(char *old_path, char *new_path);
- void DirEntryDump(FILE *fp, DirEntry *de);
- X
- #endif
- X
- #endif
- X
- X
- SHAR_EOF
- echo 'File xarchie-2.0.6/FWF/Dir/Directory.h is complete' &&
- chmod 0644 xarchie-2.0.6/FWF/Dir/Directory.h ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/Directory.h failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Directory.h'`"
- test 7501 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/Directory.h: original size 7501, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/DirectoryT.c ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/DirectoryT.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/DirectoryT.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/DirectoryT.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/DirectoryT.c' &&
- /*
- X * Copyright 1990,1991,1992 Brian Totty
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appears in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Brian Totty or
- X * University of Illinois not be used in advertising or publicity
- X * pertaining to distribution of the software without specific, written
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- #include <stdio.h>
- #include <Directory.h>
- X
- int main(argc,argv)
- int argc;
- char **argv;
- {
- X Directory directory;
- X DirEntry entry;
- X int status;
- X
- X if (DirectoryOpen(argv[1],&directory) == FALSE)
- X {
- X fprintf(stderr,"Can't open directory '%s'\n",argv[1]);
- X exit(-1);
- X }
- X printf("*** Listing Of Directory '%s' ***\n",
- X DirectoryPath(&directory));
- X while (DirectoryReadNextEntry(&directory,&entry))
- X {
- X printf("<Type %5d, File '%20s', Mode %3d, Size %d>\n",
- X DirEntryType(&entry),
- X DirEntryFileName(&entry),
- X DirEntryProt(&entry),
- X DirEntryFileSize(&entry));
- X }
- X printf("\nChange the directory please...sleeping 5 seconds...\n\n");
- X sleep(5);
- X DirectoryRestart(&directory);
- X while (DirectoryReadNextEntry(&directory,&entry))
- X {
- X printf("<Type %5d, File '%20s', Mode %3d, Size %d>\n",
- X DirEntryType(&entry),
- X DirEntryFileName(&entry),
- X DirEntryProt(&entry),
- X DirEntryFileSize(&entry));
- X }
- X return(1);
- }
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/DirectoryT.c ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/DirectoryT.c failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/DirectoryT.c'`"
- test 2440 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/DirectoryT.c: original size 2440, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/Imakefile ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/Imakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/Imakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/Imakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Imakefile' &&
- #
- # Imakefile for Dir
- #
- # Note that this Imakefile is just sufficient to build the Dir routines
- # for use with xarchie. The original FWF distribution contains a more
- # elaborate Imakefile for a variety of purposes. See the file ../README.
- #
- # George Ferguson, ferguson@cs.rochester.edu, 26 Nov 1992.
- #
- X
- SRCS = Directory.c DirMgr.c RegExp.c
- OBJS = Directory.o DirMgr.o RegExp.o
- X
- INCLUDES = -I.
- X
- AllTarget(first)
- NormalLibraryTarget(Dir,$(OBJS))
- X
- first:
- X @rm -f dirent.h
- X @(if [ ! -f /usr/include/dirent.h ]; \
- X then echo "Patching because no dirent.h"; \
- X echo "#ifndef _BRIDIRENT_H_" > dirent.h; \
- X echo "#define _BRIDIRENT_H_" >> dirent.h; \
- X echo "#define dirent direct" >> dirent.h; \
- X echo "#include <sys/dir.h>" >> dirent.h; \
- X echo "#endif" >> dirent.h; \
- X else echo ""; \
- X fi; exit 0)
- X @rm -f regexp.h
- X @(if [ ! -f /usr/include/regexp.h ]; \
- X then echo "Patching because no regexp.h"; \
- X echo "#ifndef _BRIREGEXP_H_" > regexp.h; \
- X echo "#define _BRIREGEXP_H_" >> regexp.h; \
- X echo "#define NO_REGEXP 1" >> regexp.h; \
- X echo "#endif" >> regexp.h; \
- X else echo ""; \
- X fi; exit 0)
- X
- DependTarget()
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/Imakefile ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/Imakefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Imakefile'`"
- test 1225 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/Imakefile: original size 1225, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/Makefile ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/Makefile' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/Makefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/Makefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Makefile' &&
- # Makefile generated by imake - do not edit!
- # $XConsortium: imake.c,v 1.65 91/07/25 17:50:17 rws Exp $
- #
- # The cpp used on this machine replaces all newlines and multiple tabs and
- # spaces in a macro expansion with a single space. Imake tries to compensate
- # for this, but is not always successful.
- #
- X
- # -------------------------------------------------------------------------
- # Makefile generated from "Imake.tmpl" and </tmp/IIf.a12656>
- # $XConsortium: Imake.tmpl,v 1.139 91/09/16 08:52:48 rws Exp $
- #
- # Platform-specific parameters may be set in the appropriate <vendor>.cf
- # configuration files. Site-specific parameters should be set in the file
- # site.def. Full rebuilds are recommended if any parameters are changed.
- #
- # If your C preprocessor does not define any unique symbols, you will need
- # to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
- # "make World" the first time).
- #
- X
- # -------------------------------------------------------------------------
- # site-specific configuration parameters that need to come before
- # the platform-specific parameters - edit site.def to change
- X
- # site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- # -------------------------------------------------------------------------
- # platform-specific configuration parameters - edit sun.cf to change
- X
- # platform: $XConsortium: sun.cf,v 1.72.1.1 92/03/18 13:13:37 rws Exp $
- X
- # operating system: SunOS 4.1.1
- X
- # $XConsortium: sunLib.rules,v 1.7 91/12/20 11:19:47 rws Exp $
- X
- # -------------------------------------------------------------------------
- # site-specific configuration parameters that go after
- # the platform-specific parameters - edit site.def to change
- X
- # site: $XConsortium: site.def,v 1.2 91/07/30 20:26:44 rws Exp $
- X
- X SHELL = /bin/sh
- X
- X TOP = ../../.
- X CURRENT_DIR = ./FWF/Dir
- X
- X AR = ar clq
- X BOOTSTRAPCFLAGS =
- X CC = cc
- X AS = as
- X
- X COMPRESS = compress
- X CPP = /lib/cpp $(STD_CPP_DEFINES)
- X PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
- X INSTALL = install
- X LD = ld
- X LINT = lint
- X LINTLIBFLAG = -C
- X LINTOPTS = -axz
- X LN = ln -s
- X MAKE = make
- X MV = mv
- X CP = cp
- X
- X RANLIB = ranlib
- X RANLIBINSTFLAGS =
- X
- X RM = rm -f
- X TROFF = psroff
- X MSMACROS = -ms
- X TBL = tbl
- X EQN = eqn
- X STD_INCLUDES =
- X STD_CPP_DEFINES =
- X STD_DEFINES =
- X EXTRA_LOAD_FLAGS =
- X EXTRA_LIBRARIES =
- X TAGS = ctags
- X
- X SHAREDCODEDEF = -DSHAREDCODE
- X SHLIBDEF = -DSUNSHLIB
- X
- X PROTO_DEFINES =
- X
- X INSTPGMFLAGS =
- X
- X INSTBINFLAGS = -m 0755
- X INSTUIDFLAGS = -m 4755
- X INSTLIBFLAGS = -m 0644
- X INSTINCFLAGS = -m 0444
- X INSTMANFLAGS = -m 0444
- X INSTDATFLAGS = -m 0444
- X INSTKMEMFLAGS = -g kmem -m 2755
- X
- X PROJECTROOT = /usr/staff
- X
- X TOP_INCLUDES = -I$(INCROOT)
- X
- X CDEBUGFLAGS = -O
- X CCOPTIONS = -pipe
- X
- X ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
- X ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
- X CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
- X LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
- X
- X LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
- X
- X LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) $(LOCAL_LDFLAGS) -L$(USRLIBDIR)
- X
- X LDCOMBINEFLAGS = -X -r
- X DEPENDFLAGS =
- X
- X MACROFILE = sun.cf
- X RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
- X
- X IMAKE_DEFINES =
- X
- X IRULESRC = $(CONFIGDIR)
- X IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
- X
- X ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/Imake.rules \
- X $(IRULESRC)/Project.tmpl $(IRULESRC)/site.def \
- X $(IRULESRC)/$(MACROFILE) $(EXTRA_ICONFIGFILES)
- X
- # -------------------------------------------------------------------------
- # X Window System Build Parameters
- # $XConsortium: Project.tmpl,v 1.138 91/09/10 09:02:12 rws Exp $
- X
- # -------------------------------------------------------------------------
- # X Window System make variables; this need to be coordinated with rules
- X
- X PATHSEP = /
- X USRLIBDIR = /usr/staff/lib
- X BINDIR = /usr/staff/bin
- X INCROOT = /usr/staff/include
- X BUILDINCROOT = $(TOP)
- X BUILDINCDIR = $(BUILDINCROOT)/X11
- X BUILDINCTOP = ..
- X INCDIR = $(INCROOT)/X11
- X ADMDIR = /usr/adm
- X LIBDIR = $(USRLIBDIR)/X11
- X CONFIGDIR = $(LIBDIR)/config
- X LINTLIBDIR = $(USRLIBDIR)/lint
- X
- X FONTDIR = $(LIBDIR)/fonts
- X XINITDIR = $(LIBDIR)/xinit
- X XDMDIR = $(LIBDIR)/xdm
- X TWMDIR = $(LIBDIR)/twm
- X MANPATH = /usr/staff/man
- X MANSOURCEPATH = $(MANPATH)/man
- X MANSUFFIX = 1
- X LIBMANSUFFIX = 3
- X MANDIR = $(MANSOURCEPATH)$(MANSUFFIX)
- X LIBMANDIR = $(MANSOURCEPATH)$(LIBMANSUFFIX)
- X NLSDIR = $(LIBDIR)/nls
- X PEXAPIDIR = $(LIBDIR)/PEX
- X XAPPLOADDIR = $(LIBDIR)/app-defaults
- X FONTCFLAGS = -t
- X
- X INSTAPPFLAGS = $(INSTDATFLAGS)
- X
- X IMAKE = imake
- X DEPEND = makedepend
- X RGB = rgb
- X
- X FONTC = bdftopcf
- X
- X MKFONTDIR = mkfontdir
- X MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
- X
- X CONFIGSRC = $(TOP)/config
- X DOCUTILSRC = $(TOP)/doc/util
- X CLIENTSRC = $(TOP)/clients
- X DEMOSRC = $(TOP)/demos
- X LIBSRC = $(TOP)/lib
- X FONTSRC = $(TOP)/fonts
- X INCLUDESRC = $(TOP)/X11
- X SERVERSRC = $(TOP)/server
- X UTILSRC = $(TOP)/util
- X SCRIPTSRC = $(UTILSRC)/scripts
- X EXAMPLESRC = $(TOP)/examples
- X CONTRIBSRC = $(TOP)/../contrib
- X DOCSRC = $(TOP)/doc
- X RGBSRC = $(TOP)/rgb
- X DEPENDSRC = $(UTILSRC)/makedepend
- X IMAKESRC = $(CONFIGSRC)
- X XAUTHSRC = $(LIBSRC)/Xau
- X XLIBSRC = $(LIBSRC)/X
- X XMUSRC = $(LIBSRC)/Xmu
- X TOOLKITSRC = $(LIBSRC)/Xt
- X AWIDGETSRC = $(LIBSRC)/Xaw
- X OLDXLIBSRC = $(LIBSRC)/oldX
- X XDMCPLIBSRC = $(LIBSRC)/Xdmcp
- X BDFTOSNFSRC = $(FONTSRC)/bdftosnf
- X BDFTOSNFSRC = $(FONTSRC)/clients/bdftosnf
- X BDFTOPCFSRC = $(FONTSRC)/clients/bdftopcf
- X MKFONTDIRSRC = $(FONTSRC)/clients/mkfontdir
- X FSLIBSRC = $(FONTSRC)/lib/fs
- X FONTSERVERSRC = $(FONTSRC)/server
- X EXTENSIONSRC = $(TOP)/extensions
- X XILIBSRC = $(EXTENSIONSRC)/lib/xinput
- X PHIGSLIBSRC = $(EXTENSIONSRC)/lib/PEX
- X
- # $XConsortium: sunLib.tmpl,v 1.14.1.1 92/03/17 14:58:46 rws Exp $
- X
- SHLIBLDFLAGS = -assert pure-text
- PICFLAGS = -pic
- X
- X DEPEXTENSIONLIB =
- X EXTENSIONLIB = -lXext
- X
- X DEPXLIB = $(DEPEXTENSIONLIB)
- X XLIB = $(EXTENSIONLIB) -lX11
- X
- X DEPXMULIB = $(USRLIBDIR)/libXmu.sa.$(SOXMUREV)
- X XMULIBONLY = -lXmu
- X XMULIB = -lXmu
- X
- X DEPOLDXLIB =
- X OLDXLIB = -loldX
- X
- X DEPXTOOLLIB = $(USRLIBDIR)/libXt.sa.$(SOXTREV)
- X XTOOLLIB = -lXt
- X
- X DEPXAWLIB = $(USRLIBDIR)/libXaw.sa.$(SOXAWREV)
- X XAWLIB = -lXaw
- X
- X DEPXILIB =
- X XILIB = -lXi
- X
- X SOXLIBREV = 4.10
- X SOXTREV = 4.10
- X SOXAWREV = 5.0
- X SOOLDXREV = 4.10
- X SOXMUREV = 4.10
- X SOXEXTREV = 4.10
- X SOXINPUTREV = 4.10
- X
- X DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
- X XAUTHLIB = -lXau
- X DEPXDMCPLIB = $(USRLIBDIR)/libXdmcp.a
- X XDMCPLIB = -lXdmcp
- X
- X DEPPHIGSLIB = $(USRLIBDIR)/libphigs.a
- X PHIGSLIB = -lphigs
- X
- X DEPXBSDLIB = $(USRLIBDIR)/libXbsd.a
- X XBSDLIB = -lXbsd
- X
- X LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
- X LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
- X LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
- X LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
- X LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
- X LINTXI = $(LINTLIBDIR)/llib-lXi.ln
- X LINTPHIGS = $(LINTLIBDIR)/llib-lphigs.ln
- X
- X DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
- X
- X DEPLIBS1 = $(DEPLIBS)
- X DEPLIBS2 = $(DEPLIBS)
- X DEPLIBS3 = $(DEPLIBS)
- X
- # -------------------------------------------------------------------------
- # Imake rules for building libraries, programs, scripts, and data files
- # rules: $XConsortium: Imake.rules,v 1.123 91/09/16 20:12:16 rws Exp $
- X
- # -------------------------------------------------------------------------
- # start of Imakefile
- X
- #
- # Imakefile for Dir
- #
- # Note that this Imakefile is just sufficient to build the Dir routines
- # for use with xarchie. The original FWF distribution contains a more
- # elaborate Imakefile for a variety of purposes. See the file ../README.
- #
- # George Ferguson, ferguson@cs.rochester.edu, 26 Nov 1992.
- #
- X
- SRCS = Directory.c DirMgr.c RegExp.c
- OBJS = Directory.o DirMgr.o RegExp.o
- X
- INCLUDES = -I.
- X
- all:: first
- X
- all:: libDir.a
- X
- libDir.a: $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $@
- X
- first:
- X @rm -f dirent.h
- X @(if [ ! -f /usr/include/dirent.h ]; \
- X then echo "Patching because no dirent.h"; \
- X echo "#ifndef _BRIDIRENT_H_" > dirent.h; \
- X echo "#define _BRIDIRENT_H_" >> dirent.h; \
- X echo "#define dirent direct" >> dirent.h; \
- X echo "#include <sys/dir.h>" >> dirent.h; \
- X echo "#endif" >> dirent.h; \
- X else echo ""; \
- X fi; exit 0)
- X @rm -f regexp.h
- X @(if [ ! -f /usr/include/regexp.h ]; \
- X then echo "Patching because no regexp.h"; \
- X echo "#ifndef _BRIREGEXP_H_" > regexp.h; \
- X echo "#define _BRIREGEXP_H_" >> regexp.h; \
- X echo "#define NO_REGEXP 1" >> regexp.h; \
- X echo "#endif" >> regexp.h; \
- X else echo ""; \
- X fi; exit 0)
- X
- depend::
- X $(DEPEND) $(DEPENDFLAGS) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
- X
- # -------------------------------------------------------------------------
- # common rules for all Makefiles - do not edit
- X
- emptyrule::
- X
- clean::
- X $(RM_CMD) "#"*
- X
- Makefile::
- X -@if [ -f Makefile ]; then set -x; \
- X $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
- X else exit 0; fi
- X $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
- X
- tags::
- X $(TAGS) -w *.[ch]
- X $(TAGS) -xw *.[ch] > TAGS
- X
- saber:
- X # load $(ALLDEFINES) $(SRCS)
- X
- osaber:
- X # load $(ALLDEFINES) $(OBJS)
- X
- # -------------------------------------------------------------------------
- # empty rules for directories that do not have SUBDIRS - do not edit
- X
- install::
- X @echo "install in $(CURRENT_DIR) done"
- X
- install.man::
- X @echo "install.man in $(CURRENT_DIR) done"
- X
- Makefiles::
- X
- includes::
- X
- # -------------------------------------------------------------------------
- # dependencies generated by makedepend
- X
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/Makefile ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/Makefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Makefile'`"
- test 10638 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/Makefile: original size 10638, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/Makefile.dst ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/Makefile.dst' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/Makefile.dst (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/Makefile.dst (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/Makefile.dst' &&
- # This Makefile is for use with FileSelector if you don't have imake/xmkmf.
- X
- RM = rm -f
- AR = ar clq
- RANLIB = ranlib
- X
- # These should be set in the master Makefile
- XXINCS = -I/usr/local/include
- CDEBUGFLAGS = -g
- X
- OBJS = Directory.o DirMgr.o RegExp.o
- INCLUDES = -I.
- CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(XINCS)
- X
- libDir.a: first $(OBJS)
- X $(RM) $@
- X $(AR) $@ $(OBJS)
- X $(RANLIB) $(@)
- X
- first:
- X @rm -f dirent.h
- X @(if [ ! -f /usr/include/dirent.h ]; \
- X then echo "Patching because no dirent.h"; \
- X echo "#ifndef _BRIDIRENT_H_" > dirent.h; \
- X echo "#define _BRIDIRENT_H_" >> dirent.h; \
- X echo "#define dirent direct" >> dirent.h; \
- X echo "#include <sys/dir.h>" >> dirent.h; \
- X echo "#endif" >> dirent.h; \
- X else echo ""; \
- X fi; exit 0)
- X @rm -f regexp.h
- X @(if [ ! -f /usr/include/regexp.h ]; \
- X then echo "Patching because no regexp.h"; \
- X echo "#ifndef _BRIREGEXP_H_" > regexp.h; \
- X echo "#define _BRIREGEXP_H_" >> regexp.h; \
- X echo "#define NO_REGEXP 1" >> regexp.h; \
- X echo "#endif" >> regexp.h; \
- X else echo ""; \
- X fi; exit 0)
- X
- clean:
- X $(RM) libDir.a $(OBJS)
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/Makefile.dst ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/Makefile.dst failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/Makefile.dst'`"
- test 1172 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/Makefile.dst: original size 1172, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/OldMakefile ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/OldMakefile' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/OldMakefile (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/OldMakefile (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/OldMakefile' &&
- FWFINCDIR = $(BASEPATH)/include
- FWFLIBDIR = $(BASEPATH)/lib
- FWFBINDIR = $(BASEPATH)/bin
- X
- CP = cp
- CC = cc
- CFLAGS = -g -I.
- MV = mv
- RM = rm
- X
- DIRH = Directory.h
- DIRSRC = Directory.c
- DIROBJ = Directory.o
- DIRTESTSRC = DirectoryTest.c
- DIRTESTOBJ = DirectoryTest.o
- DIRTEST = $(FWFBINDIR)/DirectoryTest
- REGH = RegExp.h
- REGSRC = RegExp.c
- REGOBJ = RegExp.o
- REGTESTSRC = RegExpTest.c
- REGTESTOBJ = RegExpTest.o
- REGTEST = $(FWFBINDIR)/RegExpTest
- DIRMGRH = DirectoryMgr.h
- DIRMGRSRC = DirectoryMgr.c
- DIRMGROBJ = DirectoryMgr.o
- DIRMGRTESTSRC = DirectoryMgrTest.c
- DIRMGRTESTOBJ = DirectoryMgrTest.o
- DIRMGRTEST = $(FWFBINDIR)/DirectoryMgrTest
- X
- HEADERS = $(FWFINCDIR)/$(DIRH) $(FWFINCDIR)/$(REGH) \
- X $(FWFINCDIR)/$(DIRMGRH)
- X
- OBJS = $(DIROBJ) $(REGOBJ) $(DIRMGROBJ)
- OUTLIB = $(FWFLIBDIR)/libDir.a
- X
- all:: first $(DIRTEST) $(REGTEST) $(DIRMGRTEST) $(OUTLIB)
- X
- first:
- X @rm -f dirent.h
- X @rm -f $(FWFINCDIR)/dirent.h
- X -@if [ ! -f /usr/include/dirent.h ]; \
- X then echo "Patching because no dirent.h"; \
- X echo "#ifndef _BRIDIRENT_H_" > dirent.h; \
- X echo "#define _BRIDIRENT_H_" >> dirent.h; \
- X echo "#define dirent direct" >> dirent.h; \
- X echo "#include <sys/dir.h>" >> dirent.h; \
- X echo "#endif" >> dirent.h; \
- X cp dirent.h $(FWFINCDIR)/dirent.h \
- X else echo ""; \
- X fi
- X @rm -f regexp.h
- X @rm -f $(FWFINCDIR)/regexp.h
- X -@if [ ! -f /usr/include/regexp.h ]; \
- X then echo "Patching because no regexp.h"; \
- X echo "#ifndef _BRIREGEXP_H_" > regexp.h; \
- X echo "#define _BRIREGEXP_H_" >> regexp.h; \
- X echo "#define NO_REGEXP 1" >> regexp.h; \
- X echo "#endif" >> regexp.h; \
- X cp regexp.h $(FWFINCDIR)/regexp.h \
- X else echo ""; \
- X fi
- X
- $(DIRTEST): $(DIRTESTOBJ) $(DIROBJ) $(REGOBJ) $(FWFINCDIR)/$(DIRH)
- X $(CC) $(CFLAGS) $(DIRTESTOBJ) $(DIROBJ) $(REGOBJ) $(LIBS) -o $(DIRTEST)
- X
- $(DIRTESTOBJ): $(DIRTESTSRC) $(FWFINCDIR)/$(DIRH)
- X $(CC) $(CFLAGS) -c $(DIRTESTSRC)
- X
- $(DIROBJ): $(DIRSRC) $(FWFINCDIR)/$(DIRH)
- X $(CC) $(CFLAGS) -c $(DIRSRC)
- X
- $(FWFINCDIR)/$(DIRH): $(DIRH)
- X $(CP) $(DIRH) $(FWFINCDIR)
- X
- X
- X
- X
- $(REGTEST): $(REGTESTOBJ) $(REGOBJ) $(FWFINCDIR)/$(REGH)
- X $(CC) $(CFLAGS) $(REGTESTOBJ) $(REGOBJ) -o $(REGTEST)
- X
- $(REGTESTOBJ): $(REGTESTSRC) $(FWFINCDIR)/$(REGH)
- X $(CC) $(CFLAGS) -c $(REGTESTSRC)
- X
- $(REGOBJ): $(REGSRC) $(FWFINCDIR)/$(REGH)
- X $(CC) $(CFLAGS) -c $(REGSRC)
- X
- $(FWFINCDIR)/$(REGH): $(REGH)
- X $(CP) $(REGH) $(FWFINCDIR)
- X
- X
- X
- X
- $(DIRMGRTEST): $(DIRMGRTESTOBJ) $(DIROBJ) $(REGOBJ) $(DIRMGROBJ)
- X $(CC) $(CFLAGS) $(DIRMGRTESTOBJ) $(DIRMGROBJ) $(DIROBJ) $(REGOBJ) $(LIBS) -o $(DIRMGRTEST)
- X
- $(DIRMGRTESTOBJ): $(DIRMGRTESTSRC) $(HEADERS)
- X $(CC) $(CFLAGS) -c $(DIRMGRTESTSRC)
- X
- $(DIRMGROBJ): $(DIRMGRSRC) $(HEADERS)
- X $(CC) $(CFLAGS) -c $(DIRMGRSRC)
- X
- $(FWFINCDIR)/$(DIRMGRH): $(DIRMGRH)
- X $(CP) $(DIRMGRH) $(FWFINCDIR)
- X
- X
- X
- X
- $(OUTLIB): $(OBJS)
- X ar rv $(OUTLIB) $(OBJS)
- X ranlib $(OUTLIB)
- X
- clean:
- X rm -f *.o core *~ *# regexp.h dirent.h
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/OldMakefile ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/OldMakefile failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/OldMakefile'`"
- test 3021 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/OldMakefile: original size 3021, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/RegExp.c ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/RegExp.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExp.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExp.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExp.c' &&
- /****************************************************************************
- X
- X RegExp.c
- X
- X This file contains the C code for the regular expression
- X matching code.
- X
- X The routines supported act as a more friendly, user level
- X interface to the regexp regular expression matching system.
- X
- X ****************************************************************************/
- /*
- X * Copyright 1990,1991,1992 Brian Totty
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appears in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Brian Totty or
- X * University of Illinois not be used in advertising or publicity
- X * pertaining to distribution of the software without specific, written
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- X
- #include <RegExp.h>
- #include <regexp.h>
- X
- void RegExpCompile(regexp,fsm_ptr,fsm_length)
- char *regexp,*fsm_ptr;
- int fsm_length;
- {
- #ifndef NO_REGEXP
- X compile(regexp,fsm_ptr,&(fsm_ptr[fsm_length]),'\0');
- #endif
- } /* End RegExpCompile */
- X
- X
- int RegExpMatch(string,fsm_ptr)
- char *string,*fsm_ptr;
- {
- #ifndef NO_REGEXP
- X if (advance(string,fsm_ptr) != 0)
- X return(TRUE);
- X else
- X return(FALSE);
- #else
- X return(TRUE);
- #endif
- } /* End RegExpMatch */
- X
- X
- void _RegExpError(val)
- int val;
- {
- X fprintf(stderr,"Regular Expression Error %d\n",val);
- X exit(-1);
- } /* End _RegExpError */
- X
- X
- void RegExpPatternToRegExp(pattern,reg_exp)
- char *pattern,*reg_exp;
- {
- X int in_bracket;
- X
- X in_bracket = 0;
- X while (*pattern != '\0')
- X {
- X if (in_bracket)
- X {
- X if (*pattern == ']') in_bracket = 0;
- X *reg_exp++ = *pattern++;
- X }
- X else
- X {
- X switch (*pattern)
- X {
- X case '[':
- X in_bracket = 1;
- X *reg_exp++ = '[';
- X break;
- X case '?':
- X *reg_exp++ = '.';
- X break;
- X case '*':
- X *reg_exp++ = '.';
- X *reg_exp++ = '*';
- X break;
- X case '.':
- X *reg_exp++ = '\\';
- X *reg_exp++ = '.';
- X break;
- X default:
- X *reg_exp++ = *pattern;
- X break;
- X }
- X ++ pattern;
- X }
- X }
- X *reg_exp++ = '$';
- X *reg_exp++ = '\0';
- } /* End RegExpPatternToRegExp */
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/RegExp.c ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/RegExp.c failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExp.c'`"
- test 3088 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/RegExp.c: original size 3088, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/RegExp.h ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/RegExp.h' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExp.h (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExp.h (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExp.h' &&
- /****************************************************************************
- X
- X RegExp.h
- X
- X This file contains the C definitions and declarations for
- X the regular expression matching code.
- X
- X The routines supported act as a more friendly, user level
- X interface to the regexp regular expression matching system.
- X
- X ****************************************************************************/
- /*
- X * Copyright 1990,1991,1992 Brian Totty
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appears in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Brian Totty or
- X * University of Illinois not be used in advertising or publicity
- X * pertaining to distribution of the software without specific, written
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- X
- #ifndef _RegExp_h_
- #define _RegExp_h_
- X
- #include <stdio.h>
- X
- #if (!NeedFunctionPrototypes)
- X
- void RegExpCompile();
- int RegExpMatch();
- void _RegExpError();
- void RegExpPatternToRegExp();
- X
- #else
- X
- void RegExpCompile(char *regexp, char *fsm_ptr, int fsm_length);
- int RegExpMatch(char *string, char *fsm_ptr);
- void _RegExpError(int val);
- void RegExpPatternToRegExp(char *pattern, char *reg_exp);
- X
- #endif
- X
- #ifndef TRUE
- #define TRUE 1
- #endif
- X
- #ifndef FALSE
- #define FALSE 0
- #endif
- X
- #define INIT register char *sp = instring;
- #define GETC() (*sp++)
- #define PEEKC() (*sp)
- #define UNGETC(c) -- sp
- #define RETURN(ptr) return;
- #define ERROR(val) _RegExpError(val)
- X
- #endif
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/RegExp.h ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/RegExp.h failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExp.h'`"
- test 2520 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/RegExp.h: original size 2520, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/Dir/RegExpT.c ==============
- if test -f 'xarchie-2.0.6/FWF/Dir/RegExpT.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/Dir/RegExpT.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/Dir/RegExpT.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/Dir/RegExpT.c' &&
- /*
- X * Copyright 1990,1991,1992 Brian Totty
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appears in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Brian Totty or
- X * University of Illinois not be used in advertising or publicity
- X * pertaining to distribution of the software without specific, written
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- #include <stdio.h>
- #include <RegExp.h>
- X
- int main(argc,argv)
- int argc;
- char **argv;
- {
- X char fsm[1024],regexp[1024];
- X char *string,*ret_str,*re_comp();
- X int status;
- X
- X if (argc != 3)
- X {
- X fprintf(stderr,"%s regexp string\n",argv[0]);
- X exit(1);
- X }
- X RegExpPatternToRegExp(argv[1],regexp);
- X string = argv[2];
- X RegExpCompile(regexp,fsm,1024);
- X status = RegExpMatch(string,fsm);
- X printf("Matching '%s' with pattern '%s' (regexp '%s') returns %d\n",
- X string,argv[1],regexp,status);
- X return(1);
- }
- SHAR_EOF
- chmod 0644 xarchie-2.0.6/FWF/Dir/RegExpT.c ||
- echo 'restore of xarchie-2.0.6/FWF/Dir/RegExpT.c failed'
- Wc_c="`wc -c < 'xarchie-2.0.6/FWF/Dir/RegExpT.c'`"
- test 1961 -eq "$Wc_c" ||
- echo 'xarchie-2.0.6/FWF/Dir/RegExpT.c: original size 1961, current size' "$Wc_c"
- rm -f _shar_wnt_.tmp
- fi
- # ============= xarchie-2.0.6/FWF/FileChooser/FChooser.c ==============
- if test ! -d 'xarchie-2.0.6/FWF/FileChooser'; then
- echo 'x - creating directory xarchie-2.0.6/FWF/FileChooser'
- mkdir 'xarchie-2.0.6/FWF/FileChooser'
- fi
- if test -f 'xarchie-2.0.6/FWF/FileChooser/FChooser.c' -a X"$1" != X"-c"; then
- echo 'x - skipping xarchie-2.0.6/FWF/FileChooser/FChooser.c (File already exists)'
- rm -f _shar_wnt_.tmp
- else
- > _shar_wnt_.tmp
- echo 'x - extracting xarchie-2.0.6/FWF/FileChooser/FChooser.c (Text)'
- sed 's/^X//' << 'SHAR_EOF' > 'xarchie-2.0.6/FWF/FileChooser/FChooser.c' &&
- /*
- X * FChooser.c : A widget for choosing a file
- X *
- X * George Ferguson, ferguson@cs.rochester.edu, 21 Jan 1993.
- X * Last update: 12 May 1993.
- X *
- X * This code is derived from the FileSelector widget by Brian Totty,
- X * hence the following copyright applies:
- X *
- X * Copyright 1990,1991,1992 Brian Totty
- X *
- X * Permission to use, copy, modify, distribute, and sell this software
- X * and its documentation for any purpose is hereby granted without fee,
- X * provided that the above copyright notice appears in all copies and that
- X * both that copyright notice and this permission notice appear in
- X * supporting documentation, and that the name of Brian Totty or
- X * University of Illinois not be used in advertising or publicity
- X * pertaining to distribution of the software without specific, written
- X * prior permission. Brian Totty and University of Illinois make no
- X * representations about the suitability of this software for any
- X * purpose. It is provided "as is" without express or implied warranty.
- X *
- X * Brian Totty and University of Illinois disclaim all warranties with
- X * regard to this software, including all implied warranties of
- X * merchantability and fitness, in no event shall Brian Totty or
- X * University of Illinois be liable for any special, indirect or
- X * consequential damages or any damages whatsoever resulting from loss of
- X * use, data or profits, whether in an action of contract, negligence or
- X * other tortious action, arising out of or in connection with the use or
- X * performance of this software.
- X *
- X * Author:
- X * Brian Totty
- X * Department of Computer Science
- X * University Of Illinois at Urbana-Champaign
- X * 1304 West Springfield Avenue
- X * Urbana, IL 61801
- X *
- X * totty@cs.uiuc.edu
- X *
- X */
- X
- #include <X11/Xlib.h>
- #include <X11/Xos.h>
- #include <X11/IntrinsicP.h>
- #include <X11/Intrinsic.h>
- #include <X11/StringDefs.h>
- #include <X11/cursorfont.h>
- #include <X11/CompositeP.h>
- #include <X11/Composite.h>
- #include <X11/Xaw/MenuButton.h>
- #include <X11/Xaw/SimpleMenu.h>
- #include <X11/Xaw/SmeBSB.h>
- #include <X11/Xaw/Viewport.h>
- #include <X11/Xaw/List.h>
- X
- #include <DirMgr.h>
- #include <FChooserP.h>
- #include <FChooser.h>
- X
- #if defined(SYSV) || defined(SVR4)
- # ifndef __sgi
- # ifndef getwd
- # define getwd(path) getcwd(path, MAXPATHLEN)
- # endif
- # endif
- #endif
- X
- /*---------------------------------------------------------------------------*
- X
- X I N T E R N A L R O U T I N E S
- X
- X *---------------------------------------------------------------------------*/
- X
- #if (!NeedFunctionPrototypes)
- X
- static void Initialize();
- static void Realize();
- static void Destroy();
- static void Resize();
- static Boolean SetValues();
- static XtGeometryResult GeometryManager();
- static void ChildrenCreate();
- static void ChildrenRealize();
- static void ChildrenUpdate();
- static void DirectoryCallback();
- static void FileCallback();
- static void SelectFileByIndex();
- static Boolean SelectFileByName();
- static void UnselectAll();
- static void Notify();
- static void GotoDeepestLegalDirectory();
- static void UpdateLists();
- static void Chdir();
- X
- #else
- X
- static void Initialize(Widget request, Widget new);
- static void Realize(Widget w, XtValueMask *valueMask,
- X XSetWindowAttributes *attrs);
- static void Destroy(XfwfFileChooserWidget fcw);
- static void Resize(Widget w);
- static Boolean SetValues(Widget current, Widget request, Widget new);
- static XtGeometryResult GeometryManager(Widget w,
- X XtWidgetGeometry *request,
- X XtWidgetGeometry *reply);
- static void ChildrenCreate(XfwfFileChooserWidget fcw);
- static void ChildrenRealize(XfwfFileChooserWidget fcw);
- static void ChildrenUpdate(XfwfFileChooserWidget fcw);
- static void DirectoryCallback(Widget w, XtPointer client_data,
- X XtPointer call_data);
- static void FileCallback(Widget w, XtPointer client_data,
- X XtPointer call_data);
- static void SelectFileByIndex(XfwfFileChooserWidget fcw, int index);
- static Boolean SelectFileByName(XfwfFileChooserWidget fcw, char *name);
- static void UnselectAll(XfwfFileChooserWidget fcw);
- static void Notify(XfwfFileChooserWidget fcw);
- static void GotoDeepestLegalDirectory(XfwfFileChooserWidget fcw);
- static void UpdateLists(XfwfFileChooserWidget fcw);
- static void Chdir(XfwfFileChooserWidget fcw);
- X
- #endif
- X
- /*---------------------------------------------------------------------------*
- X
- X R E S O U R C E I N I T I A L I Z A T I O N
- X
- X *---------------------------------------------------------------------------*/
- X
- #define FCFieldOffset(FIELD) XtOffset(XfwfFileChooserWidget,fileChooser.FIELD)
- #define CoreFieldOffset(FIELD) XtOffset(Widget,core.FIELD)
- X
- static XtResource resources[] = {
- X { XtNwidth, XtCWidth, XtRDimension, sizeof(Dimension),
- X CoreFieldOffset(width), XtRString, "500" },
- X { XtNheight, XtCHeight, XtRDimension, sizeof(Dimension),
- X CoreFieldOffset(height), XtRString, "250" },
- X { XtNbackground, XtCBackground, XtRPixel, sizeof(Pixel),
- X CoreFieldOffset(background_pixel), XtRString, "white" },
- X { XtNcurrentDirectory, XtCPathname, XtRString, sizeof(String),
- X FCFieldOffset(current_dir), XtRString, NULL },
- X { XtNcurrentFile, XtCFilename, XtRString, sizeof(String),
- X FCFieldOffset(current_file), XtRString, NULL },
- X { XtNcallback, XtCCallback, XtRCallback,
- X sizeof(XtCallbackList), FCFieldOffset(callbacks), XtRCallback, NULL},
- X {XtNsortMode, XtCValue, XtRInt, sizeof(int),
- X FCFieldOffset(sort_mode), XtRString, "2"},
- X {XtNpattern, XtCFile, XtRString, sizeof(String),
- X FCFieldOffset(pattern), XtRString, NULL},
- };
- X
- #undef FCFieldOffset
- #undef CoreFieldOffset
- X
- /*---------------------------------------------------------------------------*
- X
- X C L A S S A L L O C A T I O N
- X
- X *---------------------------------------------------------------------------*/
- X
- XXfwfFileChooserClassRec xfwfFileChooserClassRec = {
- X {
- X /* superclass */ (WidgetClass)&compositeClassRec,
- X /* class_name */ "XfwfFileChooser",
- X /* widget_size */ sizeof(XfwfFileChooserRec),
- X /* class_initialize */ NULL,
- X /* class_part_initialize*/ NULL,
- X /* class_inited */ FALSE,
- X /* initialize */ (XtInitProc)Initialize,
- X /* initialize_hook */ NULL,
- X /* realize */ (XtRealizeProc)Realize,
- X /* actions */ NULL,
- X /* num_actions */ 0,
- X /* resources */ resources,
- X /* resource_count */ XtNumber(resources),
- X /* xrm_class */ NULLQUARK,
- X /* compress_motion */ TRUE,
- X /* compress_exposure */ TRUE,
- X /* compress_enterleave */ TRUE,
- X /* visible_interest */ FALSE,
- X /* destroy */ (XtWidgetProc)Destroy,
- X /* resize */ (XtWidgetProc)Resize,
- X /* expose */ XtInheritExpose,
- X /* set_values */ (XtSetValuesFunc)SetValues,
- X /* set_values_hook */ NULL,
- X /* set_values_almost */ XtInheritSetValuesAlmost,
- X /* get_values_hook */ NULL,
- X /* accept_focus */ NULL,
- X /* version */ XtVersion,
- X /* callback_private */ NULL,
- X /* tm_table */ NULL,
- X /* query_geometry */ XtInheritQueryGeometry,
- X /* display_accelerator */ XtInheritDisplayAccelerator,
- X /* extension */ NULL
- X }, /* Core Part */
- X {
- X /* geometry_manager */ GeometryManager,
- X /* change_managed */ XtInheritChangeManaged,
- X /* insert_child */ XtInheritInsertChild,
- X /* delete_child */ XtInheritDeleteChild,
- X /* extension */ NULL
- X }, /* Composite Part */
- X {
- X /* no extra class data */ 0
- X } /* FileSelector Part */
- };
- X
- WidgetClass xfwfFileChooserWidgetClass =
- X (WidgetClass)&xfwfFileChooserClassRec;
- X
- /*---------------------------------------------------------------------------*
- X
- X E X P O R T E D M E T H O D S
- X
- X *---------------------------------------------------------------------------*/
- X
- X
- /*---------------------------------------------------------------------------*
- X
- X Initialize()
- X
- X This procedure is called by the X toolkit to initialize
- X the FileChooser widget instance. The hook to this routine is in the
- X initialize part of the core part of the class.
- X
- X *---------------------------------------------------------------------------*/
- X
- /* ARGSUSED */
- static void
- Initialize(request,new)
- Widget request,new;
- {
- X XfwfFileChooserWidget fcw = (XfwfFileChooserWidget)new;
- X char *str,*initial_file,path[MAXPATHLEN + 2];
- X static char *star = "*";
- X
- X FCBusyCursor(fcw) = XCreateFontCursor(XtDisplay(fcw),XC_watch);
- X FCDirMenu(fcw) = NULL;
- X FCDirMenuButton(fcw) = NULL;
- X FCFileList(fcw) = NULL;
- X FCDirMgr(fcw) = NULL;
- X FCFileNames(fcw) = NULL;
- X FCNumFileNames(fcw) = 0;
- X FCDirNames(fcw) = NULL;
- X FCNumDirNames(fcw) = 0;
- X
- X str = (char *)XtCalloc((MAXPATHLEN + 2),sizeof(char));
- X if (FCCurrentDirectory(fcw) != NULL) { /* User Specified Path */
- X strcpy(str,FCCurrentDirectory(fcw));
- X } else {
- X getwd(path);
- X strcpy(str,path);
- X }
- X FCCurrentDirectory(fcw) = str;
- X
- X str = (char *)XtCalloc((MAXPATHLEN + 2),sizeof(char));
- X initial_file = FCCurrentFile(fcw);
- X FCCurrentFile(fcw) = str;
- X
- X if (FCCorePart(request)->width <= 0)
- X FCCorePart(new)->width = 500;
- X if (FCCorePart(request)->height <= 0)
- X FCCorePart(new)->height = 200;
- X
- X if (FCPattern(fcw) == NULL)
- X FCPattern(fcw) = star;
- X FCPattern(fcw) = XtNewString(FCPattern(fcw));
- X
- X ChildrenCreate(fcw);
- X GotoDeepestLegalDirectory(fcw);
- X if (initial_file)
- X SelectFileByName(fcw,initial_file);
- } /* End Initialize */
- X
- /*---------------------------------------------------------------------------*
- X
- X Realize()
- X
- X This function is called to realize a FileChooser widget.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void Realize(w,valueMask,attrs)
- Widget w;
- XXtValueMask *valueMask;
- XXSetWindowAttributes *attrs;
- {
- X XfwfFileChooserWidget fcw = (XfwfFileChooserWidget)w;
- X
- X XtCreateWindow(w,InputOutput,(Visual *)CopyFromParent,*valueMask,attrs);
- X ChildrenRealize(fcw);
- X ChildrenUpdate(fcw);
- X Resize(w);
- X Notify(fcw);
- } /* End Realize */
- X
- /*---------------------------------------------------------------------------*
- X
- X Destroy()
- X
- X This function is called to destroy a FileChooser widget.
- X
- X *---------------------------------------------------------------------------*/
- X
- static void
- Destroy(fcw)
- SHAR_EOF
- true || echo 'restore of xarchie-2.0.6/FWF/FileChooser/FChooser.c failed'
- fi
- echo 'End of xarchie-2.0.6 part 20'
- echo 'File xarchie-2.0.6/FWF/FileChooser/FChooser.c is continued in part 21'
- echo 21 > _shar_seq_.tmp
- exit 0
-
- exit 0 # Just in case...
- --
- // chris@IMD.Sterling.COM | Send comp.sources.x submissions to:
- \X/ Amiga - The only way to fly! | sources-x@imd.sterling.com
- "It's intuitively obvious to the |
- most casual observer..." | GCS d+/-- p+ c++ l+ m+ s++/+ g+ w+ t+ r+ x+
-