maks0.2/0040755000175200017560000000000007306140037012475 5ustar stephensstephengmaks0.2/src/0040755000175200017560000000000007306140035013262 5ustar stephensstephengmaks0.2/src/maks/0040755000175200017560000000000007306140035014215 5ustar stephensstephengmaks0.2/src/maks/CVS/0040755000175200017560000000000007262562005014656 5ustar stephensstephengmaks0.2/src/maks/CVS/Root0100644000175200017560000000003407236675452015532 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/maks/CVS/Repository0100644000175200017560000000002207236675452016763 0ustar stephensstephenghome/ion/src/maks maks0.2/src/maks/CVS/Entries0100644000175200017560000000056207262562005016212 0ustar stephensstepheng/fixpound.pl/1.2/Fri Feb 19 09:26:01 1999// /tool.mak/1.7/Tue Mar 21 08:21:48 2000// /tools.mak/1.5/Thu Sep 9 04:59:21 1999// D/bin//// D/opengl//// D/os//// D/win32//// /PKG/1.2/Tue Apr 3 18:51:56 2001// /lib.mak/1.6/Tue Apr 3 18:51:56 2001// /pre.mak/1.10/Tue Apr 3 18:51:56 2001// /use.mak/1.4/Tue Apr 3 18:51:56 2001// /basic.mak/1.9/Wed Apr 4 09:09:10 2001// maks0.2/src/maks/PKG0100744000175200017560000000031607262415714014571 0ustar stephensstephengNAME=maks VERSION=0.2 DESC="A Makefile library. Handles automatic header file dependencies and interpackage dependencies." CATEGORY="Development Tools" REQUIRES_PKGS="../bin" REQUIRES_OTHERS="gnumake sh" maks0.2/src/maks/basic.mak0100744000175200017560000001046707262562266016015 0ustar stephensstepheng# $Id: basic.mak,v 1.9 2001/04/04 09:09:10 stephens Exp $ Makefile=Makefile Makefile.use=Makefile.use ########################################################################## # Suffix translation rules # SWIG SWIG.swig=swig $(SWIG_C_FILES_GEN) : $(GEN_FILE_DIR)/$(notdir %)_swig$(c) : %$(swig) $(foreach w,$(SWIG_WRAPPER),$(SWIG.swig) -$w $(SWIG_WRAPPER_$w) -o $(GEN_FILE_DIR)/$(notdir $*)_swig_$(w)$(c) $<;) touch $(GEN_FILE_DIR)/$(notdir $*)_swig$(c) # C %$(c):%$(o) $(C_O_FILES_GEN) : $(O_FILE_DIR)/$(notdir %)$(o) : %$(c) $(COMPILE.c) $< -o $(O_FILE_DIR)/$(notdir $*)$(o) $(C_GEN_O_FILES_GEN) : $(O_FILE_DIR)/%$(o) : $(GEN_FILE_DIR)/%$(c) $(COMPILE.c) $< -o $(O_FILE_DIR)/$*$(o) # C++ %$(cc):%$(o) $(CC_O_FILES_GEN) : $(O_FILE_DIR)/$(notdir %)$(o) : %$(cc) $(COMPILE.cc) $< -o $(O_FILE_DIR)/$(notdir $*)$(o) # yacc %$(y):%$(o) %$(y):%$(c) ifeq "$(strip $(MACHTYPE))" "i586-pc-cygwin32" YACC+= -S '$(CYGFS)/share/bison.simple' else YACC=bison --yacc endif $(Y_C_FILES_GEN) : $(GEN_FILE_DIR)/$(notdir %)$(c) : %.y $(CP) $*$(y) $(GEN_FILE_DIR)/$(notdir $*)$(y) cd $(GEN_FILE_DIR) && $(YACC) -d $(notdir $*)$(y) $(MV) $(GEN_FILE_DIR)/y.tab.c $(GEN_FILE_DIR)/$(notdir $*)$(c) $(MV) $(GEN_FILE_DIR)/y.tab.h $(GEN_FILE_DIR)/$(notdir $*).yh # Java ifneq "$(strip $(JAVA_FILES_ALL))" "" ifeq "$(strip $(JAVA_TIMESTAMP))" "" JAVA_TIMESTAMP=$(JAVA_CLASS_FILE_DIR)/../.jc endif $(JAVA_TIMESTAMP) : $(JAVA_FILES_ALL) '$(JAVAC)' $(JAVACFLAGS) -d $(JAVA_CLASS_FILE_DIR) $(JAVA_FILES_ALL) $(TOUCH) $@ PRODUCTS+=$(JAVA_TIMESTAMP) GARBAGE_DIRS+=$(JAVA_CLASS_FILE_DIR) endif #DIRS += $(GEN_FILE_DIR) ########################################################################## EARLY_TARGETS+= USE_ALL DIRS $(Y_C_FILES_GEN) DEPS ########################################################################## all : $(EARLY_TARGETS) $(PRODUCTS) $(TARGETS) @$(MSG) Made $@ ########################################################################## # Autodependencies # Header deps #$(O_FILES_GEN) : $(H_FILES) DEP_FILE_DIR:=$(O_FILE_DIR) make_dep = $(ECHO) "Making include deps for $<"; $(SHELL) -ec 'o="$(notdir $*)$(o)"; od="$(O_FILE_DIR)/$$o"; d="$(DEP_FILE_DIR)/$(notdir $*).d"; $(CC) -MM $(CPPFLAGS) $< | sed -e "s@$$o[ ]*:@$$od : $(Makefile) $(Makefile.use) @g" > $$d; [ -s $$d ] || rm -f $$d' C_D_FILES += $(_C_FILES_ALL:%.c=$(DEP_FILE_DIR)/$(notdir %).d) $(C_D_FILES) : $(DEP_FILE_DIR)/$(notdir %).d : %.c $(make_dep) CC_D_FILES += $(_CC_FILES_ALL:%.cc=$(DEP_FILE_DIR)/$(notdir %).d) $(CC_D_FILES) : $(DEP_FILE_DIR)/$(notdir %).d : %.cc @$(make_dep) DEPS+= $(C_D_FILES) $(CC_D_FILES) # Disable deps DEPS:= DEPS : DIRS $(DEPS) .PHONY : DEPS GARBAGE+= $(DEPS) GENERATED_DIRS+= $(DEP_FILE_DIR) GARBAGE_DIRS+= $(DEP_FILE_DIR) ifeq "$(strip $(__DISABLE_DEPS__))" "" EARLY_TARGETS+= DEPS ifneq "$(strip $(DEPS))" "" $(DEPS) : $(DEP_FILE_DIR) -include $(DEPS) endif endif ########################################################################## # Use USE_ALL : @for f in $(USE_ALL) . ; \ do \ [ "$$f" = . ] && break; \ $(ECHO) "Using '$$f'" ;\ $(MAKE) -C "$$f" > /dev/null ; \ done .PHONY : USE_ALL ########################################################################## # Directories DIRS+= $(GENERATED_DIRS) $(OUTPUT_DIRS) DIRS:=$(sort $(DIRS)) $(DIRS) : $(MKDIRS) $@ DIRS : $(DIRS) .PHONY : DIRS ########################################################################## # Clean GARBAGE += $(O_FILES_GEN) GARBAGE += $(C_FILES_GEN) GARBAGE += $(PRODUCTS) GARBAGE += core *.core #GARBAGE += *.o clean : rm -f $(filter-out .,$(sort $(GARBAGE))) rm -rf $(filer-out .,$(sort $(GARBAGE_DIRS))) @$(MSG) Made $@ cleanproducts : rm -f $(PRODUCTS) veryclean : clean rm -rf $(filter-out .,$(sort $(GENERATED_DIRS) $(GARBAGE_VERY_DIRS))) @$(MSG) Made $@ archiveclean : veryclean @$(MSG) Made $@ .PHONY : clean veryclean archiveclean cleanproducts ########################################################################## # Archive archive : tgz tgz : archiveclean pwd=`pwd`;dname=`basename $$pwd`;cd ..; $(TAR) -cvf - "$$dname" | $(GZIP) > "$$dname.tgz" .PHONY : archive tgz ######################################################################### # Variable make ifdef vm _vm : $(foreach f,$(vm), $($(f))) @$(MSG) Made $(vm): $< .PHONY : _vm endif ########################################################################## # EOF maks0.2/src/maks/fixpound.pl0100644000175200017560000000025406663227051016415 0ustar stephensstepheng# $Id: fixpound.pl,v 1.2 1999/02/19 09:26:01 stephensk Exp $ while ( <> ) { chop; if ( /^#/ ) { print "/* ", $_, "*/\n"; } else { print $_, "\n"; } } maks0.2/src/maks/lib.mak0100744000175200017560000000430607262415714015470 0ustar stephensstepheng# $Id: lib.mak,v 1.6 2001/04/03 18:42:08 stephens Exp $ # # Usage: # # LIB_NAME:= # include $(MAKS)/lib.mak # # Adds targets to create a library named LIB_NAME from LIB_O_FILES. # LIB_O_FILES defaults to O_FILES. # ############################################################## # Defaults LIB_PREFIX:=lib# LIB_SUFFIX:=.a# LIB:=$(LIB_DIR)/$(LIB_PREFIX)$(LIB_NAME)$(LIB_SUFFIX)# ifeq "$(strip $(LIB_O_FILES))" "" LIB_O_FILES:=$(O_FILES)# endif ifeq "$(strip $(LIB_LIB_FLAGS))" "" LIB_LIB_FLAGS:=$(LIB_FLAGS) endif ifeq "$(strip $(LIB_LIBS))" "" LIB_LIBS:=$(LIBS) endif ############################################################## # Target ifneq "$(strip $(LIB_DYNAMIC))" "" LIB_DLL_SUFFIX=.dll# LIB_DLL:=$(LIB_DIR)/$(LIB_NAME)$(LIB_DLL_SUFFIX)# LIB_DLL_DEF:=$(LIB_DIR)/$(LIB_NAME).def# ifneq "$(strip $(SWIG2DEF))" "" LIB_SWIG2DEF:=perl $(MAKS)/../bin/swig2def.pl $(SWIG2DEF) > $(LIB_DLL_DEF)# LIB_DEF:=--def $(LIB_DLL_DEF)# else LIB_SWIG2DEF:=true# LIB_DEF:=--output-def $(LIB_DLL_DEF)# endif $(LIB_DLL) $(LIB) : $(LIB_O_FILES) $(LIB_SWIG2DEF) dllwrap --verbose --output-lib $(LIB) $(LIB_DEF) --dllname $(LIB_DLL) $(LIB_O_FILES) $(LIB_LIB_FLAGS) $(foreach l,$(LIB_LIBS),-l'$(l)') else LIB_DLL:=# $(LIB) : $(LIB_O_FILES) -$(RM) $@ $(AR) cr $@ $(LIB_O_FILES) endif $(LIB_DLL) $(LIB) : LIB:=$(LIB) $(LIB_DLL) $(LIB) : LIB_O_FILES:=$(LIB_O_FILES) $(LIB_DLL) $(LIB) : LIB_DLL:=$(LIB_DLL) $(LIB_DLL) $(LIB) : LIB_DLL_DEF:=$(LIB_DLL_DEF) $(LIB_DLL) $(LIB) : LIB_SWIG2DEF:=$(LIB_SWIG2DEF) $(LIB_DLL) $(LIB) : LIB_DEF:=$(LIB_DEF) $(LIB_DLL) $(LIB) : LIB_LIB_FLAGS:=$(LIB_LIB_FLAGS) $(LIB_DLL) $(LIB) : LIB_LIBS:=$(LIB_LIBS) ############################################################## # Alias .PHONY : $(LIB_NAME) $(LIB_NAME) : $(LIB) ############################################################## # Exports LOCAL_LIBS:=$(LOCAL_LIBS) $(LIB)# LIB_PRODUCTS:=$(LIB_PRODUCTS) $(LIB) $(LIB_DLL)# PRODUCTS:=$(PRODUCTS) $(LIB) $(LIB_DLL)# libs :: $(LIB_PRODUCTS) @$(MSG) Made $@: $(LIB_PRODUCTS) .PHONY : libs ############################################################## # Reset vars LIB:=# LIB_NAME:=# LIB_O_FILES:=# LIB_DLL:=# SWIG2DEF:=# ############################################################## # EOF maks0.2/src/maks/pre.mak0100744000175200017560000001501307262415714015505 0ustar stephensstepheng# $Id: pre.mak,v 1.10 2001/03/17 20:20:04 stephens Exp $ include $(MAKS)/tools.mak ######################################################################### # Variable query ifdef v _v : @$(foreach f,$(v),$(ECHO) "$(f)='$($(f))'"; ) .PHONY : _v endif ######################################################################### # Variable make ifdef vm _vm : endif ######################################################################### # Default targets all : .PHONY : all clean ######################################################################### # Build Options ifndef DEBUG DEBUG=YES endif export DEBUG ifndef OPTIMIZE OPTIMIZE=NO endif export OPTIMIZE ######################################################################### # Disable RCS and SCCS get % : %,v % : RCS/%,v % : s.% % : SCCS/s.% %.mak : %.use : Makefile : ######################################################################### # Config CWD=$(shell pwd) export CWD ifeq "$(strip $(MAKE_ARCH))" "" MAKE_ARCH:=$(shell uname) export MAKE_ARCH endif ifeq "$(strip $(DEV_ROOT))" "" DEV_ROOT:=$(HOME) export DEV_ROOT endif #DEV_ROOT:=$(strip $(shell cd "$(DEV_ROOT)" && pwd)) ######################################################################### # Directories # libraries go in LIB_DIR ifeq "$(strip $(LIB_DIR))" "" LIB_DIR:=$(DEV_ROOT)/lib/$(MAKE_ARCH) export LIB_DIR endif OUTPUT_DIRS+= $(LIB_DIR) # executables go in TOOL_DIR ifeq "$(strip $(TOOL_DIR))" "" TOOL_DIR:=$(DEV_ROOT)/bin/$(MAKE_ARCH) export TOOL_DIR endif OUTPUT_DIRS+= $(TOOL_DIR) ifeq "$(strip $(GEN_FILE_ROOT))" "" GEN_FILE_ROOT:=mak_gen GARBAGE_VERY_DIRS:=$(GARBAGE_VERY_DIRS) $(GEN_FILE_ROOT) endif # test executables go in TEST_DIR ifeq "$(strip $(TEST_DIR))" "" TEST_DIR:=$(GEN_FILE_ROOT)/$(MAKE_ARCH)/t export TEST_DIR endif OUTPUT_DIRS+= $(TEST_DIR) # object files go in O_FILE_DIR ifeq "$(strip $(O_FILE_DIR))" "" O_FILE_DIR:=$(GEN_FILE_ROOT)/$(MAKE_ARCH)/o export O_FILE_DIR endif #VPATH:=$(VPATH) $(O_FILE_DIR)# # Java class files go in JAVA_CLASS_FILE_DIR ifeq "$(strip $(JAVA_CLASS_FILE_DIR))" "" JAVA_CLASS_FILE_DIR:=$(GEN_FILE_ROOT)/jvm export JAVA_CLASS_FILE_DIR endif ifeq "$(DEBUG)" "YES" JAVACFLAGS+=-g CFLAGS+= $(DEBUG_FLAGS) CXXFLAGS+= $(DEBUG_FLAGS) O_FILE_DIR:=$(strip $(O_FILE_DIR)d) endif ifeq "$(OPTIMIZE)" "YES" JAVACFLAGS+=-O CFLAGS+= $(OPTIMIZE_FLAGS) CXXFLAGS+= $(OPTIMIZE_FLAGS) O_FILE_DIR:=$(strip $(O_FILE_DIR)o) endif GENERATED_DIRS+= $(O_FILE_DIR) # # yacc, lex and other tools put there output in GEN_FILE_DIR ifeq "$(strip $(GEN_FILE_DIR))" "" GEN_FILE_DIR:=$(MAKE_ARCH)/g GEN_FILE_DIR:=$(O_FILE_DIR) export GEN_FILE_DIR endif GENERATED_DIRS+= $(GEN_FILE_DIR) #EARLY_TARGETS+= $(DIRS) # Expect to be using some libs generated by us LIB_DIRS+= $(LIB_DIR) ######################################################################### # Suffixes exe= o=.o c=.c cc=.cc y=.y yy=.yy h=.h hh=.h java=.java class=.class swig=.swig ######################################################################### # Default CC options OPTIMIZE_FLAGS+= -O3 DEBUG_FLAGS+= -g CFLAGS+= -Wall ######################################################################### # Target-specifics include $(MAKS)/os/$(MAKE_ARCH).mak ######################################################################### # BUILD_VARS ifndef BUILD_TARGET export BUILD_TARGET:=$(MAKE_ARCH) endif BUILD_VARS+= BUILD_TARGET ifndef BUILD_DATE export BUILD_DATE:=$(shell date) endif BUILD_VARS+= BUILD_DATE ifndef BUILD_HOST export BUILD_HOST:=$(shell hostname) endif BUILD_VARS+= BUILD_HOST ifndef BUILD_USER export BUILD_USER:=$(USER) endif BUILD_VARS+= BUILD_USER ifndef BUILD_ROOT export BUILD_ROOT:=$(CWD) endif BUILD_VARS+= BUILD_ROOT _DEFINES:= $(foreach v,$(BUILD_VARS),-D'$v="$(${v})"' ) DEFINE_FLAGS:=$(DEFINE_FLAGS) $(_DEFINES) ######################################################################### # BUILD_VARS build_vars_h = $(GEN_FILE_DIR)/build_vars.h build_vars_h : $(dir $(build_vars_h)) $(ECHO) '/* DO NOT MODIFY Generated by maks/pre.mak. */' > $(build_vars_h) $(foreach v,$(BUILD_VARS),$(ECHO) '#define $(v) "$($(v))"' >> $(build_vars_h); ) @$(MSG) Made $@ EARLY_TARGETS+= build_vars_h GARBAGE+= $(build_vars_h) ######################################################################### # Defines DEFINE_FLAGS+= $(foreach f,$(DEFINES), -D'$(f)') ######################################################################### # Includes INCLS+= $(O_FILE_DIR) INCL_FLAGS+= $(foreach f,$(INCLS), -I'$(f)') CPPFLAGS+= $(DEFINE_FLAGS) $(INCL_FLAGS) ######################################################################### # Libs LIB_FLAGS+= $(foreach f,$(LIB_DIRS), -L'$(f)') LIB_FLAGS+= $(foreach f,$(LIBS), -l'$(f)') ######################################################################### # version ######################################################################### # yacc Y_FILES_ALL+= $(Y_FILES) $(Y_FILES_GEN) _Y_FILES_ALL=$(notdir $(Y_FILES_ALL)) Y_C_FILES_GEN+= $(_Y_FILES_ALL:%$(y)=$(GEN_FILE_DIR)/$(notdir %)$(c)) C_FILES_GEN+= $(Y_C_FILES_GEN) ######################################################################### # swig SWIG_WRAPPER=tcl8# SWIG_WRAPPER_tcl8=-namespace -module $(notdir $*) SWIG_FILES_ALL+= $(SWIG_FILES) $(SWIG_FILES_GEN) _SWIG_FILES_ALL=$(notdir $(SWIG_FILES_ALL)) SWIG_C_FILES_GEN+= \ $(_SWIG_FILES_ALL:%$(swig)=$(GEN_FILE_DIR)/$(notdir %)_swig$(c)) SWIG_WRAPPER_C_FILES_GEN+= \ $(foreach w,$(SWIG_WRAPPER),$(_SWIG_FILES_ALL:%$(swig)=$(GEN_FILE_DIR)/$(notdir %)_swig_$(w)$(c))) C_FILES_GEN+= $(SWIG_C_FILES_GEN) $(SWIG_WRAPPER_C_FILES_GEN) ######################################################################### # C C_FILES_ALL+= $(C_FILES)# $(C_FILES_GEN) _C_FILES_ALL=$(notdir $(C_FILES_ALL)) C_O_FILES_GEN+= $(_C_FILES_ALL:%$(c)=$(O_FILE_DIR)/$(notdir %)$(o)) C_GEN_O_FILES_GEN+= $(C_FILES_GEN:%$(c)=%$(o)) O_FILES_GEN+= $(C_O_FILES_GEN) $(C_GEN_O_FILES_GEN) ######################################################################### # C++ CC_FILES_ALL+= $(CC_FILES) $(CC_FILES_GEN) _CC_FILES_ALL=$(notdir $(CC_FILES_ALL)) CC_O_FILES_GEN+= $(_CC_FILES_ALL:%$(cc)=$(O_FILE_DIR)/$(notdir %)$(o)) O_FILES_GEN+= $(CC_O_FILES_GEN) ######################################################################### # Java JAVA_FILES_ALL+= $(JAVA_FILES) $(JAVA_FILES_GEN) _JAVA_FILES_ALL=$(notdir $(JAVA_FILES_ALL)) JAVA_CLASS_FILES_GEN+= $(_JAVA_FILES_ALL:%$(java)=$(CLASS_FILE_DIR)/$(notdir %)$(class)) ######################################################################### # Object files O_FILES+= $(O_FILES_GEN) ######################################################################### # Use -include Makefile.use maks0.2/src/maks/tool.mak0100644000175200017560000000316307065630434015675 0ustar stephensstepheng# $Id: tool.mak,v 1.7 2000/03/21 08:21:48 stephensk Exp $ ###################################################################### # Defaults TOOL_SUFFIX:=$(exe) _TOOL_DIR:=$(TOOL_DIR) ifneq "$(TOOL_TEST)" "" TOOL_DIR:=$(TEST_DIR) endif TOOL:=$(TOOL_DIR)/$(TOOL_NAME)$(TOOL_SUFFIX) TOOL_DIR:=$(_TOOL_DIR) ifeq "$(strip $(TOOL_MAIN))" "" TOOL_MAIN:=$(TOOL_NAME).c endif ifeq "$(strip $(TOOL_O_FILES))" "" TOOL_O_FILES:=$(TOOL_MAIN) endif TOOL_O_FILES_$(TOOL):=$(TOOL_O_FILES) ifeq "$(strip $(TOOL_LIBS))" "" TOOL_LIBS:=$(LIBS) endif TOOL_LIBS_$(TOOL):=$(TOOL_LIBS) ifeq "$(strip $(TOOL_LIB_FLAGS))" "" TOOL_LIB_FLAGS:=$(LIB_FLAGS) endif TOOL_LIB_FLAGS_$(TOOL):=$(TOOL_LIB_FLAGS) ###################################################################### # Target $(TOOL) : $(TOOL_O_FILES_$(TOOL)) $(LOCAL_LIBS) $(CC) $(CFLAGS) $(CPPFLAGS) -o '$@' $(TOOL_O_FILES_$(@)) $(TOOL_LIB_FLAGS_$(@)) $(foreach l,$(TOOL_LIBS_$(@)),-l'$(l)') # $(CP) $@ $(notdir $@) GARBAGE:=$(GARBAGE) $(notdir $(TOOL)) ###################################################################### # Aliases .PHONY : $(TOOL_NAME) $(notdir $(TOOL)) $(TOOL_NAME) $(notdir $(TOOL)) : $(TOOL) ###################################################################### # Export the target TOOL_PRODUCTS:=$(TOOL_PRODUCTS) $(TOOL) PRODUCTS:=$(PRODUCTS) $(TOOL) tools :: $(TOOL_PRODUCTS) @$(MSG) Made $@: $(TOOL_PRODUCTS) .PHONY : tools ###################################################################### # Reset vars TOOL_NAME:= TOOL_MAIN:= TOOL_O_FILES:= TOOL_LIBS:= TOOL_LIB_FLAGS:= TOOL_TEST:= ###################################################################### # EOF maks0.2/src/maks/tools.mak0100644000175200017560000000032406765637251016066 0ustar stephensstepheng# $Id: tools.mak,v 1.5 1999/09/09 04:59:21 stephensk Exp $ ECHO=echo MSG_PREFIX=+++ MSG=$(ECHO) $(MSG_PREFIX) MKDIR=mkdir MKDIRS=$(MKDIR) -p CP=cp CP_RECURSIVE=$(CP) -rp MV=mv TAR=tar GZIP=gzip -9 GUNZIP=gzip -d maks0.2/src/maks/use.mak0100744000175200017560000000075607262415714015523 0ustar stephensstepheng# $Id: use.mak,v 1.4 2001/03/21 02:04:14 stephens Exp $ # # Use a package. # # USE:= # include $(MAKS)/use.mak # # A package's Makefile.use contains the names of libraries # and header directories needed to 'USE' the package. # #USE:=$(strip $(shell cd $(USE) && /bin/pwd)) # Canonicalize the name error USE=$(USE) ifeq "$(findstring $(USE),$(USE_ALL))" "" # Include it once USE_ALL:=$(USE_ALL) $(USE) # Keep track of directories we USEd -include $(USE)/Makefile.use endif maks0.2/src/maks/bin/0040755000175200017560000000000007236675452015007 5ustar stephensstephengmaks0.2/src/maks/bin/CVS/0040755000175200017560000000000007236675452015442 5ustar stephensstephengmaks0.2/src/maks/bin/CVS/Root0100644000175200017560000000003407236675452016302 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/maks/bin/CVS/Repository0100644000175200017560000000002607236675452017537 0ustar stephensstephenghome/ion/src/maks/bin maks0.2/src/maks/bin/CVS/Entries0100644000175200017560000000011607236675452016771 0ustar stephensstepheng/mak/1.2/Mon Jun 28 14:03:33 1999// /mak.bat/1.3/Mon Jun 28 14:03:33 1999// D maks0.2/src/maks/bin/mak0100644000175200017560000000064206735700265015473 0ustar stephensstepheng#!/bin/sh HOME=`cd "$HOME" && pwd` if [ -z "$DEV_ROOT" ] then DEV_ROOT="${HOME}/src" fi DEV_ROOT=`cd "$DEV_ROOT" && pwd` export DEV_ROOT if [ -z "$MAKS" ] then MAKS='/home/stephens/src/maks' fi MAKS=`cd "$MAKS" && pwd` export MAKS if [ -z "$MAKE_ARCH" ] then MAKE_ARCH=`uname` fi export MAKE_ARCH echo "HOME=$HOME" echo "DEV_ROOT=$DEV_ROOT" echo "MAKS=$MAKS" echo "MAKE_ARCH=$MAKE_ARCH" exec make ${1+"$@"} maks0.2/src/maks/bin/mak.bat0100644000175200017560000000015206735700265016234 0ustar stephensstepheng@REM $Id: mak.bat,v 1.3 1999/06/28 14:03:33 stephensk Exp $ @sh %MAKS%\bin\mak %1 %2 %3 %4 %5 %6 %7 %8 %9 maks0.2/src/maks/opengl/0040755000175200017560000000000007262533466015520 5ustar stephensstephengmaks0.2/src/maks/opengl/CVS/0040755000175200017560000000000007262562005016142 5ustar stephensstephengmaks0.2/src/maks/opengl/CVS/Root0100644000175200017560000000003407236675452017016 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/maks/opengl/CVS/Repository0100644000175200017560000000003107236675452020247 0ustar stephensstephenghome/ion/src/maks/opengl maks0.2/src/maks/opengl/CVS/Entries0100644000175200017560000000013007262562005017465 0ustar stephensstepheng/Makefile/1.2/Fri Feb 19 09:26:02 1999// /Makefile.use/1.4/Wed Apr 4 09:09:10 2001// D maks0.2/src/maks/opengl/Makefile0100644000175200017560000000011306663227052017143 0ustar stephensstepheng# $Id: Makefile,v 1.2 1999/02/19 09:26:02 stephensk Exp $ all : clean : maks0.2/src/maks/opengl/Makefile.use0100644000175200017560000000075707262562266017761 0ustar stephensstepheng# $Id: Makefile.use,v 1.4 2001/04/04 09:09:10 stephens Exp $ #OPENGL_ROOT:=$(APPS)/dev# OPENGL_LIBDIR:=$(OPENGL_ROOT)# OPENGL_INCL:=$(OPENGL_ROOT)# # Are we using WIN32? MAKS_ARCH=$(MAKE_ARCH)# ifneq "$(strip $(findstring WIN,$(MAKS_ARCH)))" "" USE:=$(MAKS)/win32 include $(MAKS)/use.mak OPENGL_LIBS := opengl32 glu32 glut32 m # endif ifneq "$(strip $(findstring Linux,$(MAKS_ARCH)))" "" OPENGL_LIBS := GL GLU glut m # endif INCLS:=$(INCLS) $(OPENGL_INCL)# LIBS:=$(OPENGL_LIBS) $(LIBS)# maks0.2/src/maks/os/0040755000175200017560000000000007236675452014660 5ustar stephensstephengmaks0.2/src/maks/os/CVS/0040755000175200017560000000000007236675452015313 5ustar stephensstephengmaks0.2/src/maks/os/CVS/Root0100644000175200017560000000003407236675452016153 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/maks/os/CVS/Repository0100644000175200017560000000002507236675452017407 0ustar stephensstephenghome/ion/src/maks/os maks0.2/src/maks/os/CVS/Entries0100644000175200017560000000021207236675452016637 0ustar stephensstepheng/CYGWIN.mak/1.1/Thu Jan 13 11:24:09 2000// /CYGWIN_98-4.10.mak/1.1/Thu Jan 13 11:24:09 2000// /Linux.mak/1.1/Thu Jan 13 11:24:10 2000// D maks0.2/src/maks/os/CYGWIN.mak0100644000175200017560000000013007037332731016326 0ustar stephensstepheng# $Id: CYGWIN.mak,v 1.1 2000/01/13 11:24:09 stephensk Exp $ # CYGWIN (generic) exe=.exe maks0.2/src/maks/os/CYGWIN_98-4.10.mak0100644000175200017560000000016407037332731017235 0ustar stephensstepheng# $Id: CYGWIN_98-4.10.mak,v 1.1 2000/01/13 11:24:09 stephensk Exp $ # CYGWIN_98-4.10 include $(MAKS)/os/CYGWIN.mak maks0.2/src/maks/os/Linux.mak0100644000175200017560000000011507037332732016431 0ustar stephensstepheng# $Id: Linux.mak,v 1.1 2000/01/13 11:24:10 stephensk Exp $ # Linux-specifics maks0.2/src/maks/win32/0040755000175200017560000000000007236675452015201 5ustar stephensstephengmaks0.2/src/maks/win32/CVS/0040755000175200017560000000000007236675452015634 5ustar stephensstephengmaks0.2/src/maks/win32/CVS/Root0100644000175200017560000000003407236675452016474 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/maks/win32/CVS/Repository0100644000175200017560000000003007236675452017724 0ustar stephensstephenghome/ion/src/maks/win32 maks0.2/src/maks/win32/CVS/Entries0100644000175200017560000000013007236675452017157 0ustar stephensstepheng/Makefile/1.2/Fri Feb 19 09:26:02 1999// /Makefile.use/1.2/Fri Feb 19 09:26:02 1999// D maks0.2/src/maks/win32/Makefile0100644000175200017560000000011306663227052016621 0ustar stephensstepheng# $Id: Makefile,v 1.2 1999/02/19 09:26:02 stephensk Exp $ all : clean : maks0.2/src/maks/win32/Makefile.use0100644000175200017560000000014506663227052017421 0ustar stephensstepheng# $Id: Makefile.use,v 1.2 1999/02/19 09:26:02 stephensk Exp $ LIBS := kernel32 user32 gdi32 $(LIBS) maks0.2/src/bin/0040755000175200017560000000000007306140035014032 5ustar stephensstephengmaks0.2/src/bin/CVS/0040755000175200017560000000000007306135474014500 5ustar stephensstephengmaks0.2/src/bin/CVS/Root0100644000175200017560000000003407236675451015346 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/CVS/Repository0100644000175200017560000000002107236675451016576 0ustar stephensstephenghome/ion/src/bin maks0.2/src/bin/CVS/Entries0100644000175200017560000000343107306135474016032 0ustar stephensstepheng/PKG/1.1.1.1/Wed Feb 17 06:33:07 1999// /addcr/1.5/Wed Feb 17 23:02:18 1999// /addrcsid.pl/1.3/Mon Jun 28 13:55:59 1999// /ccinfo/1.1.1.1/Wed Feb 17 06:33:07 1999// /ccloclibs/1.1.1.1/Wed Feb 17 06:33:07 1999// /ctocnl.c/1.2/Fri Feb 19 09:25:26 1999// /cvschrep.pl/1.3/Sun Jan 14 15:40:02 2001// /cvschroot.pl/1.3/Wed Feb 17 22:29:09 1999// /cvsclean/1.1/Thu Oct 21 00:01:07 1999// /cvsedited/1.1/Wed Oct 13 21:42:43 1999// /cvsfind.pl/1.4/Thu Oct 21 00:01:07 1999// /cvsretag.pl/1.1/Thu Sep 9 06:11:27 1999// /cvsrevhist.pl/1.6/Tue Mar 21 07:13:26 2000// /cwfixlib.pl/1.2/Fri Feb 19 09:25:26 1999// /d2u.pl/1.8/Sun Jan 14 15:40:36 2001// /ecd/1.1.1.1/Wed Feb 17 06:33:07 1999// /fe/1.1.1.1/Wed Feb 17 06:33:08 1999// /findsource/1.1.1.1/Wed Feb 17 06:33:08 1999// /igrep/1.2/Thu Sep 30 18:41:09 1999// /linkdups/1.1.1.1/Wed Feb 17 06:33:07 1999// /locstatic/1.1.1.1/Wed Feb 17 06:33:08 1999// /lsup/1.2/Thu Sep 30 18:49:41 1999// /mergefiles.pl/1.2/Fri Feb 19 09:25:26 1999// /mkindex/1.2/Thu Sep 30 18:41:09 1999// /mvr.pl/1.1/Wed Oct 13 21:42:44 1999// /nmlibs/1.1.1.1/Wed Feb 17 06:33:07 1999// /nmm/1.1.1.1/Wed Feb 17 06:33:07 1999// /objcsyms/1.1.1.1/Wed Feb 17 06:33:08 1999// /sci/1.1.1.1/Wed Feb 17 06:33:08 1999// /scip/1.1.1.1/Wed Feb 17 06:33:08 1999// /si/1.2/Wed Oct 13 17:09:27 1999// /split.c/1.2/Fri Feb 19 09:25:26 1999// /tgz/1.6/Sun Jan 14 15:41:22 2001// /ts/1.2/Tue Mar 21 07:15:07 2000// /which/1.1.1.1/Wed Feb 17 06:33:08 1999// /whichall/1.1.1.1/Wed Feb 17 06:33:08 1999// /wwwsend/1.1.1.1/Wed Feb 17 06:33:07 1999// D/addcr.t//// D/lib//// /dos2unix.c/1.1/Fri Apr 8 22:48:41 1994// /swig2def.pl/1.1/Tue Apr 3 18:40:06 2001// /cvsfix.pl/1.1/Mon Apr 9 20:43:32 2001// /uud/1.3/Tue Apr 3 18:51:54 2001// /uudindex/1.3/Tue Apr 3 18:51:55 2001// /publish.pl/1.10/Sat Jun 2 10:09:00 2001// maks0.2/src/bin/PKG0100644000175200017560000000034606662461243014411 0ustar stephensstephengNAME=bin VERSION=0.1 DESC="A development script library. Tools for: publishing PKG packages, adding COPYRIGHT and RCS version strings to source files, etc." CATEGORY="Development Tools" REQUIRES_PKGS="" REQUIRES_OTHERS="perl sh" maks0.2/src/bin/addcr0100644000175200017560000002206706662645172015056 0ustar stephensstepheng#!/usr/local/bin/perl # @COPYRIGHT@ # # Copyright (c) 1997-1999 Kurt A. Stephens and ION, Inc., All Rights Reserved. # # http://www.acm.org/~stephensk # # Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES # ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING # BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR # A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens or Ion, Inc. # SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF # USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. # # $Id: addcr,v 1.5 1999/02/17 23:02:18 stephensk Exp $ # # @COPYRIGHT END@ ($progname = $0) =~ s@^.*[/\\]@@; $progdir = ($0 =~ m@^(.*)[/\\]@) ? $1 : '.'; #print STDERR "progdir = '$progdir', progname = '$progname'\n"; exit(1); @comments = ( [ '/\.(o|obj|lib|a|exe|com|out|bak)$/i || /,v$/i || /~$/ || -B $filename', 0 ], # Ignore object, backup, RCS, emacs backups, and binary files [ '/$backup_suffix$/i', 0 ], # Ignore our backup files [ '/\.([CchHyYlL]+|java)$/i || firstline_() =~ /^\s*(#\s*include|#\s*if|#\s*define|\/\*|\/\/)/', [ '/*', '**', '*/' ] ], [ '/\.(el|scm|ll|lisp)$/i || firstline_() =~ /^\s*;/', [ ';' ] ], [ '/\.(bat)$/i', [ 'REM ' ] ], # DOS BAT files [ '/Makefile.*|(\.(mak|pl|pm|perl|[ck]?sh))$/i || firstline() =~ /^\s*#/', [ '#' ] ] ); foreach $x ( @comments ) { die "$!: Cannot compile $x->[0]" if ( ! ($x->[2] = eval("sub { $x->[0]; }")) ); $x->[1]->[1] = $x->[1]->[0] if ( ! defined($x->[1]->[1]) ); $x->[1]->[2] = '' if ( ! defined($x->[1]->[2]) ); } ################################## sub firstline { local(*F); if ( $_firstline_filename eq $filename ) { return $_firstline; } $_firstline_filename = $filename; open(F, "<$filename") || warn "$!: Cannot open $filename for reading"; $F = ; close(F); chop $F; $_firstline = $F; $F; } sub firstline_ { # Get first non-blank line, skipping first line if it's "#!" local(*F); if ( $_firstline__filename eq $filename ) { return $_firstline_; } $_firstline__filename = $filename; open(F, "<$filename") || warn "$!: Cannot open $filename for reading"; $F = ; #print STDERR "firstline_ = '$F'\n"; $F = if ( $F =~ /^\#\!/ ); #print STDERR "firstline_ = '$F'\n"; chop $F; while ( $F =~ /^\s*$/ ) { $F = ; chop $F; } close(F); $_firstline_ = $F; #print STDERR "firstline_ = '$F'\n"; $F; } ################################## $replacestr = 'COPYRIGHT'; $replacefile = $replacestr; $filename = '.'; $testing = 0; $debug = 0; $backup_suffix = '.acr'; $rm_backup = 0; $dryrun = 0; $usage = 0; $recursive = 0; sub findfile { my($replacedir); $replacedir = ($filename =~ m@^(.*)[/\\]@) ? $1 : '.'; #print STDERR "replacedir = '$replacedir'\n"; while ( ! -r ($FILE = "$replacedir/$replacefile") ) { $replacedir .= "/.."; if ( $replacedir eq './../../../../../../../../../..' ) { die "Cannot locate $replacefile" if ( ! $usage ); return ""; } } $FILE; } sub insertfile { # Begin replace block print OUT $comments->[0], ' @', $replacestr, '@', "\n"; print OUT $comments->[1], "\n"; # Open comment text file open(FILE, "<$FILE") || die "$!: Cannot open $FILE for reading"; # Insert the comment text while ( $line = ) { print OUT $comments->[1], ' ', $line; } close(FILE); # End replace block print OUT $comments->[1], "\n"; print OUT $comments->[1], ' @', $replacestr, ' END@ ', $comments->[2], "\n"; # Copy rest of IN file if ( defined($firstline) ) { print OUT $firstline; $firstline = undef; } while ( $line = ) { print OUT $line; } close(IN); close(OUT); if ( (! $testing) && $rm_backup ) { system('rm', $IN); } print STDERR "$progname: $filename: found and replaced preexisting $replacestr block\n" if ( $debug ); 1; } sub replacestr { local($comments) = @_; local(*IN,*OUT,*FILE); local($line, $firstline); # Find the replacement text file $FILE = findfile(); if ( $dryrun ) { print "$progname: $filename: $FILE: $comment->[0]: $comment->[1]: $comment->[2]\n"; } $_ = $filename; if ( $testing ) { $OUT = $filename . $backup_suffix; $IN = $filename; } else { # We move the file to $IN $OUT = $filename; $IN = $filename . $backup_suffix; if ( -f $IN ) { print STDERR "$progname: backup file $IN already exists\n"; return 0; } if ( ! (-w && -r && -f) ) { print STDERR "$progname: $filename: file not read/write\n"; return 0; } system('mv', $OUT, $IN) && die "$!: Cannot mv $OUT $IN"; } # Open IN and OUT files open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; # Read first line if ( ($line = ) ) { # If first line contains 'DO NOT MODIFY', don't do anything! if ( $line =~ /DO NOT MODIFY/i ) { print STDERR "$progname: $filename: found 'DO NOT MODIFY'\n" if ( $debug ); close(IN); close(OUT); # Restore original file if ( ! $testing ) { system('mv', $IN, $OUT); } return 0; } } while ( $line ) { # Have we found a preexisting replace string if ( $line !~ /@$replacestr@/ ) { # Simply echo to OUT print OUT $line; } else { print STDERR "$progname: $filename: found '\@$replacestr\@'\n" if ( $debug ); # Skip over input comment block while ( ($line = ) ) { if ( $line =~ /@$replacestr END@/ ) { print STDERR "$progname: $filename: found '\@$replacestr END\@' terminator\n" if ( $debug ); return insertfile(); } } # Did not find END terminator! print STDERR "$progname: $filename: did not find '\@$replacestr END\@' terminator\n"; close(IN); close(OUT); open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; while ( ($line = ) ) { if ( $line =~ /@$replacestr@/ ) { return insertfile(); } else { print OUT $line; } } } $line = ; } # We never found a preexisting comment block; # insert $FILE after #! line. print STDERR "$progname: $filename: did not find preexisting $replacestr block\n" if ( $debug ); close(IN); close(OUT); open(OUT, ">$OUT") || die "$!: Cannot open $OUT for writing"; open(IN, "<$IN") || die "$!: Cannot open $IN for reading"; # Skip over first shell script #! line $firstline = ; if ( $firstline =~ /^#!\// ) { print STDERR "$progname: $filename: skipping first line '$firstline'\n" if ( $debug ); print OUT $firstline; $firstline = undef; } insertfile(); } sub getdir { local(*DIR); $DIR = $_[0]; opendir(DIR, $DIR); @DIR = grep(($_ ne '.' && $_ ne '..'), readdir DIR); closedir(DIR); print STDERR "getdir: $DIR: ", join(", ", @DIR), "\n" if ( $debug > 2 ); @DIR; } sub dofile { $filename = $_[0]; $_ = $filename; s@^.*[/\\]@@; # remove directory path print STDERR "$progname: $filename: dofile\n" if ( $debug > 1 ); if ( -r $filename && -w $filename ) { if ( -d $filename ) { my($fuc) = uc($_); if ( $fuc =~ /^CVS/ || $fuc eq 'RCS' || $fuc eq 'SCCS' ) { print STDERR "$progname: $filename: skipping dir\n" if ( 1 || $debug ); } elsif ( $recursive ) { print STDERR "$progname: $filename: recursing\n" if ( $debug ); my($dirname) = $filename; foreach $_ ( getdir($dirname) ) { dofile("$dirname/$_"); } } else { print STDERR "$progname: $filename: skipping\n"; } } else { X: foreach $x ( @comments ) { print STDERR "$progname: $filename: trying $x->[0]\n" if ( $debug > 1); if ( $x->[2] ) { if ( &{$x->[2]}() ) { print STDERR "$progname: $filename: matched $x->[0]\n" if ( $debug > 1); if ( $x->[1] ) { print STDERR "$progname: $filename: not modified\n" if ( ! replacestr($x->[1]) ); } else { print STDERR "$progname: $filename: skipping\n"; } last X; } } else { die "$progname: no proc for $x->[0]\n"; } } } } else { print STDERR "$progname: $filename: cannot read or write\n"; } } sub usage { $usage = 1; print STDERR qq~ $progname: usage: $progname ... $progname replaces \@$replacestr\@ with contents of the $replacefile file. OPTIONS -dryrun Do a dryrun. -debug Enable debugging. -testing Enable testing. -R If directories are specified, they are traversed recursively. -h, -? This usage message. The current $replacefile file is located at ~ . &findfile() . "\n"; exit(0); } #push(@ARGV, '.') if ( ! @ARGV ); foreach ( @ARGV ) { if ( s/^--?// ) { if ( /^[Hh\?]/ ) { &usage; } elsif ( /^dr/ ) { $dryrun ++; } elsif ( /^d/ ) { $debug ++; } elsif ( /^t/ ) { $testing ++; } elsif ( /^(R|rec)/ ) { $recursive ++; } else { print STDERR "$progname: $_: unrecognized option\n"; } } else { dofile($_); } } 1; maks0.2/src/bin/addrcsid.pl0100644000175200017560000000647106735677357016204 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $ # # addrcsid.pl ... # # Recursively add $Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $ strings to source files. # Avoids CVS, RCS, and SCCS directories and binary and ',v' files. # # TO DO: # use @comment array from addcr.pl to control comment characters and such # use File::Basename; use File::Find; $progname = basename($0); sub skip_first_lines { $suffix = '.scm' if ( $suffix =~ /^\.(scm|lisp|ll|el)$/i ); # Skip lines until after %{ for yacc files if ( $suffix =~ /^\.[yl]/i ) { LINE: while ( $line = <$in> ) { print $out $line; last LINE if ( $line =~ /^\s*%\{/ ); } } elsif ( $suffix =~ /^\.h/i ) { $line = <$in>; if ( $line =~ /^\s*#\s*if/ ) { print $out $line; $line = <$in>; } } else { $line = <$in>; if ( $line =~ /^\s*\#!/ ) { print $out $line; $line = <$in>; } } $line; } $rcs_id_str = '$Id: addrcsid.pl,v 1.3 1999/06/28 13:55:59 stephensk Exp $'; sub print_rcs_id { if ( $suffix =~ /^\.[ychlm]/i ) { print $out qq~ #ifndef __rcs_id__ #ifndef __rcs_id_${ftoken}__ #define __rcs_id_${ftoken}__ static const char __rcs_id_${ftoken}[] = "$rcs_id_str"; #endif #endif /* __rcs_id__ */ ~; } elsif ( $suffix =~ /^.htm/ ) { print $out qq~ ~; } elsif ( $suffix eq '.java' ) { print $out qq~/* $rcs_id_str */ ~; } else { my($com) = '#'; $com = ';' if ( $suffix =~ /^\.(scm|lisp|ll|el)$/ ); print $out qq~$com $rcs_id_str ~; } } sub do_file { #print STDERR "$progname: do_file($File::Find::dir/$_)\n"; if ( ( -d && /^(CVS|RCS|SCCS)/i ) || /,v$/ ) { $File::Find::prune = 1; } elsif ( -f && -r && ! -B && ( /(\.[a-zA-Z_0-9]+)$/i || /^makefile/i ) ) { local($suffix) = $1; my($found) = 0; local($in, $out); local($line); # In and out files $in = $_; $out = "$_.tmp"; # Generate a C token for the filename local($ftoken) = $File::Find::name; $ftoken = $1 if ( $ftoken =~ m@([^\\/]+[\\/][^\\/]+)$@ ); $ftoken =~ tr/A-Za-z_0-9/_/c; # open files die "$out exists" if ( -e $out ); open($out, ">$out") || die "$out: $!: "; open($in, "<$in") || die "$in: $!: "; skip_first_lines(); while ( $line ) { if ( $line =~ /DO NOT MODIFY/ ) { print STDERR "$progname: DO NOT MODIFY: skipping $File::Find::dir/$_\n"; close($in); close($out); unlink($out); return; } #locate prexisting rcs id block */ if ( $line =~ /^\s*\#\s*ifndef\s+__rcs_id__/ ) { $found = 1; # skip block while ( $line = <$in> && $line !~ m@^\s*\#\s*endif\s*/\*\s*__rcs_id__\s*\*/@ ) { 1; } print_rcs_id(); } print $out $line; $line = <$in>; } close($in); close($out); if ( ! $found ) { open($out, ">$out") || die "$out: $!: "; open($in, "<$in") || die "$in: $!: "; # Skip first lines skip_first_lines(); # Put rcs id print_rcs_id(); # write rest of file while ( $line ) { print $out $line; $line = <$in>; } close($in); close($out); } if ( -w $in ) { unlink($in); rename($out, $in); print STDERR "$progname: $File::Find::dir/$in\n" } else { print STDERR "$progname: $File::Find::dir/$in not writable: result in $File::Find::dir/$out\n"; } } } File::Find::find(\&do_file, @ARGV); 1; maks0.2/src/bin/ccinfo0100644000175200017560000001177606662461243015242 0ustar stephensstepheng#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; $cwd = 0; sub cwd { if ( ! $cwd ) { chop($cwd = `/bin/pwd`); $cwd = simplifyPathname($cwd); #print STDERR "cwd = $cwd\n"; } $cwd; } sub simplifyPathname { my($p) = $_[0]; $p =~ s@^/private/@/@; $p =~ s@//@/@g; $p =~ s@/\./@/@g; while ( $p =~ s@/[^/]+/\.\./@/@ ) { } #print STDERR "simplifyPathname $_[0] -> $p\n"; $p; } #for ( @ARGV ) { # print $_, " => ", simplifyPathname($_), "\n"; #} #exit 0; sub absPathname { my($f) = $_[0]; $f = ($f =~ m@^/@) ? $f : simplifyPathname(cwd() . "/" .$f); #print STDERR "absPathname $_[0] -> $f\n"; $f; } sub filePathname { my($f) = $_[0]; $f = ($f =~ m@([^/]+)$@) ? $1 : $f; #print STDERR "filePathname $_[0] -> $f\n"; $f; } sub suffixPathname { my($f) = $_[0]; $f = ($f =~ m@(\.[^/.]*)$@) ? $1 : ''; #print STDERR "suffixPathname $_[0] -> $f\n"; $f; } sub findFile { my($file,$path) = @_; my($f); if ( $file =~ m@^/@ ) { if ( -r $file ) { return $file; } } else { foreach $d ( @$path ) { $f = $d . '/' . $file; if ( -r $f ) { return $f; } } } 0; } sub expandSoftlink { my($f) = @_; my($l,$linkcount); $linkcount = 40; while ( -l $f && ($l = readlink($f)) ) { # print STDERR "softlink $f -> $l\n"; -- $linkcount || die "$0: $f: Too many levels of symbolic links"; if ( $l =~ m@^/@ ) { $f = $l; } else { $f =~ s@/[^/]+/?$@@; $f .= "/" . $l; } } $f; } sub _objCName { if ( s/^\.objc_class_name_// ) { $_ = '@class ' . $_; } elsif ( m/^\.objc_category_name_([^_]+)_([^_]+)/ ) { $_ = '@category ' . $1 . '(' . $2 . ')'; } $_; } sub _nmInfo { my($x) = @_; my($fp, $f, $suf, $floc, $a); $f = $x->[1]; $fp = $x->[2]; $suf = $x->[0]; $floc = $fp; $a = []; open(NM, "/bin/nm $fp|"); while ( ) { chop; if ( s/^\s+U\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'refs', 'symb', $_, '' ]); } elsif ( s/^([0-9a-fA-f]+)\s+T\s+// || (s/^([0-9a-fA-f]+)\s+t\s+// && m/^[-+]\[/) ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'prog', $_, $1 ]); } elsif ( s/^([0-9a-fA-f]+)\s+D\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'data', $_, $1 ]); } elsif ( s/^([0-9a-fA-f]+)\s+A\s+// ) { _objCName(); push(@$a, [ $suf, $f, $floc, 'defs', 'abs', $_, $1 ]); } elsif ( m@^/([^(]+)[(]([^)]+)[)]@ ) { $module = $2; $suf = suffixPathname($module); $f = $module; $floc = $x->[2] . '@' . $module; push(@$a, [ $x->[0], $x->[1], $x->[2], 'has', $suf, $f, '' ]); } } close(NM); $a; } sub nmInfo { my($fp) = @_; #print STDERR "nmInfo $fp->[2] \n"; _nmInfo($fp); } @ldirs = ('.'); @fdirs = ('/LocalLibrary/Frameworks', '/NextLibrary/Frameworks'); @lfiles = (); @ffiles = (); @archs = (); @infiles = (); $outfile = 0; $doInfo = 1; @argv = @ARGV; shift @argv; while ( $a = shift @argv ) { if ( $a =~ m/^-L(.*)$/ ) { push(@ldirs, $1); } elsif ( $a =~ m/^-l(.*)$/ ) { push(@lfiles, [ 'lib', $1, '' ]); } elsif ( $a eq '-o' ) { $outfile = absPathname(shift @argv); } elsif ( $a eq '-arch' ) { push(@archs, shift @argv); } elsif ( $a eq '-framework' ) { $f = shift @argv; push(@ffiles, [ 'framework', $f, '' ]); } elsif ( $a =~ m/^-[cSE]$/ ) { $doInfo = 0; } elsif ( $a eq '-sectcreate' || $a eq '-segprot' ) { shift @argv; shift @argv; shift @argv; } elsif ( $a !~ m@^-@ && $a =~ m/\.\w+$/ ) { if ( $a =~ m/\.a$/ ) { push(@infiles, [ 'lib', filePathname($a), absPathname($a) ] ); } else { push(@infiles, [ suffixPathname($a), filePathname($a), absPathname($a) ] ); } } } if ( $doInfo ) { foreach $x ( @lfiles ) { my($file) = 'lib' . $x->[1] . '.a'; $x->[2] = absPathname(expandSoftlink(findFile($file, \@ldirs))); if ( $x->[2] ) { push(@infiles, $x); } } push(@ffiles, [ 'framework', 'System' ]); foreach $x ( @ffiles ) { my($file) = $x->[1] . '.framework/' . $x->[1]; $x->[2] = absPathname(expandSoftlink(findFile($file, \@fdirs))); if ( $x->[2] ) { push(@infiles, $x); } } if ( ! $outfile ) { $outfile = 'a.out'; } @info = (); # type name location relation type name location # 0 1 2 3 4 5 6 %defs = (); $datafile="$outfile.ccinfo"; open(FILE,">$datafile") || print STDERR "$0: cannot open $datafile for writing: $!"; for $x ( @infiles ) { print FILE join("\t", 'exe', filePathname($outfile), $outfile, 'links', $x->[0], $x->[1], $x->[2]), "\n"; if ( $x->[2] && ($x->[0] eq 'lib' || $x->[0] eq 'framework' || $x->[0] eq '.o') ) { for $i ( @{nmInfo($x)} ) { push(@info, $i); if ( $i->[3] eq 'defs' ) { $defs{$i->[5]} = $i; } } } } for $i ( @info ) { if ( $i->[3] eq 'refs' ) { if ( $j = $defs{$i->[5]} ) { $i->[4] = $j->[4]; $i->[6] = ''; # $j->[2] . '@' . $j->[6]; } } print FILE join("\t", @{$i}), "\n"; } close(FILE); } exec(@ARGV); maks0.2/src/bin/ccloclibs0100644000175200017560000000576306662461243015735 0ustar stephensstepheng#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; # # This program interprets cc -L and -l linker command lines # a attempts to locate the libraries (lib*.a) in the -L paths specified # for each library file found. a "dir " entry is written # to a "gdbinit" file. # # It also creates a dependency in Makefile.dependencies for the executable # on the libraries. # # Libs files found that are softlinks are resolved. This will # allow you to find source for a library if you install your libraries # in directory a directory by using softlinks instead of copies. # # The last step is to exec the linker command # you can use this in your Makefile by calling 'make "CC=ccloclibs cc"' # sub findFile { my($file,$path) = @_; my($f); if ( $file =~ m@^/@ ) { if ( -r $file ) { return $file; } } else { foreach $d ( @$path ) { $f = $d . '/' . $file; if ( -r $f ) { return $f; } } } 0; } sub expandSoftlink { my($f) = @_; my($l,$linkcount); $linkcount = 40; while ( -l $f && ($l = readlink($f)) ) { # print STDERR "softlink $f -> $l\n"; -- $linkcount || die "$0: $f: Too many levels of symbolic links"; if ( $l =~ m@^/@ ) { $f = $l; } else { $f =~ s@/[^/]+/?$@@; $f .= "/" . $l; } } $f; } sub simplifyPathname { my($p) = $_[0]; $p =~ s@^/private/@/@; $p =~ s@//@/@g; $p =~ s@/\./@/@g; while ( $p =~ s@/[^/]+/\.\./@/@ ) { } #print STDERR "simplifyPathname $_[0] -> $p\n"; $p; } #print @ARGV, "\n"; @ldirs = ('.'); @lfiles = (); $outfile = 'a.out'; $gotLibs = 0; @argv = @ARGV; shift @argv; while ( $a = shift @argv ) { if ( $a =~ m/^-L(.*)$/ ) { push(@ldirs, $1); } elsif ( $a =~ m/^-l(.*)$/ ) { push(@lfiles, $1); $gotLibs ++; } elsif ( $a eq '-o' ) { $outfile = shift @argv; } } if ( $gotLibs ) { %dirs = (); $libs = "LIBS"; $deps = "Makefile.dependencies"; open(LIBS, ">$libs") || print STDERR "$0: cannot open $libs for writing: $!"; open(DEPS, ">$deps") || print STDERR "$0: cannot open $deps for writing: $!"; print DEPS "$outfile : "; foreach $lfile ( @lfiles ) { my($f); $f = simplifyPathname(expandSoftlink(findFile("lib" . $lfile . ".a", \@ldirs))); if ( ! $f ) { $f = simplifyPathname(expandSoftlink(findFile("lib" . $lfile . ".dylib", \@ldirs))); } if ( $f ) { print STDERR "lib $lfile $f\n"; print LIBS "lib $lfile $f\n"; print DEPS "\\\n $f "; $f =~ s@/[^/]*$@@; while ( $f =~ s@/NeXT_[^/]*obj$@@ ) { } $dirs{$f} ++; } else { print STDERR "$0: $lfile: not found\n"; } } print DEPS "\n\n"; close(LIBS); close(DEPS); $gdbinit = "gdbinit"; open(GDBINIT, ">$gdbinit") || print STDERR "$0: cannot open $gdbinit for writing: $!"; foreach $f ( keys(%dirs) ) { print GDBINIT "dir $f\n"; print STDERR "dir $f\n"; } close(GDBINIT); } #print STDERR "$0: ", join(" ", @ARGV), "\n"; exec(@ARGV); maks0.2/src/bin/ctocnl.c0100644000175200017560000000056406663227006015473 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_bin_ctocnl_c__ #define __rcs_id_bin_ctocnl_c__ static const char __rcs_id_bin_ctocnl_c[] = "$Id: ctocnl.c,v 1.2 1999/02/19 09:25:26 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include int main() { int c; while ( (c = getchar()) != EOF ) { putchar(c); if ( c == ';' ) putchar('\n'); } return 0; } maks0.2/src/bin/cvschrep.pl0100744000175200017560000000234707230344122016207 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cvschrep.pl,v 1.3 2001/01/14 15:40:02 stephens Exp $ # use File::Find; $debug = 1; $testing = 0; $keep_backup = 0; $filename = 'Repository'; $from = undef; $to = $undef; while ( @ARGV ) { $_ = shift; if ( /^--?r/ ) { $filename = 'Root'; } elsif ( /^--?d/ ) { ++ $debug; } elsif ( /^--?t/ ) { ++ $testing; } elsif ( ! defined $from ) { $from = $_; } elsif ( ! defined $to ) { $to = $_; last; } } sub wanted { my($file) = $File::Find::name; if ( $File::Find::name =~ m@/CVS/$filename$@o && -f ) { my($in, $out) = ( "$_.tmp", $_ ); my($line); print STDERR "wanted: '$File::Find::name'\n" if ( $testing || $debug ); if ( $testing ) { $in = $out; } else { die "$in exists" if ( -e $in ); system('mv', $out, $in); } open($in, "<$in") || die "$in: $!"; if ( ! $testing ) { open($out, ">$out") || die "$out: $!"; } while ( $line = <$in> ) { $line =~ s/\r//sg; if ( $line =~ s@$from@$to@i ) { print STDERR "$File::Find::name: $line"; } if ( ! $testing ) { print $out $line; } } close($in); if ( ! $testing ) { close($out); unlink($in) if ( ! $keep_backup ); } } } find(\&wanted, @ARGV); 1; maks0.2/src/bin/cvschroot.pl0100644000175200017560000000204606662641265016417 0ustar stephensstepheng#!/bin/perl # $Id: cvschroot.pl,v 1.3 1999/02/17 22:29:09 stephensk Exp $ # use File::Find; $debug = 1; $keep_backup = 0; $testing = 0; $delete = 1; #$from = shift; #$to = shift; sub wanted { my($file) = $File::Find::name; if ( $File::Find::name =~ m@/CVS/Root$@ && -f ) { my($in, $out) = ( "$_.tmp", $_ ); my($line); print STDERR "$0: '$File::Find::name'\n" if ( $testing || $debug ); if ( $testing ) { $in = $out; } else { die "$in exists" if ( -e $in ); system('mv', $out, $in); } if ( $delete ) { unlink($out) if ( ! $testing ); unlink($in) if ( ! $keep_backup ); } else { open($in, "<$in") || die "$in: $!"; if ( ! $testing ) { open($out, ">$out") || die "$out: $!"; } # while ( $line = <$in> ) { # if ( $line =~ s@^$from@$to@i ) { # print STDERR "$File::Find::name: $line"; # } # if ( ! $testing ) { # print $out $line; # } # } close($in); if ( ! $testing ) { close($out); unlink($in) if ( ! $keep_backup ); } } } } find(\&wanted, @ARGV); 1; maks0.2/src/bin/cvsclean0100644000175200017560000000054007003453703015552 0ustar stephensstepheng#!/bin/sh #$Id: cvsclean,v 1.1 1999/10/21 00:01:07 stephensk Exp $ #cvs() { # echo "cvs $@" #} files="" OIFS="$IFS" IFS="/" while read type file version date sticky do if [ -n "$file" ] then case "$type" in *) if [ ! -f "$file" ] then files="$files$file " fi ;; esac fi done < CVS/Entries IFS="$OIFS" cvs rm $files maks0.2/src/bin/cvsedited0100644000175200017560000000051307001176323015724 0ustar stephensstepheng#!/bin/sh # $Id: cvsedited,v 1.1 1999/10/13 21:42:43 stephensk Exp $ tmp=/tmp/$$.tmp set -x find \( -name 'CVS' -prune \) -o \( -type f -print \) "$@" | #> "$tmp" while read f do status="$(cvs status $f | egrep -e '^File: .*Status:')" case "$status" in *Locally*) echo "$f $status" ;; esac done rm -f "$tmp" maks0.2/src/bin/cvsfind.pl0100644000175200017560000000253507003453703016030 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cvsfind.pl,v 1.4 1999/10/21 00:01:07 stephensk Exp $ use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); print STDERR "@INC\n"; eval 'use ion::_cvs::find;'; ################################################################### $debug = 0; $testing = 0; $sep = "\t"; @print_entries = (); OPT: while ( ($_ = $ARGV[0]) && /^-/ ) { shift; s/^--?//; if ( $_ eq '' ) { last OPT; } elsif ( /^sep/ ) { $sep = shift; } else { FLAG: while ( $_ ne '' ) { if ( /^A/ ) { @print_entries = ( 0 .. $#ion::_cvs::entry::map ); last FLAG; } elsif ( s/^([a-zA-Z]+)$// ) { my $i = $ion::_cvs::entry::map{$1}; die "$1: unknown field: must be one of '@ion::_cvs::entry::map'" if ( ! defined $i ); push(@print_entries, $i); } elsif ( s/^([0-9]+)$// ) { push(@print_entries, $1); } else { last FLAG; } } } } @print_entries = ( 0 .. $#ion::_cvs::entry::map ) if ( ! @print_entries ); ########################################################### @entries = (); ion::_cvs::find(sub { push(@{$_[1]}, $_[0]) }, \@entries, @ARGV); @entries = sort { ($a->fullpath) cmp ($b->fullpath); } @entries; foreach $e ( @entries ) { print join($sep, map($e->[$_], @print_entries)), "\n"; } 1; maks0.2/src/bin/cvsretag.pl0100644000175200017560000000225106765647617016234 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cvsretag.pl,v 1.1 1999/09/09 06:11:27 stephensk Exp $ #use Carp; use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); eval 'use ion::_cvs::find;'; #eval 'use ion::_cvs::rlog;' || die "$!"; $opts = { }; while ( $_ = $ARGV[0], s/^--?// ) { shift; if ( s/^f([^=]*=)?// ) { $opts->{filter} = $1 ? $_ : shift; } elsif ( s/^s([^=]*=)?// ) { $opts->{show_rev_info} = $1 ? $_ : 1; } } my(@entries); ion::_cvs::find(sub {push(@{$_[1]}, $_[0]); }, \@entries, @ARGV); @entries = sort { $a->fullpath() cmp $b->fullpath() } @entries; my($OUTPUT); $OUTPUT = 'STDOUT'; $opts = {filter => '-h'}; $opts = {}; my($e); foreach $e ( @entries ) { if ( $e->isFile ) { print $e->repository, "\n"; my($rlog) = $e->rlog({}); use Data::Dumper; $Data::Dumper::Purity = 1; $Data::Dumper::Quotekeys = 1; print Dumper($rlog), "\n"; my($sym_name); foreach $sym_name ( @{$rlog->{symbolic_names}} ) { my($rev) = $rlog->{sym_name_to_rev}->{$sym_name}; if ( $rev && $sym_name =~ /^PUBLISH:/ ) { echo $e->repository, " $sym_name => $rev\n"; } } } } 1; maks0.2/src/bin/cvsrevhist.pl0100644000175200017560000000676307065620426016611 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cvsrevhist.pl,v 1.6 2000/03/21 07:13:26 stephensk Exp $ #use Carp; BEGIN { use File::Basename; use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); } use ion::_cvs::find; #eval 'use ion::_cvs::rlog;' || die "$!"; $opts = { }; $errors = 0; $opts->{collapse_comments} = 1; while ( $_ = $ARGV[0], s/^([-+])\1?// ) { my($pos) = $1 eq '-'; shift; if ( s/^f([^=]*=)?// ) { $opts->{filter} = $1 ? $_ : shift; } elsif ( s/^e([^=]*=)?// ) { $opts->{show_empty_entries} = $1 ? $_ : $pos; } elsif ( s/^c([^=]*=)?// ) { $opts->{collapse_comments} = $1 ? $_ : $pos; } elsif ( s/^x([^=]*=)?// ) { $opts->{auto_extend_rev_ranges} = $1 ? $_ : $pos; } elsif ( s/^s([^=]*=)?// ) { $opts->{show_rev_info} = $1 ? $_ : $pos; } } my(@entries); ion::_cvs::find(sub {push(@{$_[1]}, $_[0]); }, \@entries, @ARGV); @entries = sort { $a->fullpath() cmp $b->fullpath() } @entries; my($OUTPUT); $OUTPUT = 'STDOUT'; my($e); my($last_comments); ENTRY: foreach $e ( @entries ) { if ( $e->isFile ) { my($path) = $e->fullpath; $path =~ s@^\./@@; my($filter) = $opts->{filter}; if ( ! defined $filter ) { $filter = "-r:+"; } my($e_rev) = $e->revision; $filter =~ s/\+/$e_rev/g; my($rlog); # If a rev in a rev range does not exists, replace it with '' if ( $opts->{auto_extend_rev_ranges} ) { $rlog = $e->rlog(); if ( ! $rlog ) { $errors ++; next ENTRY; } if ( $filter =~ /-r(\S+)/ ) { my($b,$a) = ($`, $'); my($revs) = $1; if ( $revs =~ /^([^:]*):(.*)$/ ) { my($from, $to) = ($1, $2); if ( ! ($rlog->{revision}->{$from} || $rlog->{sym_name_to_rev}->{$from}) ) { #print STDERR "$path: no from rev '$from'\n"; $from = ''; } if ( ! ($rlog->{revision}->{$to} || $rlog->{sym_name_to_rev}->{$to}) ) { #print STDERR "$path: no to rev '$to'\n"; $to = ''; } $revs = $from . ':' . $to; my ($new_filter); $new_filter = $b . '-r' . $revs . $a; if ( $filter ne $new_filter ) { print STDERR "$path: filter = '$filter', new filter = '$new_filter'\n"; $filter = $new_filter; } } } # Redo log $e->clear_rlog(); } $rlog = $e->rlog({filter => $filter}); if ( ! rlog ) { $errors ++; next ENTRY; } if ( @{$rlog->{revisions}} || $opts->{show_empty_entries} ) { my($rev); if ( $opts->{show_rev_info} ) { print $OUTPUT "$path:\n"; foreach $rev ( @{$rlog->{revisions}} ) { my($r) = $rlog->{revision}->{$rev}; my($r_comments) = " " . join("\n ", split(/\n+/, $r->{comment})) . "\n"; print $OUTPUT " ", join(" ", map($r->{$_}, revision, date, author, state, lines), @{$r->{symbolic_names}}); print $OUTPUT ":\n"; print $OUTPUT $r_comments; } } else { my($comments) = ''; foreach $rev ( @{$rlog->{revisions}} ) { my($r) = $rlog->{revision}->{$rev}; my($r_comments) = " " . join("\n ", split(/\n+/, $r->{comment})) . "\n"; $comments .= $r_comments; } if ( $opts->{collapse_comments} ) { if ( $last_comments ne $comments ) { print $OUTPUT $last_comments, "\n" if ( defined $last_comments ); $last_comments = $comments; } print $OUTPUT $path, ":\n"; } else { print $OUTPUT $path, ":\n"; print $OUTPUT $comments, "\n"; } } } } } if ( $opts->{collapse_comments} ) { print $OUTPUT $last_comments, "\n" if ( defined $last_comments ); } exit($errors); 1; maks0.2/src/bin/cwfixlib.pl0100644000175200017560000000166106663227006016210 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cwfixlib.pl,v 1.2 1999/02/19 09:25:26 stephensk Exp $ sub run { print join(" ", @_), "\n"; system(@_) && die "$!: Could not run " . join(" ", @_); } $lib = shift @ARGV; print "lib = '$lib'\n"; $LIB = $ENV{'LIB'}; $LIB = 'f:/apps/dev/msvc20/bin/lib.exe' if ( ! defined($LIB) ); open(NM, "nm $lib|"); @members = (); @exports = (); while ( ) { chop; if ( /^(.*\.obj):$/ ) { push(@members, $1); } elsif ( /^([0-9]+)\s+T\s+_([a-zA-Z0-9_]+)/ ) { push(@exports, $2); } } close(NM); print "members = ", join(" ", @members), "\n"; print "exports = ", join(" ", @exports), "\n"; $def = $lib; $def =~ m@^([^\\/]+)\.lib$@; $def = "$1.def"; print "def = '$def'\n"; open(DEF, ">$def"); print DEF "EXPORTS\n"; foreach ( @exports ) { print DEF "$_\n"; } close(DEF); &run($LIB, '/LIST', $lib); foreach ( @members ) { s@.*[\\/]@@; &run( $LIB, $lib, "/extract:$_"); } exit(0); 1; maks0.2/src/bin/d2u.pl0100744000175200017560000000570207230344164015070 0ustar stephensstepheng#!/usr/bin/perl # $Id: d2u.pl,v 1.8 2001/01/14 15:40:36 stephens Exp $ use File::Find; $save_bak = 0; $dos2unix = 1; $force = 0; $recursive = 1; $try_pattern = '(^Makefile)|(\.([chlym][a-zA-Z]?|make?|gdb|[ck]?sh|p[lm]|ll|scm|def|tcl)$)'; $ignore_pattern = '\.(o|a|obj|lib|exe|com)$'; @files = (); ARG: while ( defined ($_ = shift @ARGV) ) { if ( s/^--?// ) { if ( /^[h?]/ ) { print STDERR qq~ Version: ~ . '$Id: d2u.pl,v 1.8 2001/01/14 15:40:36 stephens Exp $' . qq~ Options: -d[os2unix] Convert dos to unix. Default. -u[nix2dos] Convert unix to dos. -p The file matching pattern. Default: '$try_pattern'. -i The file ingore pattern. Default: '$ignore_pattern'. -r Process recursively. Default. -s Save a backup file. -f Force a conversion. -- End processing options. ~; exit(0); } elsif ( /^d(os2unix)?/ ) { $dos2unix = 1; next ARG; } elsif ( /^u(nix2dos)?/ ) { $dos2unix = 0; next ARG; } elsif ( /^p/ ) { $try_pattern = shift @ARGV; next ARG; } elsif ( /^i/ ) { $ignore_pattern = shift @ARGV; next ARG; } elsif ( /^s/ ) { $save_bak ++; next ARG; } elsif ( /^f/ ) { $force ++; next ARG; } elsif ( /^$/ ) { last ARG; } } # must be a file name push(@files, $_); } push(@files, @ARGV); sub translate { my($dir, $in) = @_; my($out, $mode, $t); if ( ! ( -f $in && -r && -w && -T) ) { return 1; } if ( $in =~ /^(RCS|SCCS|CVS)/i ) { return 1; } $out = "$in.bak"; print STDERR "translate $dir/$in\n"; die "$dir/$out already exists: $!" if ( -e $out ); rename($in, $out) || die "Cannot rename $dir/$in to $dir/$out: $!"; $t = $in; $in = $out; $out = $t; # Rename all dotted cap name to all lowercase if ( $out =~ m@^[A-Z0-9_/.]+\.[A-Z0-9_]+$@ ) { $out =~ y/A-Z/a-z/; } $mode = (stat($in))[2]; open(IN, "<$in") || die "Cannot read $dir/$in: $!"; binmode(IN); open(OUT, ">$out") || die "Cannot write $dir/$out: $!"; binmode(OUT); if ( $dos2unix ) { while ( defined ($t = ) ) { chomp $t; $t =~s/\r$//; print OUT $t, "\n"; } } else { while ( defined ($t = ) ) { chomp $t; $t =~s/\r$//; print OUT $t, "\r\n"; } } close(IN); close(OUT); print STDERR " $dir/$in -> $dir/$out\n"; chmod($out, $mode); unlink($in) if ( ! $save_bak ); 0; } sub wanted { #print STDERR "$0 $File::Find::dir/$_\n"; if ( /^(RCS|SCCS|CVS)/i || ! $recursive ) { $File::Find::prune = 1; return 0; } return 0 if ( -d $_ ); if ( $force || (($try_pattern eq '' || /$try_pattern/oi) && ! ($ignore_pattern ne '' && /$ignore_pattern/oi)) ) { translate($File::Find::dir, $_); } else { print STDERR "ignoring $File::Find::dir/$_\n"; } 0; } push(@files, '.') if ( ! @files ); find(\&wanted, @files); 1; maks0.2/src/bin/ecd0100644000175200017560000000130506662461243014517 0ustar stephensstepheng#!/bin/sh #set -x exe="$1" if [ -z "$MAKE" ] then MAKE="${DEV_ROOT}/src/maks/bin/mak" fi prompt=" $exe: Command: " help=" 'return' to compile and debug '$exe' 'q' to quit 'c' to 'make clean' 'r' to complie and run 'd' to delete '!' to run a command 'h' for help " echo -n "$prompt" while read x do read y echo "" case "$x" in h*) echo "$help" ;; c*) $MAKE clean ;; q*|x*) exit 0 ;; d*) rm "$exe.exe" ;; r*) $MAKE && "$exe.exe" ;; !*) echo -n "shell cmd: " read x read y eval $x ;; *) $MAKE && gdb "$exe.exe" -x "$exe.gdb" ;; esac echo "" echo -n "$prompt" done maks0.2/src/bin/fe0100644000175200017560000000027606662461244014365 0ustar stephensstepheng#!/bin/sh out="$1" shift filter="$1" shift for f in $* do cmd="$out '$f' | $filter | awk '/^[^:]+:/ { pre = "'$1'"; } { print "'"'$f':"'", pre, "'$0'"; }'" #echo "$cmd" eval $cmd done maks0.2/src/bin/findsource0100644000175200017560000000014706662461244016131 0ustar stephensstepheng#!/bin/sh find $* \( \( -name '*.rtf*' -o -name '*.nib' \) -prune -print \) -o \( \! -type d -print \) maks0.2/src/bin/igrep0100644000175200017560000001464606774727305015116 0ustar stephensstepheng#!/run/pd/prod/bin/perl # stephensk@acm.org sub usage { print STDERR 'igrep [-nlirwvtuh] ', "\n"; print STDERR ' Version 1.1', "\n"; print STDERR ' options:', "\n"; print STDERR ' -n print line numbers', "\n"; print STDERR ' -l print each filename once', "\n"; print STDERR ' -i case insensitive', "\n"; print STDERR ' -r match pattern as a regexpr, not as a word', "\n"; print STDERR ' -w match pattern as a word, not a regexpr (default)', "\n"; print STDERR ' -v verbose output', "\n"; print STDERR ' -t check if index is up to date', "\n"; print STDERR " -u use index file (default '$indexname')", "\n"; print STDERR " -h this help message", "\n"; exit 1; } &usage if ( @ARGV < 1 ); $indexname = ".mkindex"; $verbose = 0; $matchwords = 1; $regexp = 0; $linenumbers = 0; $listonly = 0; $caseinsensitive = ''; $timecheck = 0; $countlines = 0; while ( @ARGV ) { $arg = shift; $verbose ++ if ( $arg =~ /^-.*v/i ); $matchwords = 0 if ( $arg =~ /^-.*r/i ); $regexp = 1 if ( $arg =~ /^-.*w/i ); $linenumbers = 1 if ( $arg =~ /^-.*n/i ); $listonly = 1 if ( $arg =~ /^-.*l/i ); $caseinsensitive = '(?i)' if ( $arg =~ /^-.*i/i ); $timecheck = 1 if ( $arg =~ /^-.*t/i ); $indexfile = shift if ( $arg =~ /^-.*u/i ); $countlines = 1 if ( $arg =~ /^-.*c/i ); if ( $arg =~ m/^-(\?|h)/i ) { &usage; } else { $pattern = $arg; } } ##################################################################### # Create key and line regexps @subpatterns = grep(length($_), split(/[^_a-zA-Z]+/, $pattern)); $patternIsOneWord = $matchwords && (scalar @subpatterns) == 1 && $caseinsensitive eq '' && ! $regexp; if ( $matchwords ) { if ( ! (scalar @subpatterns) == 1 ) { $pattern =~ s@([_a-zA-Z][_a-zA-Z0-9]*)@(\\B$1\\B)@g; } if ( ! $regexp ) { $pattern =~ s@([.*+()|\\\[\]])@\\$1@g; } $keypattern = '(^' . join('$)|(^', @subpatterns) . '$)'; } else { $keypattern = join('|', @subpatterns); } $pattern = $caseinsensitive . $pattern; $keypattern = $caseinsensitive . $keypattern; print STDERR "patternIsOneWord = '$patternIsOneWord'\n" if ( $verbose ); print STDERR "pattern = '$pattern'\n" if ( $verbose ); print STDERR "keypattern = '$keypattern'\n" if ( $verbose ); ##################################################################### # locate and open index file $index = $indexname; while ( ! -r $index ) { $index = "../$index"; if ( length($index) > 64 ) { die "Cannot find $indexname"; } } print STDERR "index = '$index'\n" if ( $verbose ); open(INDEX, "<$index") || die "Cannot open $index for reading: $!"; $indexM = -M $index; # get the modification time ##################################################################### # Read version string $_ = ; chop; die "expected 'mkindex', found '$_'" if ( $_ !~ /^mkindex /); $version = (split(/ /, $_, 2))[1]; ##################################################################### # Read timestamp $_ = ; chop; die "expected 'timestamp', found '$_'" if ( $_ !~ /^timestamp / ); $timestamp = (split(/ /, $_, 2))[1]; ##################################################################### # Read file table $_ = ; chop; die "expected 'files', found '$_'" if ( $_ !~ /^files / ); $n = (split(/ /, $_, 2))[1]; $files[$n] = undef; # preextend @files = (); print STDERR "nfiles: $n " if ( $verbose ); while ( $n -- ) { $_ = ; chop; print STDERR "$0: warning: $_ is newer than $index\n" if ( $timecheck && -r && -M $_ < $indexM ); push(@files,$_); print STDERR "." if ( $verbose > 1 ); } print STDERR "\n" if ( $verbose ); $_ = ; chop; die "expected blank line" if ( $_ ne ''); print STDERR "files: ", join("\n", @files), "\n" if ( $verbose > 2 ); ##################################################################### # Read index and remember any locations for keys that match the pattern $_ = ; chop; die "expected 'keys', found '$_'" if ( $_ !~ /^keys /); $n = (split(/ /, $_, 2))[1]; print STDERR "nkeys: $n " if ( $verbose ); @keys_matched = (); %filesmatched = (); while ( $n -- ) { $_ = ; chop; ($key, $locs) = split(/ /, $_, 2); if ( $key =~ m/$keypattern/o ) { push(@keys_matched, $key); $lastlineno = -1; foreach $loc ( split(/ /, $locs) ) { ($fileno, $lineno, $pos) = split(/:/, $loc); if ( $lastlineno != $lineno ) { $filesmatched{$fileno} .= "$lineno:$pos "; print STDERR $files[$fileno], ":", $lineno, "\n" if ( $verbose > 2 ); } $lastlineno = $lineno; } print STDERR "*" if ( $verbose > 1 ); last if ( $patternIsOneWord ); } else { print STDERR "." if ( $verbose > 1 ); } } print STDERR " ", scalar @keys_matched, " keys matched\n" if ( $verbose ); print STDERR "keys matched: '", join("', '", @keys_matched), "'\n" if ( keys_matched && $verbose > 1); if ( ! $patternIsOneWord ) { $_ = ; chop; die "expected blank line" if ( $_ ne ''); } #print STDERR "keys: ", join("\n", sort(keys(%index))), "\n" if ( $verbose > 2 ); close(INDEX); ##################################################################### # %getline_cannotopen = (); $getline_FILE_file = ''; sub getline { # file, pos my ($file, $pos) = @_; my ($line); if ( $getline_FILE_file ne $file ) { $getline_FILE_file = $file; close(FILE); if ( ! open(FILE, "<$file") ) { print STDERR "$0: cannot open $file: $!\n" if ( ! $getline_cannotopen{$file} ++ ); return; } } while ( 1 ) { seek(FILE, $pos, 0); read(FILE, $line, 1); last if ( $line eq "\n" ); if ( -- $pos < 0 ) { seek(FILE, 0, 0); last; } } $line = ; chop $line; $line; } # Print each line no that matches sub numerically { $a <=> $b } $linematches = 0; FILE: foreach $fileno ( sort(keys(%filesmatched)) ) { $file = $files[$fileno]; $lastlineno = -1; %locs = (); foreach $loc ( split(/ /, $filesmatched{$fileno}) ) { ($lineno, $pos) = split(/:/, $loc); if ( $lastlineno != $lineno ) { $locs{$lineno} = $pos; } $lastlineno = $lineno; } foreach $lineno ( sort numerically (keys(%locs)) ) { if ( defined($line = &getline($file, $locs{$lineno})) ) { if ( $line =~ m/$pattern/o ) { $linematches ++; if ( $countlines ) { next FILE; } if ( $listonly ) { print $file, "\n"; next FILE; } print $file, ":"; print $lineno, ":" if ( $linenumbers ); print $line, "\n"; } } } } print $linematches, "\n" if ( $countlines ); exit(! $linematches); 0; maks0.2/src/bin/linkdups0100644000175200017560000000120706662461243015616 0ustar stephensstepheng#!/bin/sh find . -type f -print | sed 's!\./!!g' > /tmp/$$.names #cat /tmp/$$.names EXEC=echo EXEC= while read f1 do while read f2 do # `/bin/expr length "$f1"` -lt `/bin/expr length "$f2"` if [ "$f1" != "$f2" -a ! \( -h "$f1" -o -h "$f2" \) ] then if /bin/cmp -s "$f1" "$f2" then r2=`expr "$f2" : '\(.*/\).*' '|' "$f2"` r2=`echo "$r2" | sed 's@[^/]*/@../@g'` f1r="$r2$f1" #echo "f1=$f1 f2=$f2 f1r=$f1r" if [ "$f1r" != "$f2" ] then echo "$f2 -> $f1r" /bin/rm -f "$f2" /bin/ln -s "$f1r" "$f2" fi fi fi done < /tmp/$$.names done < /tmp/$$.names maks0.2/src/bin/locstatic0100644000175200017560000000253106662461244015754 0ustar stephensstepheng#!/bin/sh -- # -*- perl -*- eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; # print "$0: ", join(" ", @ARGV), "\n"; $pat = '\W(static\s+(id|\w+\s*\*)\s[^;(){}]*;)'; #$pat = '(static)'; sub scanFileForStatic { my($file) = @_; my($lineno,$s); #select(STDERR); $| = 1; select(STDOUT); #print STDERR "$file \r"; open(FILE,"<$file") || print STDERR "$0: cannot open $file for reading: $!\n"; $lineno = 0; while ( $lineno ++, $_ = ) { $s .= $_; while ( $s =~ s@$pat@@m ) { $s = $'; print "$file: $lineno: $1\n"; } } while ( $s =~ s@$pat@@m ) { $s = $'; print "$file: $lineno: $1\n"; } close(FILE); 0; } sub readDir { my($dirname) = @_; my(@dirlist); opendir(DIR,"$dirname") || print STDERR "$0: cannot open $dirname for reading: $!\n"; @dirlist = readdir(DIR); closedir(DIR); @dirlist = grep(!($_ eq '.' || $_ eq '..' || $_ eq 'SCCS' || $_ eq 'RCS'), @dirlist); # print STDERR "$0: ", join(" ", @dirlist), "\n"; @dirlist; } sub scanFiles { my(@files) = @_; my($f,$ff); foreach $f ( @files ) { if ( -d $f ) { foreach $ff ( readDir($f) ) { scanFiles("$f/$ff"); } } else { scanFileForStatic($f) if $f =~ m/\.[hmc]$/; } } 0; } # print "$0: ", join(" ", @ARGV), "\n"; scanFiles(@ARGV); 0; maks0.2/src/bin/lsup0100644000175200017560000000040306774730305014747 0ustar stephensstepheng#!/bin/sh # $Id: lsup,v 1.2 1999/09/30 18:49:41 stephensk Exp $ # stephensk@acm.org # if [ $# -eq 0 ] then set `pwd` fi while [ $# -gt 0 ] do f="$1" while [ -n "$f" ] do /bin/ls -lagd "$f" f=`/bin/expr "$f" : '\(.*\)/.*'` done shift done maks0.2/src/bin/mergefiles.pl0100644000175200017560000001452506663227006016526 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: mergefiles.pl,v 1.2 1999/02/19 09:25:26 stephensk Exp $ # Creates a shell script to merge two directories # based on file modification time and size. # Also generates diffs for files that do not have the same mod time and size # sub ignore_files { grep(! (/\.(o|obj|a|lib|dll|exe|core)$/ || /^\.saves/ || /^CYGWIN/ || /^pilot$/ || /~$/ ), @_); } sub cmd { print "@_\n"; } sub mkdir_p_ { my($dstp) = @_; $dstp =~ s@/[^/]+$@@; cmd("mkdir -p $dstp"); } sub rm_rf { cmd("rm -rf $_[0]"); } sub cp_rp { mkdir_p_($_[1]); cmd("cp -rp @_"); } sub _cp_rp { cmd("#cp -rp @_"); } sub date_str { my($s,$m,$h,$D,$M,$Y,$W,$YD,$dst) = gmtime($_[0]); $s = '0' . $s if ( $s < 10 ); $m = '0' . $m if ( $m < 10 ); $h = '0' . $h if ( $h < 10 ); $Y += 1900; $M ++; $M = '0' . $M if ( $M < 10 ); "$Y/$M/$D-$h:$m:$s"; } sub M_str { my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat($_[0]); date_str($mtime); } sub get_dir { my(@dir); opendir(DIR, $_[0]) || return ( 0, $! ); @dir = grep($_ ne '.' && $_ ne '..', readdir(DIR)); closedir(DIR); (1, @dir); } sub merge_paths { my(@p) = @_; my(@e) = map(-e $_, @p); my(@f) = map(-f $_, @p); my(@d) = map(-d $_, @p); my(@s) = map(-s $_, @p); my(@M) = map(-M $_, @p); my(@pd) = map((s@/[^/]+@@, $_), @_); my(@pM) = map(-M $_, @pd); my(@d0, @d1); my($delete, $choose) = ( 0, -1 ); #print STDERR "p = ", "@p", "\n"; #print STDERR "e = ", "@e", "\n"; #print STDERR "f = ", "@f", "\n"; #print STDERR "d = ", "@d", "\n"; #print STDERR "s = ", "@s", "\n"; #print STDERR "M = ", "@M", "\n"; if ( ! $e[0] && ! $e[1] ) { # Both do not exist return; } elsif ( $e[0] && ! $e[1] ) { # d0/f0 exists and d1/f1 does not exists # if d0 is older than d1 if ( $pM[0] < $pM[1] ) { cmd("# $p[1] does not exist and $pd[0] is newer than $pd[1]"); $choose = 2; $delete = 1; } else { cmd("# $p[1] does not exist"); $choose = 1; } } elsif ( ! $e[0] && $e[1] ) { if ( $pM[1] < $pM[0] ) { cmd("# $p[0] does not exist and $pd[1] is newer than $pd[0]"); $choose = 1; $delete = 1; } else { cmd("# $p[0] does not exist"); $choose = 2; } } elsif ( $f[0] && $f[1] ) { if ( $M[0] < $M[1] ) { cmd("# $p[0] is newer than $p[1]"); $choose = 1; } elsif ( $M[0] > $M[1] ) { cmd("# $p[1] is newer than $p[0]"); $choose = 2; } elsif ( $s[0] == $s[1] ) { cmd("# $p[0] is the same time and size as $p[1]"); return; } } elsif ( $d[0] && $d[1] ) { my(@d0, @d1); my($f, $f_last); @d0 = get_dir($p[0]); shift @d0; #print STDERR "d0 = @d0\n"; @d1 = get_dir($p[1]); shift @d1; #print STDERR "d1 = @d1\n"; push(@d0, @d1); @d0 = ignore_files(sort(@d0)); F: foreach $f ( @d0 ) { next F if ( $f_last eq $f ); $f_last = $f; merge_paths($p[0] . "/" . $f, $p[1] . "/" . $f); } return; } else { cmd("#!!!! $p[0] is a " . $d[0] ? "dir" : "file" . ", $p[1] is a " . $d[1] ? "dir" : "file"); } my $get_cmd = $choose == -1; while ( $get_cmd ) { print STDERR join("\t", "1[", $p[0], $s[0], M_str($p[0]), "]"), "\n"; print STDERR join("\t", "2[", $p[1], $s[1], M_str($p[1]), "] :", $choose), " > "; $_ = ; chop; $choose = $1 if ( /([0-9]+)/ ); $delete = /d/; if ( $choose == 3 ) { system("diff -r $p[0] $p[1]"); } else { $get_cmd = 0 if ( $choose != -1 ); } } if ( $choose == 0 ) { $get_cmd = 0; } else { $choose --; if ( $delete ) { rm_rf($p[$delete - 1]); } else { cp_rp($p[$choose], $p[1 - $choose]); } } } sub merge_paths3 { # p0, p1, mp my(@p) = @_; my(@e) = map(-e $_, @p); my(@f) = map(-f $_, @p); my(@d) = map(-d $_, @p); my(@s) = map(-s $_, @p); my(@M) = map(-M $_, @p); my(@pd) = map((s@/[^/]+@@, $_), @_); my(@pM) = map(-M $_, @pd); my(@d0, @d1); my($delete, $choose) = ( 0, -1 ); #print STDERR "p = ", "@p", "\n"; #print STDERR "e = ", "@e", "\n"; #print STDERR "f = ", "@f", "\n"; #print STDERR "d = ", "@d", "\n"; #print STDERR "s = ", "@s", "\n"; #print STDERR "M = ", "@M", "\n"; if ( ! $e[0] && ! $e[1] ) { # Both do not exist } elsif ( $e[0] && ! $e[1] ) { # d0/f0 exists and d1/f1 does not exists # if d0 is older than d1 cmd(""); if ( $pM[0] < $pM[1] ) { cmd("# $p[1] does not exist and $pd[0] is newer than $pd[1]"); } else { cmd("# $p[1] does not exist"); } cp_rp($p[0], $p[2]); } elsif ( ! $e[0] && $e[1] ) { cmd(""); if ( $pM[1] < $pM[0] ) { cmd("# $p[0] does not exist and $pd[1] is newer than $pd[0]"); } else { cmd("# $p[0] does not exist"); } cp_rp($p[1], $p[2]); } elsif ( $f[0] && $f[1] ) { cmd(""); if ( $M[0] < $M[1] ) { cmd("# $p[0] is newer than $p[1]"); $choose = 0; } elsif ( $M[0] > $M[1] ) { cmd("# $p[1] is newer than $p[0]"); $choose = 1; } elsif ( $s[0] == $s[1] ) { cmd("# $p[0] is the same time and size as $p[1]"); $choose = 0; cp_rp($p[$choose], $p[2]); return; } cp_rp($p[$choose], $p[2]); _cp_rp($p[1 - $choose], $p[2]); # Do a diff $tmp = "$$.diff"; $cmd = "diff -cd \"$p[1 - $choose]\" \"$p[$choose]\""; system("$cmd > \"$tmp\""); $choose = 0; open(F, "<$tmp"); while ( $_ = ) { chop; if ( ! $choose ) { cmd("# $cmd "); $choose = 1; } cmd("# $_"); } close(F); cmd("##############################################") if ( $choose ); unlink($tmp); } elsif ( $d[0] && $d[1] ) { my(@d0, @d1); my($f, $f_last); my($errors) = 0; @d0 = get_dir($p[0]); if ( ! shift @d0 ) { print STDERR "$p[0]: ", @d0; $errors ++; } else { shift @d0; } @d1 = get_dir($p[1]); if ( ! shift @d1 ) { print STDERR "$p[1]: ", @d1; $errors ++; } if ( $errors ) { return; } push(@d0, @d1); @d0 = ignore_files(sort(@d0)); F: foreach $f ( @d0 ) { next F if ( $f_last eq $f ); $f_last = $f; merge_paths3($p[0] . "/" . $f, $p[1] . "/" . $f, $p[2] . "/" . $f); } } else { cmd(""); cmd("#!!!! $p[0] is a " . $d[0] ? "dir" : "file" . ", $p[1] is a " . $d[1] ? "dir" : "file"); } } cmd("#!/bin/sh"); cmd("# $0 " . join(" ", @ARGV)); cmd("set -x"); #if ( $#ARGV == 3 ) { merge_paths3(@ARGV); #} else { # merge_paths(@ARGV); #} 1; maks0.2/src/bin/mkindex0100644000175200017560000000365506774727305015445 0ustar stephensstepheng#!/run/pd/prod/bin/perl # stephensk@acm.org $version = 1.1; $indexname = $index = ".mkindex"; $verbose = 0; while ( @ARGV ) { $arg = shift; $verbose ++ if ( $arg =~ /^-.*v/ ); } # open the index file open(INDEX, ">$index") || die "Cannot open $index for writing: $!"; $INDEX = "INDEX"; # get a list of files from stdin @files = (); while ( <> ) { chop; s@^\./@@; push(@files,$_) if ( -r && -T && ! m@(^|/)$indexname$@o ); } %index = (); print STDERR "$0: indexing ", (scalar @files), " files: " if ( $verbose ); $nentries = 0; $fileindex = -1; foreach ( @files ) { $fileindex ++; $lineno = 0; $pos = 0; open(FILE, "<$_") || next; $nkeys = 0; while ( $line = ) { print STDERR "$line\n" if ( $verbose > 1 ); $lineno ++; while ( $line =~ m/([_a-zA-Z][_a-zA-Z0-9]*)/g ) { $linepos = $pos + (pos $line) - length($1); $index{$1} .= "$fileindex:$lineno:$linepos "; print STDERR "$fileindex:$lineno:$linepos " if ( $verbose > 2 ); $nkeys ++; $nentries ++; } $pos += length($line); } close(FILE); print STDERR "$nkeys " if ( $verbose > 1 ); print STDERR "." if ( $verbose ); } print STDERR "\n" if ( $verbose ); ##################################################################### # Create a unique list of keys @keys = sort(keys(%index)); print STDERR "$0: ", scalar @keys, " unique keys, $nentries citations\n" if ( $verbose ); ##################################################################### # Write version string print $INDEX "mkindex $version\n"; # Write timestamp print $INDEX "timestamp ", time, "\n"; # Write file table print $INDEX "files ", scalar @files, "\n"; print $INDEX join("\n", @files); print $INDEX "\n\n"; # Write index print $INDEX "keys ", scalar @keys, "\n"; foreach ( sort(keys(%index)) ) { print $INDEX "$_ $index{$_}\n"; } print $INDEX "\n\n"; close(INDEX); ##################################################################### 0; maks0.2/src/bin/mvr.pl0100644000175200017560000000331307001176324015172 0ustar stephensstepheng#!/usr/bin/perl use File::Find; package mvr; sub wanted { my($dir) = $File::Find::dir; my($old, $new); $old = $new = $_; print STDERR "$dir/$old\n" if ( $mvr::verbose > 1 ); if ( &mvr::match($new) ) { if ( $mvr::interactive ) { print STDERR "mv $dir/$old $dir/$new? [y] "; my($line); $line = ; return 0 if ( $line !~ /y/i ); } print STDERR "mv $dir/$old $dir/$new\n" if ( $mvr::verbose || $mvr::debug ); if ( ! $mvr::debug ) { my($tmp) = "$new.$$"; die "$dir/$tmp exists" if ( -e $tmp ); rename($old, $tmp) || die "mv $dir/$old $dir/$tmp failed: $!"; rename($tmp, $new) || print STDERR "mv $dir/$old $dir/$new: $!\n"; } } 0; } sub mvr { $mvr::debug = 0; $mvr::verbose = 1; $mvr::interactive = 0; while ( defined ($_ = shift @_) ) { if ( s/^--?// ) { while ( s/i(nteractive)?// ) { $mvr::interactive ++; } while ( s/d(ebug)?// ) { $mvr::debug ++; } while ( s/v(erbose)?// ){ $mvr::verbose ++; } if ( s/[h?]// ) { print STDERR qq~ $0 [-dvi] FROM TO Rename all files that match regexpr FROM to TO under the current directory. Options: -d[ebug] Enable debugging, does not actually rename. -i[interactive] Interactive; prompts on stderr for confirmation. -v[erbose] Enable verbose messages. -?|-h[elp] This help message. ~; return 1; } } else { $o = $_; $n = shift @_; if ( defined $n ) { print STDERR "mvr $o $n\n" if ( $verbose ); eval 'sub mvr::match { $_[0] =~ s/^' . $o . '$/' . $n . '/; }'; File::Find::find(\&wanted, '.'); } } } 0; } #print STDERR "$0\n"; if ( $0 =~ m@/mvr.pl$@ ) { mvr(@ARGV); } 1; maks0.2/src/bin/nmlibs0100644000175200017560000000042706662461243015254 0ustar stephensstepheng#!/bin/sh if [ -z "$LIBDIRS" ] then LIBDIRS="/lib /usr/lib" fi LIBDIRS="$* $LIBDIRS" for d in $LIBDIRS do (cd $d for f in lib*.a *.o do nm -gp "$f" | awk ' BEGIN { name = "'$d/$f'"; } /^.*:/ { name = "'$d'/" $1; } { print name, $0, "\n"; }' done ) done maks0.2/src/bin/nmm0100755000175200017560000000010006662461243014546 0ustar stephensstepheng#!/bin/sh for f do nm "$f" | awk '{ print "'$f'", $0; }' done maks0.2/src/bin/objcsyms0100644000175200017560000000457306662461244015630 0ustar stephensstepheng#!perl $tmp || ($tmp = $ENV{'TEMP'}); $tmp || ($tmp = $ENV{'TMP'}); $tmp || ($tmp = '/tmp/'); $symbols = (); $nm = '/bin/nm'; $dumpbin = 'dumpbin'; if ( -e $nm ) { # NeXT eval q@ $libprefix = 'lib'; $libsuffix = '.a'; $frameworksuffix = ''; sub refsym { $v && print STDERR "$0: refsym: $_[0]\n"; print C 'asm(".reference ', $_[0], '");', "\n"; } sub do_ObjC_symbols { open(F,"$nm -gp $_ |") || die "$!: cannot read $_"; while ( ) { if ( /\s+[ATDB]\s+(.objc_(class|category)_name_[a-zA-Z0-9_]+)/ ) { &refsym($1); } } close(F); } @; } else { # WinNT eval q@ $libprefix = ''; $libsuffix = '.lib'; $frameworksuffix = '.lib'; sub refsym { $v && print STDERR "$0: refsym: $_[0]\n"; print C 'asm(".global ', $_[0], '");', "\n"; } sub do_ObjC_symbols { open(F,"$dumpbin /symbols /exports $_ |") || die "$!: cannot read $_"; while ( ) { if ( /\s+External\s+(.objc_(class|category)_name_[a-zA-Z0-9_]+)/ ) { &refsym($1); } } close(F); } @; } @libs = (); @libpaths = ("/usr/lib", "/lib"); @frameworkpaths = ("$NEXT_ROOT/LocalLibrary/Frameworks", "$NEXT_ROOT/NextLibrary/Frameworks"); sub findinpath { $f = shift @_; while ( $_ = shift @_ ) { $ft = $_ . '/' . $f; $v && print "$0: try: $ft\n"; if ( -e $ft ) { $v && print "$0: found: $ft\n"; return $ft; } } 0; } $ObjC = 0; $v = 0; $cf = "$tmp$$.c"; while ( $_ = shift @ARGV ) { push(@args, $_); if ( /^-(o|b|V|include|imacros|idirafter|iprefix|iwithprefix)$/ ) { shift @ARGV; } elsif ( /^-ObjC(++)?$/ ) { $ObjC ++; push(@args, $cf); } elsif ( /^-v$/ ) { $v ++; } elsif ( /^-L(.+)$/ ) { push(@libpaths, $1); } elsif ( /^-l(.+)$/ ) { if ( $ft = &findinpath("$libprefix$1$libsuffix", @libpaths) ) { push(@libs, $ft); } } elsif ( /^-F(.+)$/ ) { push(@frameworkpaths, $1); } elsif ( /^-framework$/ ) { push(@args, $_ = shift @ARGV); if ( $ft = &findinpath("$_.framework/$_$frameworksuffix", @frameworkpaths) ) { push(@libs, $ft); } } } if ( $ObjC ) { open(C,">$cf") || die "$!: cannot create $cf"; &refsym('_main'); # force linking foreach ( @libs ) { &do_ObjC_symbols(); } close(C) || die "$!: cannot close $cf"; push(@args, $cf); } else { $cf = 0; } $v && print STDERR join(" ", @args), "\n"; $errors = system(@args) / 256; $cf && unlink($cf); exit $errors; 1; #PERLEND maks0.2/src/bin/publish.pl0100644000175200017560000004341507306137336016053 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: publish.pl,v 1.10 2001/06/02 10:09:00 stephens Exp $ # TO DO # * Fix problems with non "../" REQUIRES_PKGS # ############################################################################## use Carp; use File::Basename; use Cwd; # fastgetcwd use Cwd 'fast_abs_path'; $progdir = fast_abs_path(dirname($0)); push(@INC, $progdir, "$progdir/lib/perl"); eval 'use ion::_cvs::revhist;'; ############################################################################## $time = time(); { my($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime($time); $sec = '0' . $sec if ( $sec < 10 ); $min = '0' . $min if ( $min < 10 ); $hour = '0' . $hour if ( $hour < 10 ); $mon ++; $mon = '0' . $mon if ( $mon < 10 ); $mday = '0' . $mday if ( $mday < 10 ); $year += 1900; $timestr = "$year/$mon/$mday $hour:$min:$sec"; } ############################################################################## $tmp_root = "/usr/tmp"; $tmp_root = fast_abs_path($tmp_root); $tmp = "$tmp_root/t" . abs($$); mkdir($tmp, 0777) || die "$!: $tmp"; sub END { #print STDERR "in END\n"; system("rm", "-rf", $tmp) if ( $tmp ); } ############################################################################## $sep = '=' x 78; sub basename { my($x) = @_; $x =~ s@^.*[/\\]@@; $x; } sub dirname { my($x) = @_; #print STDERR "dirname('$x') = "; if ( $x !~ s@[/\\][^/\\]+$@@ ) { $x = '.'; } #print STDERR "'$x'\n"; $x; } sub absname { my($x) = @_; #print STDERR "absname('$x') = "; if ( $x !~ m@^([a-zA-Z]:)?[/\\]@ ) { $x = fastgetcwd() . '/' . $x; } #print STDERR "'$x'\n"; $x; } sub unix_path { my($x) = @_; #print STDERR "unix_path('$x') = "; $x =~ y@\\@/@; $x !~ s@^([a-zA-Z]):@//$1@; #print STDERR "'$x'\n"; $x; } sub mkdirs { my($p, $m) = @_; if ( ! defined($m) ) { $m = 0777; } if ( -d $p ) { 1; } else { my($pdir) = dirname($p); if ( ! -d $pdir ) { mkdirs($pdir, $m); } mkdir($p, $m); } } sub appendFileToHandle { my($in,$OUT) = @_; open(__F, "<$in"); while ( $in = <__F> ) { print $OUT $in; } close(__F); } sub readFile { my($r, $l); open(__F, "<$_[0]") || return; $r = ''; while ( $l = <__F> ) { $r .= $l; } close(__F); $r; } sub copyFile { my($src, $dst) = @_; my($l); open($src, "<$src") || die "$src: $!:"; open($dst, ">$dst") || die "$dst: $!:"; while ( $l = <$src> ) { print $dst $l; } close($src); close($dst); } sub readVars { my($file, $vars, $stopAtEmptyLine) = @_; $vars = {} if ( ! $vars ); open(F, "<$file") || return; LINE: while ( $_ = ) { chop; s/^\s+//; s/\s+$//; if ( /^\s*#/ ) { next LINE; } if ( $_ eq '' && $stopAtEmptyLine ) { last LINE; } my($key, $value) = (undef, undef); # KEY if ( s/^\s*([A-Za-z_0-9]+)// ) { $key = $1; # ='VALUE' if ( m/^\s*=\s*'([^']*)'\s*$/ ) { #' $value = $1; # ="VALUE" } elsif ( m/^\s*=\s*"([^"]*)"\s*$/ ) { #" $value = $1; # =VALUE } elsif ( m/^\s*=(.*)$/ ) { $value = $1; # [ ]VALUE } elsif ( m/^\s?(.*)$/ ) { $value = $1; } else { print STDERR "$0: unparsed line in $file: $key $_\n"; } } if ( defined($key) && defined($value) ) { $value =~ s/^\s+//; $value =~ s/\s+$//; $vars->{$key} = $value; } } close(F); $vars; } sub readPKG { my($pkg); $pkg = {}; $pkg->{src} = $_[0]; $pkg->{src_abs} = fast_abs_path($pkg->{src}); $pkg->{src_name} = basename($pkg->{src_abs}); $pkg->{src_dir} = dirname($pkg->{src_abs}); # Defaults $pkg->{NAME} = $pkg->{src_name}; $pkg->{README} = "README"; $pkg->{VERSION} = readFile("$pkg->{src}/VERSION"); $pkg->{VERSION} =~ y/\n/ /; $pkg->{VERSION} =~ s/^\s+//; $pkg->{VERSION} =~ s/\s+$//; $pkg->{CVSLOG} = 'CVSLOG'; $pkg->{DESC} = ''; $pkg->{CATEGORY} = ''; $pkg->{REQUIRES_PKGS} = ''; $pkg->{REQUIRES_OTHERS} = ''; $pkg->{MAKE} = 'make'; $pkg->{MAKE_CLEAN} = 'clean veryclean'; $pkg->{subpkgs} = []; $pkg->{parent} = $pkg; $pkg->{root} = $pkg; readVars("$pkg->{src}/PKG", $pkg); die "Package $pkg->{src} has no NAME" if ( $pkg->{NAME} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no VERSION\n" if ( $pkg->{VERSION} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no CATEGORY\n" if ( $pkg->{CATEGORY} eq '' ); print STDERR " WARNING: $pkg->{src_abs} has no DESC\n" if ( $pkg->{DESC} eq '' ); $pkg; } sub parsePkg { my($pkg, @more) = @_; my($pcwd); # Determine the copy dst $pkg->{dst} = $pkg->{root}->{dst_root} . "/" . $pkg->{src_name}; # Attempt to cd into package $pcwd = getcwd(); chdir($pkg->{src}) || die "chdir: $!: $pkg->{src}"; # Don't visit a package more than once if ( $pkg->{root}->{parsed}->{$pkg->{src_abs}} ) { return; } $pkg->{root}->{parsed}->{$pkg->{src_abs}} ++; # Add package to parent and root push(@{$pkg->{parent}->{subpkgs}}, $pkg); push(@{$pkg->{root}->{subpkgs_flat}}, $pkg); # Collect the other pkgs #print STDERR "REQUIRES_OTHERS='$pkg->{REQUIRES_OTHERS}'\n"; @others = split(/\s+/, $pkg->{REQUIRES_OTHERS}); $pkg->{others} = [ @others ]; # Add others to root foreach $r ( @others ) { $pkg->{root}->{others_map}->{$r} ++; } @{$pkg->{root}->{others_flat}} = sort(keys(%{$pkg->{root}->{others_map}})); # Collect subpkgs foreach $r ( split(/\s+/, $pkg->{REQUIRES_PKGS}), @more ) { my($subpkg) = readPKG($r); $subpkg->{parent} = $pkg; $subpkg->{root} = $pkg->{root}; parsePkg($subpkg); } # chdir($pcwd) || die "chdir: $!: $pcwd"; } sub copyPkg { my($rpkg) = @_; my($pkg); foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Copy the package into the dst area print STDERR " Copying $pkg->{src_abs} $pkg->{dst}\n"; mkdirs($pkg->{dst}, 0777); $src = unix_path($pkg->{src_abs}); $dst = unix_path($pkg->{dst}); system("sh -c '$tar -C $src -cf - . | $tar -C $dst -x${tar_verbose}f -'") && die "tar: $!"; print STDERR " Copying $pkg->{src_abs} $pkg->{dst}: DONE\n\n"; } } sub cleanPkg { my($rpkg) = @_; my($pkg); foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Clean up the dst area if ( -r "$pkg->{dst}/Makefile" ) { print STDERR " Cleaning $pkg->{dst}\n"; $dst = unix_path($pkg->{dst}); system("sh -c 'cd $dst && eval $pkg->{MAKE} __DISABLE_DEPS__=YES $pkg->{MAKE_CLEAN}'"); print STDERR " Cleaning $pkg->{dst}: DONE\n\n"; } } } sub commitPkg { my($rpkg) = @_; my($pkg); if ( defined($CVSROOT) ) { foreach $pkg ( @{$rpkg->{subpkgs_flat}} ) { # Clean up the dst area if ( -d "$pkg->{dst}/CVS" ) { my($msg, $cmd); # Commit print STDERR " Committing $pkg->{dst}\n"; $msg = "PUBLISH_$rpkg->{NAME}$rpkg->{VERSION}"; $cmd = "$CVS commit -m \"$msg\" $pkg->{dst}"; print STDERR " $cmd\n"; system($cmd) && die "$cmd"; print STDERR " Committing $pkg->{dst}: DONE\n\n"; # Tag $msg = "PUBLISH_$rpkg->{NAME}$rpkg->{VERSION}"; $msg =~ tr/A-Za-z0-9_/_/c; print STDERR " Tagging $pkg->{dst} as $msg\n"; $cmd = "$CVS tag "; $cmd .= "-F " if ( $force ); $cmd .= "-c $msg $pkg->{dst}"; print STDERR " $cmd\n"; system($cmd) && die "$cmd"; print STDERR " Tagging $pkg->{dst} as $msg: DONE\n\n"; # Log #print STDERR " Logging CVS versions $pkg->{dst}\n"; #$cmd = "$CVS log -h -N -r$msg $pkg->{dst} > $pkg->{dst}/$pkg->{CVSLOG}"; #print STDERR " $cmd\n"; #system($cmd) && die "$cmd"; #print STDERR " Logging CVS versions $pkg->{dst}: DONE\n\n"; } } } } sub createPkgFiles { my($rootpkg) = @_; foreach $pkg ( @{$rootpkg->{subpkgs_flat}} ) { # Append README $file = "$pkg->{dst}/$pkg->{README}"; if ( $pkg->{README} ne '' && -r $file ) { print dst_README "$pkg->{NAME} $pkg->{VERSION} README\n"; print dst_README "$sep\n"; appendFileToHandle($file, 'dst_README'); } # Append PUB { my(%x); %x = %$pkg; $x{SRC_DIR} = $x{src_abs}; foreach $k ( NAME, VERSION, CATEGORY, DESC, SRC_DIR ) { print PUB $k, " ", $x{$k}, "\n"; delete $x{$k}; } foreach $k ( sort(grep(/^[A-Z_0-9]+$/, keys(%x))) ) { print PUB $k, " ", $x{$k}, "\n"; } print PUB "\n"; } } foreach $r ( @{$rootpkg->{others_flat}} ) { print PUB "OTHER $r\n\n"; } } sub createPkg { my $pkg; $pkg = readPKG($_[0]); print STDERR "Publishing $_[0]\n"; $dst_name = "$pkg->{src_name}$pkg->{VERSION}"; $dst_dir = "$tmp/$dst_name"; $dst_root = "$dst_dir/src"; mkdirs($dst_root, 0777) || die "$dst_root: $!"; $pkg->{dst_root} = $dst_root; $pkg->{parsed} = {}; $pkg->{others_map} = {}; $pkg->{subpkgs_flat} = []; $pkg->{others_flat} = []; ######################################################################### # Recursively parse packages parsePkg($pkg); ######################################################################### # Copy the entire package copyPkg($pkg); ######################################################################### # Clean the entire package cleanPkg($pkg); ######################################################################### # CVS commit the entire package commitPkg($pkg); ######################################################################### # The files we are going to publish $filev = $pkg->{src_name} . $pkg->{VERSION}; $txt = "$PUBLISH_DIR/$filev.txt"; $archive = "$PUBLISH_DIR/$filev.tgz"; $pub = "$PUBLISH_DIR/$filev.pub"; ######################################################################### # Init PUB file die "$pub already exists, try -force option" if ( -f $pub && ! $force ); open(PUB, ">$pub") || die "$pub: $!"; print PUB "NAME $pkg->{NAME}\n"; print PUB "VERSION $pkg->{VERSION}\n"; print PUB "CATEGORY $pkg->{CATEGORY}\n"; print PUB "DESC $pkg->{DESC}\n"; @subpkg_names = map($_->{NAME}, @{$pkg->{subpkgs_flat}}); print PUB "CONTAINS_PKGS ", join(' ', @subpkg_names), "\n"; print PUB "REQUIRES_OTHERS ", join(' ', @{$pkg->{others_flat}}), "\n"; print PUB "DATE $timestr\n"; #print PUB "MD5 $\n"; print PUB "README $txt\n"; print PUB "ARCHIVE $archive\n"; print PUB "\n"; ################################################################## # Init README, TOC files $dst_README = "$dst_dir/README"; open(dst_README, ">$dst_README") || die "$dst_README: $!"; print dst_README "$pkg->{NAME} $pkg->{VERSION} README\n"; print dst_README "$sep\n\n"; ################################################################## # Add GUM_BUILD_ROOT $GUM_BUILD_ROOT = "$pkg->{src_abs}/../GUM_BUILD_ROOT"; if ( -r $GUM_BUILD_ROOT ) { copyFile($GUM_BUILD_ROOT, "$dst_dir/src/GUM_BUILD_ROOT"); } ################################################################## # Add copyright $COPYRIGHT = "$pkg->{src_abs}/../COPYRIGHT"; if ( -r $COPYRIGHT ) { copyFile($COPYRIGHT, "$dst_dir/COPYRIGHT"); } appendFileToHandle($COPYRIGHT, dst_README); print dst_README "\n$sep\n\n"; ################################################################## # Add license $LICENSE = "$pkg->{src_abs}/../LICENSE"; if ( -r $LICENSE ) { copyFile($LICENSE, "$dst_dir/LICENSE"); appendFileToHandle($LICENSE, dst_README); print dst_README "\n$sep\n\n"; } ################################################################## # Create CHANGES $dst_CHANGES = "$dst_dir/CHANGES"; print STDERR " Creating CHANGES $dst_CHANGES\n"; open(dst_CHANGES, ">$dst_CHANGES") || die "$dst_CHANGES: $!"; print dst_CHANGES "$pkg->{NAME} $pkg->{VERSION} CHANGES\n"; print dst_CHANGES "$sep\n\n"; close(dst_CHANGES); my($save_cwd) = getcwd; chdir($dst_dir) || die "$dst_dir: $!"; if ( $pkg->{CHANGES_RELEASES} ) { my(@rels) = split(/\s+/, $pkg->{CHANGES_RELEASES}); @rels = map( "PUBLISH_" . $pkg->{NAME} . $_, @rels); @rels = grep( (tr/a-zA-Z0-9_/_/c, 1), @rels); push(@rels, ''); #print STDERR "rels = '", join("' '", @rels), "'\n"; #exit -1; my($r1, $r2); $r2 = shift(@rels); while ( $r1 = $r2, defined($r2 = shift(@rels)) ) { open(dst_CHANGES, ">>$dst_CHANGES") || die "$dst_CHANGES: $!"; print dst_CHANGES "\n$sep\nChanges from release '$r2' to '$r1'\n"; print dst_CHANGES "$sep\n\n"; close(dst_CHANGES); print STDERR " Changes from release '$r2' to '$r1'\n"; $cmd = "perl $progdir/cvsrevhist.pl -f=-r$r2:$r1 . >> $dst_CHANGES"; print STDERR "$cmd\n"; system("sh -c '$cmd'") && die "$cmd: $!"; } } else { $cmd = "perl $progdir/cvsrevhist.pl . >> $dst_CHANGES"; system("sh -c '$cmd'") && die "$cmd: $!"; } chdir($save_cwd) || die "$save_cwd: $!"; print STDERR " Created CHANGES $dst_CHANGES: DONE\n\n"; ################################################################## # Create TOC $dst_TOC = "$dst_dir/TOC"; print STDERR " Creating TOC $dst_TOC\n"; open(dst_TOC, ">$dst_TOC") || die "$dst_TOC: $!"; print dst_TOC "$pkg->{NAME} $pkg->{VERSION} Table of Contents\n"; print dst_TOC "$sep\n"; close(dst_TOC); # Use ls -lagR system("sh -c 'cd $tmp && ls -lagR $dst_name >> $dst_TOC'"); # Fill in the pkg files createPkgFiles($pkg); # Close output files close(PUB); close(dst_README); print STDERR " Created TOC $dst_TOC: DONE.\n\n"; ######################################################################## # Create the external readme print STDERR " Creating README $txt\n"; open(TXT, ">$txt"); appendFileToHandle($dst_README, TXT); print TXT "$sep\n\n"; print dst_TOC "$pkg->{NAME} $pkg->{VERSION} Package Info\n"; print TXT "$sep\n\n"; appendFileToHandle($pub, TXT); print TXT "$sep\n\n"; appendFileToHandle($dst_CHANGES, TXT); print TXT "$sep\n\n"; appendFileToHandle($dst_TOC, TXT); print TXT "$sep\n\n"; close(TXT); print STDERR " Created README $txt: DONE.\n\n"; ######################################################################## # Create archive and finish TOC print STDERR " Creating $pkg->{NAME} archive $archive\n"; system("sh -c '$tar -C $tmp -c${tar_verbose}f - $dst_name | $gzip -9 > $archive'"); print STDERR " Created $pkg->{NAME} archive $archive: DONE.\n\n"; ######################################################################## # Remove the temp directory system("rm", "-rf", $dst_dir); print STDERR "Publishing $_[0]: DONE\n\n"; } ############################################################################## # tar, gzip $tar = 'tar'; $tar_verbose = 'v'; $tar_verbose = ''; $gzip = 'gzip'; # cvs $CVSROOT = $ENV{CVSROOT}; $CVS = $ENV{CVS}; $CVS = 'cvs.exe' if ( ! defined($CVS) ); $PUBLISH_DIR = $ENV{PUBLISH_DIR}; $PUBLISH_DIR = 'd:/data/ion/www/research/pub' if ( ! $PUBLISH_DIR ); ############################################################################## # Parse arguments @pkgs = (); $index = 0; $reldir = ""; $force = 0; while ( $_ = shift @ARGV ) { if ( /^-?-i/ ) { $index = shift; } elsif ( /^-?-f/ ) { $force ++; } elsif ( /^-?-p/ ) { $PUBLISH_DIR = shift; } elsif ( /^-?-r/ ) { $reldir = shift; } else { push(@pkgs, $_); } } ############################################################################## # Create each package foreach $pkg ( @pkgs ) { createPkg($pkg); } ############################################################################## # Create package index sub size_str { "(" . (-s $_[0]) . " bytes)"; } if ( $index ) { #Pkgs by CATEGORY %c = (); if ( $reldir ne '' && $reldir !~ m@[/\\]$@ ) { $reldir .= '/'; } # Read each published pkg's data file foreach $pub ( glob("$PUBLISH_DIR/*.pub") ) { my($pkg) = readVars($pub, undef, 1); # Arrange by CATEGORY $pkg->{CATEGORY} = "UNKNOWN-CATEGORY" if ( $pkg->{CATEGORY} eq '' ); $pkg->{DESC} = "No Description Available. See README." if ( ! $pkg->{DESC} ); $pkg->{pub} = $pub; $pkg->{pub_file} = basename($pub); if ( ! defined($c{$pkg->{CATEGORY}}) ) { $c{$pkg->{CATEGORY}} = [ ]; } push(@{$c{$pkg->{CATEGORY}}}, $pkg); } @cats = sort(keys(%c)); # Open the index file open(INDEX, ">$index") || die "$index: $!"; # List the cats print INDEX "

Package Categories

\n"; print INDEX "
    \n"; $ci = 0; foreach $cat ( @cats ) { $ci ++; print INDEX qq@
  • $cat\n@; } print INDEX "
\n"; # Print each cat $ci = 0; foreach $cat ( @cats ) { $ci ++; print INDEX qq@

$cat

\n@; print INDEX "
\n"; foreach $pkg ( sort { $a->{NAME} cmp $b->{NAME} || $b->{VERSION} <=> $a->{VERSION} } @{$c{$cat}} ) { my($NAME) = uc($pkg->{NAME}); my($VERSION) = $pkg->{VERSION}; my($DESC) = $pkg->{DESC}; my($ARCHIVE) = basename($pkg->{ARCHIVE}); my($README) = basename($pkg->{README}); print INDEX qq@
$NAME $VERSION
$DESC\n@; print INDEX qq@
Date: $pkg->{DATE}\n@; print INDEX qq@
Requires: $pkg->{REQUIRES_OTHERS}\n@ if ( $pkg->{REQUIRES_OTHERS} ne '' ); print INDEX qq@
View README @ . &size_str($pkg->{README}) . "\n"; print INDEX qq@
View package info @ . &size_str($pkg->{pub}) . "\n"; print INDEX qq@
Download $ARCHIVE @ . &size_str($pkg->{ARCHIVE}) . "\n"; print INDEX qq@
\n@; } print INDEX "
\n"; } print INDEX "
\n"; # Close the index file close(INDEX); print STDERR "Created index $index\n"; } 1; maks0.2/src/bin/sci0100644000175200017560000000561506662461244014553 0ustar stephensstepheng#!/bin/sh #set -x #exec=/bin/echo exec= force= y='Checkpoint' fs= tarfs= cmd="$1" opts="" shift while /bin/test $# -gt 0 do f="$1" shift case "$f" in -TEST) exec=/bin/echo opts="$opts $f" ;; -f) force=1 opts="$opts $f" ;; -y) y="$1" shift ;; SCCS) ;; .) /bin/ls SCCS | /bin/sed -e '/^s\./!d' -e 's@^s\.@@' | /usr/bin/xargs -n1024 $0 "$cmd" $opts -y "$y" ;; */*) (cd `/bin/expr "$f" : '\(.*\)/.*'` && $0 "$cmd" $opts -y "$y" `/bin/expr "$f" : '.*/\(.*\)'`) ;; *) if /bin/test -d "$f" then if /bin/test -f "SCCS/s.$f.tar" then f="$f.tar" fs="$fs $f" else /bin/ls "$f" | (cd "$f" && /usr/bin/xargs -n1024 $0 "$cmd" $opts -y "$y") fi else fs="$fs $f" fi ;; esac done case "$cmd" in get|ci|edit|editopen|update) _fs="$fs"; fs="" for f in $_fs do if /bin/test -f "SCCS/s.$f" then fs="$fs $f" if /bin/test -n "$force" then /bin/chmod -w "$f" fi else echo "$f: no SCCS/s.$f" fi done ;; esac case "$cmd" in create|ci|edit|editopen|update) _fs="$fs"; fs="" for f in $_fs do if /bin/test -f "SCCS/p.$f" then echo "$f: SCCS/p.$f exists:" `cat SCCS/p.$f` else fs="$fs $f" fi done ;; esac for f in $fs do case "$f" in *.tar) tarfs="$tarfs $f" ;; esac done case "$cmd" in ci|delget|delta|create) for f in $tarfs do d=`/usr/bin/basename $f .tar` $exec /bin/rm -f "$f" $exec /bin/chmod -Rf ugo+wr "$d" $exec tar -cvf - "$d" > "$f" done ;; esac case "$cmd" in ci|create) _fs="$fs"; fs="" for f in $_fs do if /bin/test -r "$f" then fs="$fs $f" else echo "$f: not readable" fi done ;; esac if /bin/test -n "$fs" then case "$cmd" in update) set +x for f in $fs do sf="SCCS/s.$f" /usr/bin/find "$sf" -newer "$f" -print done | /bin/sed -e 's@^SCCS/s\.@@' | /usr/bin/xargs -n1024 $0 get $opts ;; ci|cie) for f in $fs do $exec /bin/mv "$f" "$f.sci.$$" done $exec scc edit $fs for f in $fs do $exec /bin/mv "$f.sci.$$" "$f" done $exec /bin/chmod +w $fs if /bin/test "$cmd" = "cie" then $exec scc deledit "-y$y" $fs else $exec scc delget "-y$y" $fs fi $exec /bin/date > 'CheckpointDate' ;; create|delget|deledit) $exec scc $cmd "-y$y" $fs ;; get|unedit|prs|diffs) $exec scc $cmd $fs ;; co|edit|editopen) $exec scc edit $fs ;; *) /bin/echo "$0: $cmd: bad command" ;; esac case "$cmd" in get|co|edit|create) for f in $tarfs do d=`/usr/bin/basename $f .tar` $exec /bin/rm -rf "$d" $exec tar -xvf "$f" $exec /bin/chmod -Rf ugo+wr "$d" done ;; esac case "$cmd" in editopen) $exec open -a Edit $fs ;; esac fi exit 0 maks0.2/src/bin/scip0100644000175200017560000000640006662461244014724 0ustar stephensstepheng#!/run/thirdParty/perl5/bin/perl eval 'exec /run/thirdParty/perl5/bin/perl $0 ${1+"$@"}' if 0; $exec = 0; $y = 'Checkpoint'; @fs = (); @tarfs = (); sub _exec { if ( $exec ) { system(@_); } else { print STDERR @_, "\n"; } } sub warning { print STDERR "$0: ", @_, "\n"; } sub getdir { my($dir) = $_[0]; my(@filenames); opendir(DIR,$dir) || (warning "Can't open $dir: $!\n", return); @filenames = readdir(DIR); closedir(DIR); grep(($_ ne '.' && $_ ne '..'), @filenames); } sub sfile { ( $_[0] =~ m/^(.*/)([^/]+)$/ ) ? "$1SCCS/$_[1].$2" : "SCCS/$_[1].$_[0]"; } sub dofile { if ( -d ) { if ( -f &sfile("$_.tar", 's') ) { $_ .= '.tar'; push(@fs, $_); } else { } } else { push(@fs, $_); } } $cmd = shift; while ( shift ) { if ( $_ eq '-TEST' ) { $exec = 0; } elsif ( $_ eq '-y' ) { $y = shift; } elsif ( $_ eq 'SCCS' || $_ eq 'RCS' ) { } elsif ( $_ eq '.' ) { my(@x) = &getdir('SCCS'); grep((s/^s.//, 1), @x); push(@ARGV, @x); } elsif ( m@/@ ) { } else { if ( -d ) { if ( -f &sfile_("$_.tar", 's') ) { $_ .= '.tar'; push(@fs, $_); } else { $d = $_; for ( &getdir($d) ) { &dofile("$d/$_"); } } } else { push(@fs, $_); } } } if ( $cmd =~ m/^(get|ci|edit|editopen|update)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { $sf = &sfile($_, 's'); if ( -f $sf ) { push(@fs, $_); } else { &warning("$_: no $sf"); } } } if ( $cmd =~ m/^(create|ci|edit|editopen|update)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { if ( -f &sfile($_, 'p') ) { &warning("$_: is under edit"); } else { push(@fs, $_); } } } @tarfs = (); for ( @fs ) { if ( m/\.tar$/ ) { push(@tarfs, $_); } } if ( $cmd =~ m/^(ci|delget|delta|create)$/ ) { for ( @tarfs ) { m@^(.*)\.tar$@; $d = $1; &_exec('/bin/rm', '-f', $_); &_exec('/bin/chmod', '-Rf', 'ugo+wr', $d); &_exec("tar -cvf - $d > $_"); } } if ( $cmd =~ m/^(ci|create)$/ ) { @_fs = @fs; @fs = (); for ( @_fs ) { if ( -r $_ ) { push(@fs, $_); } else { &warning("$_: not readable"); } } } if ( @fs ) { if ( $cmd eq 'update' ) { for ( @fs ) { $sf = &sfile($_, 's'); if ( (-M $sf) > (-M $_) ) { &warning("$_: is out of date with $sf"); } } } elsif ( $cmd =~ m/^(ci|cie)$/ ) { for ( @fs ) { &_exec('/bin/mv', $_, "$f.sci.$$"); } &_exec('scc', 'edit', @fs); for ( @fs ) { &_exec('/bin/mv', "$f.sci.$$", $_); } &_exec('/bin/chmod', '+w', @fs); &_exec('scc', ( $cmd eq 'cie' ? 'deledit' : 'delget' ), "-y$y", @fs); #$exec /bin/date > 'CheckpointDate' } elsif ( $cmd =~ m/^(create|delget|deledit)$/ ) { &_exec('scc', $cmd, "-y$y", @fs); } elsif ( $cmd =~ m/^(get|unedit)$/ ) { &_exec('scc', $cmd, @fs); } elsif ( $cmd =~ m/^(co|edit|editopen)$/ ) { &_exec('scc', 'edit', @fs); } else { &warning("$cmd: bad command"); } if ( $cmd =~ m/^(get|co|edit|create)$/ ) { for ( @tarfs ) { m@^(.*)\.tar$@; $d = $1; &_exec('/bin/rm', '-rf', $d); &_exec("tar", '-xvf', $_); &_exec('/bin/chmod', '-Rf', 'ugo+wr', $d); } } } 1; maks0.2/src/bin/si0100644000175200017560000000013407001136307014362 0ustar stephensstepheng#!/bin/sh #set -x echo '#include "'"$1"'"' | gcc -E - | awk 'NF' | egrep -v -e '^#' | less maks0.2/src/bin/split.c0100644000175200017560000000450606663227006015344 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_bin_split_c__ #define __rcs_id_bin_split_c__ static const char __rcs_id_bin_split_c[] = "$Id: split.c,v 1.2 1999/02/19 09:25:26 stephensk Exp $"; #endif #endif /* __rcs_id__ */ #include #include /* malloc(), free() */ #include /* strlen(), strcpy(), strcat(), strcmp() */ static char *progname; #ifdef BC #include /* O_BINARY */ #include #endif static int dofile(unsigned long fsize, FILE *in, const char *name) { char *fname; int fn; int rtnval = 0; fname = malloc(sizeof(fname[0]) * (strlen(name) + 5)); fn = 0; do { FILE *out; unsigned long bytes_left; { char buf[5]; sprintf(buf, ".%03d", (int) fn ++); strcpy(fname, name); strcat(fname, buf); if ( (out = fopen(fname, "wb")) == 0 ) { fprintf(stderr, "%s: cannot open \"%s\" for writing\n", progname, fname); rtnval = -1; goto rtn; } } bytes_left = fsize; while ( bytes_left ) { int c; if ( (c = getc(in)) == EOF ) { fclose(out); rtnval = 0; goto rtn; } else { putc(c, out); bytes_left --; } } fclose(out); } while ( 1 ); rtn: free(fname); return rtnval; } int main(int argc, char **argv) { int i; char *outname = 0; unsigned long fsize = 1440000UL; int rtnval = 0; progname = argv[0]; #ifdef BC _fmode = O_BINARY; #endif for ( i = 1; i < argc; i ++ ) { if ( argv[i][0] == '-' ) { switch ( argv[i][1] ) { case 's': fsize = atol(argv[i][2] ? argv[i] + 2 : argv[++ i]); break; case 'o': outname = argv[i][2] ? argv[i] + 2 : argv[++ i]; break; default: fprintf(stderr, "%s: bad option \"%s\"\n", progname, argv[i]); break; } } else { FILE *in; char *inname = argv[i]; if ( strcmp(inname, "-") == 0 ) { in = stdin; } else if ( (in = fopen(inname, "rb")) == 0 ) { fprintf(stderr, "%s: cannot open \"%s\" for reading\n", progname, inname); rtnval ++; } if ( outname == 0 ) { char *p; outname = malloc(sizeof(outname[0]) * (strlen(inname) + 2)); strcpy(outname, inname); if ( (p = strrchr(outname, '.')) ) { *p = '\0'; } else { strcat(outname, "."); } } rtnval += dofile(fsize, in, outname); if ( in != stdin ) fclose(in); } } return rtnval; } maks0.2/src/bin/tgz0100744000175200017560000000445607230344242014572 0ustar stephensstepheng#!/bin/sh # $Id: tgz,v 1.6 2001/01/14 15:41:22 stephens Exp $ #set -x if [ -z "$TAR" ] then TAR=tar fi if [ -z "$GZIP" ] then GZIP=gzip fi if [ -z "$BZIP" ] then BZIP=bzip2 fi if [ -z "$BUNZIP" ] then BUNZIP=bunzip2 fi if [ -z "$GUNZIP" ] then GUNZIP="$GZIP -d" fi if [ -z "$COMPRESS" ] then COMPRESS=compress fi c= C=. o= tv= s=.tgz x=x #set -x while [ $# -gt 0 ] do case "$1" in -c) c=1 ;; -o) o="$2" shift ;; -s) s="$2" shift ;; -C) C="$2" shift ;; -*) case "$1" in -*t*) tv="${tv}t" x= ;; esac case "$1" in -*v*) tv="${tv}v" ;; esac ;; *) if [ -d "$1" -o -n "$c" ] then d=`expr "$1" : '\(.*\)/[^/]*' '|' '.'` f=`expr "$1" : '.*/\([^/]*\)' '|' "$1"` if [ -z "$o" ] then o="$f$s" fi case "$o" in *.tb2|*.TB2|*.tar.bz2|*_tar.bz2|*_TAR.BZ2) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && $BZIP -9 > '$o')" ;; *.tgz|*.TGZ|*.tar.gz|*_TAR.GZ) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && $GZIP -9 > '$o')" ;; *.tar|*.TAR|*.gtar|*.GTAR) cmd="(cd $d && $TAR -c${tv}f - '$f' ) | (cd '$C' && cat - > '$o')" ;; *.gz|*.GZ|*.gzip|*.GZIP) cmd="(cd $d && $GZIP -9 -c '$f' ) | (cd '$C' && cat - > '$o')" ;; *.bz|*.BZ|*.bz2|*.BZ2) cmd="(cd $d && $BZIP -9 -c '$f' ) | (cd '$C' && cat - > '$o')" ;; esac echo $cmd eval $cmd o= elif [ -f "$1" ] then if [ -z "$o" ] then o="." fi if [ ! -d "$o" ] then mkdir "$o" fi case "$1" in *.tgz|*.tar.gz|*.TGZ|*.tz|*.TZ) cmd="$GUNZIP < '$1' | (cd '$o' && $TAR -$x${tv}f -)" ;; *.tbz|*.TBZ|*.tar.b2|*.tb2|*.TB2|*_tar.bz2|*_TAR.BZ2) cmd="$BUNZIP -d -c -k '$1' | (cd '$o' && $TAR -$x${tv}f -)" ;; *.bz|*.BZ) cmd="$BUNZIP -d -k '$1'" ;; *.gz|*.GZ) cmd="$GUNZIP -d -c < '$1'" ;; *.tar|*.TAR|*.gtar|*.GTAR) cmd="(cd '$o' && $TAR -$x${tv}f -) < '$1'" ;; *) echo "$0: $1: unknown suffix" 1>&2 cmd="" ;; esac if [ -n "$cmd" ] then echo $cmd eval $cmd fi o= x=x else : fi ;; esac shift done maks0.2/src/bin/ts0100644000175200017560000000316707065620573014423 0ustar stephensstepheng#!/bin/sh set -x action="$1" shift [ -z "$GDB" ] && GDB='gdb' target=gdb files='' while [ $# -gt 0 ] do case "$1" in -t) target="$2" shift; ;; *=*) eval "$1" ;; *) files="$files $1" ;; esac shift done for f in $files do pre='cat -' post='' gdbx='' run_in_db() { _app="$1"; shift gdbx="/tmp/gdbx" echo "#Created by $0: DO NOT MODIFY" > $gdbx echo "break main" >> $gdbx echo "run $*" >> $gdbx $GDB $_app -x $gdbx rm $gdbx } case "$target" in *gdb*) _APP="${APP}" gdbx="/tmp/gdbx" echo "#Created by $0: DO NOT MODIFY" > $gdbx do_line() { case "$line" in \#*) echo "$line" >> $gdbx ;; run*) echo "shell echo '$line'" >> $gdbx echo "$line" >> $gdbx echo 'shell echo Hit return' >> $gdbx echo 'shell read line' >> $gdbx ;; *=*) eval "$line" ;; *) echo "shell echo '$line'" >> $gdbx eval echo "shell '$line'" >> $gdbx ;; esac } post='$target $APP -x $gdbx' ;; *time*) do_line() { echo "$line" case "$line" in \#*) ;; *=*) eval "$line" ;; *) eval "$line" ;; esac } run() { eval time $APP "$@" code=$? echo "=== $APP $@: terminated with $code" if [ $code -ne 0 ] then run_in_db $APP "$@" fi } ;; *) echo "$0: unknown target '$target'" 1>&2 ;; esac eval $pre < "$f" | while read line do do_line done [ -n "$gdbx" -a -r "$gdbx" ] && cat $gdbx eval $post donemaks0.2/src/bin/uud0100744000175200017560000000417207262415712014564 0ustar stephensstepheng#!/bin/perl # # scans files for a uuencoded items in files and decodes them to $dir # and adds a line to $db based on the Subject: lines found # $count = 0; $subject = ''; $dir = shift || die("Specify an output directory"); $db = "$dir/images.txt"; @files = (); %subjects = (); %files = (); $again = 0; while ( $again || defined($_ = <>) ) { $again = 0; chop; if ( s/^Subject:\s+// ) { $subject = $_; } elsif ( /^begin\s+(\S+)\s+(\S+)/ ) { $mode = $1; $file = $2; print STDERR "File: $file, Subject: $subject\n"; if ( $file ne '' ) { $str = ''; $nlines = 0; while ( defined($_ = <>) ) { $nlines ++; if ( $nlines % 100 ) { print STDERR "$nlines lines...\r"; } last if /^end/; if ( /^Subject:\s+/ || /^begin\s+(\S+)\s+(\S+)/ ) { print STDERR "WARNING: found $_"; $again ++; last; } next if /[a-z]/; next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4); $str .= unpack('u', $_); } # Remove dir from $file name $file =~ s@^.*/@@; # Add .jpg suffix if needed $file .= "_" . ($count ++) . ".jpg" if ( $file !~ /\.jpg$/ ); # Give it an orignal name if ( 0 ) { while ( -f "$dir/$file" ) { $file =~ s/_([0-9]+)(\.[^\.]+)$//; $suffix = $1; $file .= ($count ++) . $suffix; } } # If the file doesn't already exist if ( ! -f "$dir/$file" ) { # Add an entry to the index push(@files, $file); while ( defined($files{$subject}) ) { $subject =~ s/_([0-9]+)$//; $subject .= '_' . ($1 + 1); } $subjects{$file} = $subject; $files{$subject} = $file; # print "file = $file, mode = $mode, subject = $subject\n"; # Write the file open(F, ">$dir/$file"); binmode(F); print F $str; close(F); #exit(0); } } } } #Append to db $exists = -r $db; open(INDEX, ">>$db"); binmode(INDEX); print INDEX "Filename\tSubject\n" if ( ! $exists ); foreach $file ( sort(@files) ) { $subject = $subjects{$file}; print INDEX "$file\t$subject\n"; } close(INDEX); ########################################################################## 1; maks0.2/src/bin/uudindex0100744000175200017560000000711507262415713015615 0ustar stephensstepheng#!/bin/perl # Creates a html index for stuff in $dir listed by $db # Run this after uud. # $dir = shift || "images"; $db = "$dir.txt"; $_html = '.html'; ########################################################################## @fieldnames = (); @fields = (); @records = (); @files = (); %subjects = (); %files = (); #Read db open(INDEX, "<$db"); binmode(INDEX); # First record is the field names $_ = ; chop; @fieldnames = split("\t", $_); $fieldindex = 0; foreach $fieldname ( @fieldnames ) { $fieldindex{$fieldname} = $fieldindex ++; } while ( ) { chop; @fields = split("\t", $_); push(@records, [ @fields ]); } close(INDEX); #Create index.html $menu = "menu_" . $fieldnames[0] . $_html; open(INDEX, ">$dir/index$_html"); binmode(INDEX); print INDEX qq@ None <BODY> <CENTER> This frameset document contains: <UL> <LI> <A HREF="$menu">Menu</A></LI> </UL> </BODY> @; close(INDEX); #Create blank.html open(INDEX, ">$dir/blank$_html"); binmode(INDEX); print INDEX q@ None @; close(INDEX); sub add_suffix { my($x,$s) = @_; $x =~ s/\.[^.]+$//; $x .= $s; $x; } #Create menus $fieldindex = -1; foreach $fieldname ( @fieldnames ) { $fieldindex ++; $menu = "menu_$fieldname$_html"; open(INDEX, ">$dir/$menu"); binmode(INDEX); print INDEX qq~ None ~; # Put a record to select a different column sorting print INDEX qq~~; foreach $fname ( @fieldnames ) { print INDEX qq~~; foreach $field ( @$record ) { print INDEX qq~
$fname~; } print INDEX "\n"; # Sort by Filename and create htmls for each file $fieldindex = $fieldindex{'Filename'}; @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $image = $record->[0]; $HREF = add_suffix($record->[0], $_html); $prev = $ri > 0 ? add_suffix($records[$ri - 1]->[0], $_html) : undef; $next = $ri <= $#records ? add_suffix($records[$ri + 1]->[0], $_html) : undef; print STDERR "HREF='$HREF', image='$image', prev='$prev', next='$next'\n"; exit(1); if ( $HREF ) { open(HREF,">$HREF") || die "Cannot write '$HREF'"; print HREF qq~ None
$record->[1]

~; if ( $prev ) { print HREF qq~PREV $prev\n~; } if ( $next ) { print HREF qq~NEXT $next\n~; } print HREF qq~


$image\n~; print HREF qq~
~; close(HREF); } } # Sort by current field @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $HREF = add_suffix($record->[0]. $_html); print INDEX qq~
$field~; } print INDEX "\n"; } print INDEX qq~

~; close(INDEX); } 1; maks0.2/src/bin/which0100644000175200017560000000113606662461244015071 0ustar stephensstepheng#!/bin/sh #set -x pathchar=':' if expr index "$PATH" ';' > /dev/null then pathchar=';' fi oIFS="$IFS" for f in ${1+"$@"} do IFS="$pathchar" for d in ${PATH} do IFS="$oIFS" b="$d/$f" t="$b" if [ -x "$t" ] then echo "$f: $t" continue 2 fi t="$b.bat" if [ -x "$t" ] then echo "$f: $t" continue 2 fi t="$b.com" if [ -x "$t" ] then echo "$f: $t" continue 2 fi t="$b.exe" if [ -x "$t" ] then echo "$f: $t" continue 2 fi done echo "$f: not found" done IFS="$oIFS" maks0.2/src/bin/whichall0100644000175200017560000000014306662461244015557 0ustar stephensstepheng#!/bin/sh for d in `echo $PATH|tr ':' ' '` do if [ -x $d/$1 ] then echo "$d/$1" fi done maks0.2/src/bin/wwwsend0100644000175200017560000000336106662461243015466 0ustar stephensstepheng#!/bin/sh # Copyright 1998-1999 Kurt A. Stephens http://www.acm.org/~stephensk # # This script sends an entire directory tree via ftp # It only sends the files that have changed since the last send # by keeping a timestamp file around (wwwsend.ts) # #set -x dat=./wwwsend.dat ldir=www dryrun= override= timestamp= findopts= while [ $# -gt 0 ] do case "$1" in -dryrun) dryrun=1 ;; *=*) override="$override$1;" ;; *) dat="$1" ;; esac shift done echo "$0: Reading $dat" [ -n "$override" ] && eval $override cwd="`pwd`" . $dat || exit 1 [ -n "$override" ] && eval $override cwd="`pwd`" #ldir=$(cd $ldir && pwd) #echo "ldir=$ldir" #exit # Run make if it has a Makefile if [ -f $ldir/Makefile ] then echo "$0: Making $ldir ..." (cd $ldir && make) echo "$0: done."; fi # ftp script: open, login and set binary script=$$.tmp echo "$0: Creating ftp script $script"; cat >$script <>$script # ftp script: copy files [ -z "$timestamp" ] && timestamp="$cwd/wwwsend.ts" [ -f "$timestamp" ] && findopts="-newer '$timestamp' $findopts" (set -x; cd $ldir && eval find . -type f $findopts -print) | while read f do d=`dirname $f` echo "cd $rdir/$d" echo "put $f" done >>$script # ftp script: close and quit cat >>$script <> $timestamp # Cleanup rm $script echo "$0: done." maks0.2/src/bin/addcr.t/0040755000175200017560000000000007236675451015372 5ustar stephensstephengmaks0.2/src/bin/addcr.t/CVS/0040755000175200017560000000000007236675451016025 5ustar stephensstephengmaks0.2/src/bin/addcr.t/CVS/Root0100644000175200017560000000003407236675451016665 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/addcr.t/CVS/Repository0100644000175200017560000000003107236675451020116 0ustar stephensstephenghome/ion/src/bin/addcr.t maks0.2/src/bin/addcr.t/CVS/Entries0100644000175200017560000000006107236675451017353 0ustar stephensstepheng/run/1.1/Wed Feb 17 23:02:18 1999// D/backup//// maks0.2/src/bin/addcr.t/run0100644000175200017560000000021706662645172016115 0ustar stephensstepheng#!/bin/sh # Test script for addcr # $Id: run,v 1.1 1999/02/17 23:02:18 stephensk Exp $ # set -x rm t[0-9]* cp backup/* . perl ../addcr t[0-9]* maks0.2/src/bin/addcr.t/backup/0040755000175200017560000000000007236675451016637 5ustar stephensstephengmaks0.2/src/bin/addcr.t/backup/CVS/0040755000175200017560000000000007236675451017272 5ustar stephensstephengmaks0.2/src/bin/addcr.t/backup/CVS/Root0100644000175200017560000000003407236675451020132 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/addcr.t/backup/CVS/Repository0100644000175200017560000000004007236675451021363 0ustar stephensstephenghome/ion/src/bin/addcr.t/backup maks0.2/src/bin/addcr.t/backup/CVS/Entries0100644000175200017560000000023307236675451020621 0ustar stephensstepheng/t1.c/1.2/Fri Feb 19 09:25:27 1999// /t2/1.1.1.1/Wed Feb 17 06:33:08 1999// /t3/1.1.1.1/Wed Feb 17 06:33:08 1999// /t4/1.2/Wed Feb 17 23:02:19 1999/-kb/ D maks0.2/src/bin/addcr.t/backup/t1.c0100644000175200017560000000040406663227007017313 0ustar stephensstepheng #ifndef __rcs_id__ #ifndef __rcs_id_backup_t1_c__ #define __rcs_id_backup_t1_c__ static const char __rcs_id_backup_t1_c[] = "$Id: t1.c,v 1.2 1999/02/19 09:25:27 stephensk Exp $"; #endif #endif /* __rcs_id__ */ L1 /* @COPYRIGHT@ Blah ** @COPYRIGHT END@ */ L2 maks0.2/src/bin/addcr.t/backup/t20100644000175200017560000000002406662461244017073 0ustar stephensstepheng#!/bin/sh #L1 L2 L3 maks0.2/src/bin/addcr.t/backup/t30100644000175200017560000000005106662461244017074 0ustar stephensstepheng#!/usr/local/bin/scheme ; L1 L2 L3 maks0.2/src/bin/addcr.t/backup/t40100644000175200017560000000057306662645173017113 0ustar stephensstephengLèV.textD+Üâ» `.data ,bý|@À.bss€À.stab,% 1:+R.stabstrÆ‹LVRopportobj_writePortbooleanU‰å¡‹P‰ÐÁøƒø~¡‹P‰ÐÁøƒøëèè‰Â‰ÐëÉÃ#f#t‰öU‰åƒìS¡‰Eü‹Eü‹‹J‰ÊÁúJý‹ˉ]ø‹Eü‹Â‹ maks0.2/src/bin/lib/0040755000175200017560000000000007236675451014621 5ustar stephensstephengmaks0.2/src/bin/lib/CVS/0040755000175200017560000000000007236675451015254 5ustar stephensstephengmaks0.2/src/bin/lib/CVS/Root0100644000175200017560000000003407236675451016114 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/lib/CVS/Repository0100644000175200017560000000002507236675451017350 0ustar stephensstephenghome/ion/src/bin/lib maks0.2/src/bin/lib/CVS/Entries0100644000175200017560000000001307236675451016577 0ustar stephensstephengD/perl//// maks0.2/src/bin/lib/perl/0040755000175200017560000000000007236675451015563 5ustar stephensstephengmaks0.2/src/bin/lib/perl/CVS/0040755000175200017560000000000007236675451016216 5ustar stephensstephengmaks0.2/src/bin/lib/perl/CVS/Root0100644000175200017560000000003407236675451017056 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/lib/perl/CVS/Repository0100644000175200017560000000003207236675451020310 0ustar stephensstephenghome/ion/src/bin/lib/perl maks0.2/src/bin/lib/perl/CVS/Entries0100644000175200017560000000001207236675451017540 0ustar stephensstephengD/ion//// maks0.2/src/bin/lib/perl/ion/0040755000175200017560000000000007236675451016350 5ustar stephensstephengmaks0.2/src/bin/lib/perl/ion/CVS/0040755000175200017560000000000007236675451017003 5ustar stephensstephengmaks0.2/src/bin/lib/perl/ion/CVS/Root0100644000175200017560000000003407236675451017643 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/lib/perl/ion/CVS/Repository0100644000175200017560000000003607236675451021101 0ustar stephensstephenghome/ion/src/bin/lib/perl/ion maks0.2/src/bin/lib/perl/ion/CVS/Entries0100644000175200017560000000001307236675451020326 0ustar stephensstephengD/_cvs//// maks0.2/src/bin/lib/perl/ion/_cvs/0040755000175200017560000000000007306123713017265 5ustar stephensstephengmaks0.2/src/bin/lib/perl/ion/_cvs/CVS/0040755000175200017560000000000007306135474017727 5ustar stephensstephengmaks0.2/src/bin/lib/perl/ion/_cvs/CVS/Root0100644000175200017560000000003407236675451020575 0ustar stephensstepheng:local://cvs/ioncvs/cvsroot maks0.2/src/bin/lib/perl/ion/_cvs/CVS/Repository0100644000175200017560000000004307236675451022031 0ustar stephensstephenghome/ion/src/bin/lib/perl/ion/_cvs maks0.2/src/bin/lib/perl/ion/_cvs/CVS/Entries0100644000175200017560000000017307306135474021261 0ustar stephensstepheng/entry.pm/1.4/Tue Mar 21 07:17:32 2000// /rlog.pm/1.2/Sun Mar 7 10:45:55 1999// /find.pm/1.9/Sat Jun 2 10:09:00 2001// D maks0.2/src/bin/lib/perl/ion/_cvs/entry.pm0100644000175200017560000000210607065621014020757 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: entry.pm,v 1.4 2000/03/21 07:17:32 stephensk Exp $ package ion::_cvs::entry; #print STDERR "ion::_cvs::entry\n"; @map = ( 'type', 'file', 'revision', 'date', 'extra', 'sticky', 'path', 'Repository', 'Filepath' ); %map = (); foreach $_ ( 0 .. $#map ) { my($s) = $map[$_]; my($c) = substr($s, 0, 1); die "Check @map" if ( $map{$c} ); $map{$c} = $_; $map{$s} = $_; } sub type { $_[0]->[0]; } sub isFile { $_[0]->type() ne 'D'; } sub isDirectory { $_[0]->type() eq 'D'; } sub name { $_[0]->[1]; } sub version { $_[0]->[2]; } sub revision { # alias $_[0]->[2]; } sub date { $_[0]->[3]; } sub other { $_[0]->[4]; } sub sticky { $_[0]->[5]; } sub path { $_[0]->[6]; } sub repository { $_[0]->[7]; } sub fullpath { $_[0]->[8]; } sub rlog { if ( ! defined $_[0]->[9] ) { eval 'use ion::_cvs::rlog;'; $_[0]->[9] = ion::_cvs::rlog($_[0]->repository, ($_[1] ? $_[1] : $ion::_cvs::rlog::options)); } } sub clear_rlog { $_[0]->[9] = undef; } sub make { my($x) = @_; bless $x; } 1; maks0.2/src/bin/lib/perl/ion/_cvs/find.pm0100644000175200017560000000634007306135474020552 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: find.pm,v 1.9 2001/06/02 10:09:00 stephens Exp $ use ion::_cvs::entry; ######################################################### package ion::_cvs; #print STDERR "ion::_cvs::find\n"; use Cwd; use File::Find; use File::Basename; $debug = 0; $testing = 0; $find::show_funny_entries = 0; $find::all_files = 0; sub read_CVS_Entries { my($dir) = @_; my($in); my($Repository); $in = "$dir/CVS/Repository"; if ( -f $in ) { open($in, "<$in") || die "$in: $!"; $Repository = <$in>; chop $Repository; close($in); } $in = "$dir/CVS/Entries"; if ( -f $in ) { my(@entries); my($line); my($lineno) = 0; open($in, "<$in") || die "$in: $!"; while ( $line = <$in> ) { chomp $line; $lineno ++; my($rec); $rec = [ split('/', $line) ]; if ( $#{$rec} > 0 ) { $rec->[6] = $dir; $rec->[7] = $rec->[0] eq 'D' ? "$Repository/$rec->[1]" : "$Repository/$rec->[1],v"; $rec->[8] = $rec->[6] . '/' . $rec->[1]; #print join('+', $#{$rec}, @{$rec}), "\n"; ion::_cvs::entry::make($rec); #print join('-', $#{$rec}, @{$rec}), "\n"; #die "$in:$lineno:$line" if ( $#{$rec} <= 0 ); push(@entries, $rec); } else { warn "$in:$lineno: funny entry: '$line'\n" if ( $ion::_cvs::find::show_funny_entries ); } } close($in); @entries; } else { 0; } } sub do_entry { my($entry, $proc, $data) = @_; #print join('|', $#{$rec}, @{$rec}), "\n"; &{$proc}($entry, $data); if ( $entry->[0] eq 'D' ) { my($se); foreach $se ( read_CVS_Entries($entry->[8]) ) { &{$proc}($se, $data); do_entry($se, $proc, $data); } } } ######################################################### sub wanted { print STDERR "wanted: $File::Find::name\n" if ( $debug ); if ( $_ eq 'CVS' ) { $File::Find::prune = 1; } else { if ( -d && (-f "$_/CVS/Entries" || -f "../CVS/Entries") ) { #print STDERR "Found dir $File::Find::name\n"; push(@found_files, $File::Find::name); $File::Find::prune = 1; } elsif ( -f ) { #print STDERR "Found file $File::Find::name\n"; push(@found_files, $File::Find::name); } } } sub find { my($proc, $data, @files) = @_; # Collect files under CVS control @found_files = (); my($save_cwd) = getcwd; File::Find::find(\&wanted, @files); chdir($save_cwd) || die "$save_cwd: $!"; ######################################################### #print STDERR "files = (", join("\n\t", @files), ")\n"; my($path); foreach $path ( @found_files ) { my($dir, $file); my($entry); $dir = dirname($path); $file = basename($path); print STDERR "$path:$dir:$file\n" if ( $debug ); if ( -d $path && -f "$path/CVS/Entries" ) { print STDERR "$path is a dir\n" if ( $debug ); foreach $entry ( read_CVS_Entries($path) ) { do_entry($entry, $proc, $data); } } elsif ( $file ne '.' && -f "$dir/CVS/Entries" ) { #print STDERR "Search for $file in $dir/CVS\n"; ENTRY: foreach $entry ( read_CVS_Entries($dir) ) { #print STDERR "Entry name $entry->[1]\n"; if ( $file eq $entry->[1] ) { print STDERR "Found entry for $file in $dir/CVS\n" if ( $debug); do_entry($entry, $proc, $data); last ENTRY; } } } } } 1; maks0.2/src/bin/lib/perl/ion/_cvs/rlog.pm0100644000175200017560000001167406670454343020605 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: rlog.pm,v 1.2 1999/03/07 10:45:55 stephensk Exp $ package ion::_cvs; ######################################################## $debug = 0; $testing = 0; ######################################################## $RLOG = $ENV{RLOG} if ( ! defined $RLOG ); $RLOG = 'rlog' if ( ! defined $RLOG ); sub END { unlink($tmp) if ( defined $tmp ); } sub rlog { my($vfile, $opts) = @_; my($obj) = {}; #my($debug) = 3; $opts = {} if ( ! defined $opts ); $opts->{RLOG} = $RLOG if ( ! defined $opts->{RLOG} ); $obj->{vfile} = $vfile; $obj->{revisions} = []; $obj->{revision} = {}; $obj->{symbolic_names} = []; $obj->{sym_name_to_rev} = {}; $obj->{rev_to_sym_names} = {}; $obj->{filter} = $opts->{filter}; ############################################ # Run rlog into temp file my($in) = "rlog" . abs($$) . ".tmp"; $tmp = $in; my($cmd) = qq($opts->{RLOG} $obj->{filter} $obj->{vfile} > $in); print STDERR "$cmd\n" if ( $debug > 0 ); if ( system($cmd) ) { unlink($in); return undef; } ############################################ # Slurp in the whole file open($in, "<$in") || die "$cmd: $!"; my(@lines); my($line); my($lineno) = 0; while ( defined ($line = <$in>) ) { chomp $line; print "$vfile: $line\n" if ( $debug > 2 ); push(@lines, $line); } close($in); unlink($tmp); undef $tmp; exit if ( $debug > 3 ); ############################################ # Begin scan $lineno = 0; if ( defined($line = shift @lines) ) { $lineno ++; } ############################################ # Scan header while ( defined $line && ($line !~ /^(-+|=+)$/) ) { if ( $line =~ /^([^:]+):\s*(.*)$/ ) { my($key, $value) = ($1, $2); if ( $key eq 'symbolic names' ) { ############################################ # Scan symbolic names print STDERR "Found symbolic names: $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } while ( defined $line && ($line =~ /^\s/) ) { print STDERR "Try sym_name: $lineno:$line\n" if ( $debug > 2 ); if ( $line =~ /^\s+([^\s:]+)\s*:\s*([\.0-9]+)/ ) { print STDERR "Matched sym_name '$1' '$2': $lineno:$line\n" if ( $debug > 1 ); push(@{$obj->{symbolic_names}}, $1); $obj->{sym_name_to_rev}->{$1} = $2; my($a); $a = $obj->{rev_to_sym_names}->{$2}; $a = $obj->{rev_to_sym_names}->{$2} = [] if ( ! defined $a ); push(@{$a}, $1); } if ( defined($line = shift @lines) ) { $lineno ++; } } } else { $key =~ tr/a-zA-Z0-9_/_/c; $value =~ s/\s+$//; print STDERR "Found key='$key' value='$value': $lineno:$line\n" if ( $debug > 2 ); $value = [ split(/\s+/, $value) ]; $obj->{$key} = $value; if ( defined($line = shift @lines) ) { $lineno ++; } } } else { if ( defined($line = shift @lines) ) { $lineno ++; } } } if ( defined($line = shift @lines) ) { $lineno ++; } while ( defined $line && $line !~ /^=+$/ ) { my($v) = {}; ############################################ # Scan 'revision:' print STDERR "Try revision: $lineno:$line\n" if ( $debug > 2); if ( $line =~ s/^revision[ :]// ) { $line =~ s/\s+;?\s*$//; $v->{revision} = $line; push(@{$obj->{revisions}}, $line); $obj->{revision}->{$line} = $v; $v->{symbolic_names} = $obj->{rev_to_sym_names}->{$line} || []; if ( defined($line = shift @lines) ) { $lineno ++; } print STDERR "Matched revision '$v->{revision}': $lineno:$line\n" if ( $debug > 1 ); } print STDERR "After revision '$v->{revision}': $lineno:$line\n" if ( $debug > 1 ); while ( $line =~ /^\s*$/ ) { print STDERR "Eat blank line: $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } } ############################################ # Scan ': ;' KEY1: while ( defined $line && $line ne '' ) { $line =~ s/^\s+//; if ( $line =~ s/^([a-zA-Z_]+)\s*:\s*([^;]+)(;|$)// ) { print STDERR "Matched key '$1' '$2': $lineno:$line\n" if ( $debug > 1 ); $v->{$1} = $2; } else { last KEY1; } } if ( defined($line = shift @lines) ) { $lineno ++; } ############################################ # Scan 'branches: ' if ( $line =~ s/^branches:\s*// ) { $line =~ s/\s+$//; $v->{branches} = [ split(/\s/, $line) ]; print STDERR "Matched branches: '$1': $lineno:$line\n" if ( $debug > 1 ); if ( defined($line = shift @lines) ) { $lineno ++; } } ############################################ # Scan comment $v->{comment} = ''; while ( defined $line && ($line !~ /^(-+|=+)$/) ) { $line =~ s/^\s+//; $line =~ s/\s+$//; if ( $line ne '' && $line !~ m@^\s*\*\*\* empty log message \*\*\*\s*$@ ) { $v->{comment} .= $line . "\n"; print STDERR "Comment: $line\n" if ( $debug > 1 ); } if ( defined($line = shift @lines) ) { $lineno ++; } } if ( defined($line = shift @lines) ) { $lineno ++; } } $obj; } 1; maks0.2/src/bin/dos2unix.c0100644000175200017560000000047005551357511015760 0ustar stephensstepheng#include int main() { int c; while ( (c = getchar()) != EOF ) { if ( c == '\r' ) { if ( (c = getchar()) == '\n' ) { putchar('\n'); } else { putchar('\r'); if ( c != EOF ) putchar(c); } } else { putchar(c); } } return 0; } maks0.2/src/bin/swig2def.pl0100744000175200017560000000066407262414406016114 0ustar stephensstepheng#!/usr/bin/perl use English; $RS = ';'; my $id = 1; print "EXPORTS\n"; while ( <> ) { if ( s/^\s*[a-z_]*extern[a-z_]*\s+((const\s*)?\w+\s*\**\s*\**)//si ) { my $type = $1; print STDERR "line '$_'\n"; $type =~ s/\s+//sg; while ( s/(\w+)//s ) { my $symbol = $1; my $data = (s/[(][^\]]*[)]//s ? '' : 'DATA '); if ( ! $data ) { print "\t$symbol @ $id $data;\n"; ++ $id; } } } } 1; maks0.2/src/bin/.#uud.1.20100744000175200017560000000417207245406670015210 0ustar stephensstepheng#!/bin/perl # # scans files for a uuencoded items in files and decodes them to $dir # and adds a line to $db based on the Subject: lines found # $count = 0; $subject = ''; $dir = shift || die("Specify an output directory"); $db = "$dir/images.txt"; @files = (); %subjects = (); %files = (); $again = 0; while ( $again || defined($_ = <>) ) { $again = 0; chop; if ( s/^Subject:\s+// ) { $subject = $_; } elsif ( /^begin\s+(\S+)\s+(\S+)/ ) { $mode = $1; $file = $2; print STDERR "File: $file, Subject: $subject\n"; if ( $file ne '' ) { $str = ''; $nlines = 0; while ( defined($_ = <>) ) { $nlines ++; if ( $nlines % 100 ) { print STDERR "$nlines lines...\r"; } last if /^end/; if ( /^Subject:\s+/ || /^begin\s+(\S+)\s+(\S+)/ ) { print STDERR "WARNING: found $_"; $again ++; last; } next if /[a-z]/; next unless int((((ord() - 32) & 077) + 2) / 3) == int(length() / 4); $str .= unpack('u', $_); } # Remove dir from $file name $file =~ s@^.*/@@; # Add .jpg suffix if needed $file .= "_" . ($count ++) . ".jpg" if ( $file !~ /\.jpg$/ ); # Give it an orignal name if ( 0 ) { while ( -f "$dir/$file" ) { $file =~ s/_([0-9]+)(\.[^\.]+)$//; $suffix = $1; $file .= ($count ++) . $suffix; } } # If the file doesn't already exist if ( ! -f "$dir/$file" ) { # Add an entry to the index push(@files, $file); while ( defined($files{$subject}) ) { $subject =~ s/_([0-9]+)$//; $subject .= '_' . ($1 + 1); } $subjects{$file} = $subject; $files{$subject} = $file; # print "file = $file, mode = $mode, subject = $subject\n"; # Write the file open(F, ">$dir/$file"); binmode(F); print F $str; close(F); #exit(0); } } } } #Append to db $exists = -r $db; open(INDEX, ">>$db"); binmode(INDEX); print INDEX "Filename\tSubject\n" if ( ! $exists ); foreach $file ( sort(@files) ) { $subject = $subjects{$file}; print INDEX "$file\t$subject\n"; } close(INDEX); ########################################################################## 1; maks0.2/src/bin/.#uudindex.1.20100744000175200017560000000711507245406752016241 0ustar stephensstepheng#!/bin/perl # Creates a html index for stuff in $dir listed by $db # Run this after uud. # $dir = shift || "images"; $db = "$dir.txt"; $_html = '.html'; ########################################################################## @fieldnames = (); @fields = (); @records = (); @files = (); %subjects = (); %files = (); #Read db open(INDEX, "<$db"); binmode(INDEX); # First record is the field names $_ = ; chop; @fieldnames = split("\t", $_); $fieldindex = 0; foreach $fieldname ( @fieldnames ) { $fieldindex{$fieldname} = $fieldindex ++; } while ( ) { chop; @fields = split("\t", $_); push(@records, [ @fields ]); } close(INDEX); #Create index.html $menu = "menu_" . $fieldnames[0] . $_html; open(INDEX, ">$dir/index$_html"); binmode(INDEX); print INDEX qq@ None <BODY> <CENTER> This frameset document contains: <UL> <LI> <A HREF="$menu">Menu</A></LI> </UL> </BODY> @; close(INDEX); #Create blank.html open(INDEX, ">$dir/blank$_html"); binmode(INDEX); print INDEX q@ None @; close(INDEX); sub add_suffix { my($x,$s) = @_; $x =~ s/\.[^.]+$//; $x .= $s; $x; } #Create menus $fieldindex = -1; foreach $fieldname ( @fieldnames ) { $fieldindex ++; $menu = "menu_$fieldname$_html"; open(INDEX, ">$dir/$menu"); binmode(INDEX); print INDEX qq~ None ~; # Put a record to select a different column sorting print INDEX qq~~; foreach $fname ( @fieldnames ) { print INDEX qq~~; foreach $field ( @$record ) { print INDEX qq~
$fname~; } print INDEX "\n"; # Sort by Filename and create htmls for each file $fieldindex = $fieldindex{'Filename'}; @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $image = $record->[0]; $HREF = add_suffix($record->[0], $_html); $prev = $ri > 0 ? add_suffix($records[$ri - 1]->[0], $_html) : undef; $next = $ri <= $#records ? add_suffix($records[$ri + 1]->[0], $_html) : undef; print STDERR "HREF='$HREF', image='$image', prev='$prev', next='$next'\n"; exit(1); if ( $HREF ) { open(HREF,">$HREF") || die "Cannot write '$HREF'"; print HREF qq~ None
$record->[1]

~; if ( $prev ) { print HREF qq~PREV $prev\n~; } if ( $next ) { print HREF qq~NEXT $next\n~; } print HREF qq~


$image\n~; print HREF qq~
~; close(HREF); } } # Sort by current field @records = sort { $a->[$fieldindex] cmp $b->[$fieldindex] } @records; foreach $ri ( 0..$#records ) { $record = $records[$ri]; $HREF = add_suffix($record->[0]. $_html); print INDEX qq~
$field~; } print INDEX "\n"; } print INDEX qq~

~; close(INDEX); } 1; maks0.2/src/bin/cvsfix.pl0100644000175200017560000000222007264417364015701 0ustar stephensstepheng#!/usr/local/bin/perl # $Id: cvsfix.pl,v 1.1 2001/04/09 20:43:32 stephens Exp $ # use File::Find; $debug = 9; $testing = 0; $keep_backup = 1; $filename = '(Entries|Root|Repository)'; while ( @ARGV ) { $_ = shift @ARGV; if ( /^--?f/ ) { $filename = shift @ARGV; } elsif ( /^--?d/ ) { ++ $debug; } elsif ( /^--?t/ ) { ++ $testing; } elsif ( /^--?[h?]/ ) { print "Removes CRs from CVS files.\n"; } else { push(@ARGV, $_); last; } } sub wanted { my ($file) = $File::Find::name; #print STDERR "$file\n"; if ( $file =~ m@/CVS/(Entries|Root|Repository)$@s ) { my($in, $out) = ( $_, "$_.tmp" ); my($line); print STDERR "Checking: $file\n" if ( $debug > 1 ); open($in, "<$in") || die "$in: $!"; binmode($in); $line = join('', <$in>); close($in); #print STDERR "$line"; if ( $line =~ s/\r//sg ) { print "Had CR: $file\n"; if ( ! $testing ) { rename($in, $out) || die "rename $in $out: $!"; open($in, ">$in") || die "$in: $!"; binmode($in); print $in $line; close($in); #unlink($out) if ( ! $keep_backup ); } } } } find(\&wanted, @ARGV); 1; maks0.2/src/GUM_BUILD_ROOT0100644000175200017560000000060607306140035015416 0ustar stephensstepheng# $Id: GUM_BUILD_ROOT,v 1.3 2001/04/07 10:26:24 stephens Exp $ # Build options DEBUG=YES #OPTIMIZE=NO # output root is ../gumo GUM_GENERATED_ROOT:=$(shell cd $(GUM_BUILD_ROOT)/../gumo && /bin/pwd)# # Quick install. GUM_GENERATED_LIB_DIR=$(INSTALL_DIR_LIB)# # Pick up /iimp stuff PATH:=/iimp/bin:$(PATH) INCLUDE_DIRS_GLOBAL:=$(GUM_BUILD_ROOT) /iimp/include# LIB_DIRS_GLOBAL:=/iimp/lib# maks0.2/README0100644000175200017560000000141207306140035013346 0ustar stephensstephengmaks 0.2 README ============================================================================== Copyright (c) 1997-2001 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.acm.org/~stephensk Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.3 2001/04/03 18:37:16 stephens Exp $ ============================================================================== maks0.2/COPYRIGHT0100644000175200017560000000113107306140035013757 0ustar stephensstephengCopyright (c) 1997-2001 Kurt A. Stephens and Ion, Inc., All Rights Reserved. http://www.acm.org/~stephensk Kurt A. Stephens and Ion, Inc. MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. Kurt A. Stephens and Ion, Inc. SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. $Id: COPYRIGHT,v 1.3 2001/04/03 18:37:16 stephens Exp $ maks0.2/CHANGES0100644000175200017560000000014107306140035013457 0ustar stephensstephengmaks 0.2 CHANGES ============================================================================== maks0.2/TOC0100644000175200017560000003062607306140040013043 0ustar stephensstephengmaks 0.2 Table of Contents ============================================================================== maks0.2: total 7 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:29 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:29 .. -rw-r--r-- 1 stephens stepheng 97 Jun 2 05:29 CHANGES -rw-r--r-- 1 stephens stepheng 601 Jun 2 05:29 COPYRIGHT -rw-r--r-- 1 stephens stepheng 778 Jun 2 05:29 README -rw-r--r-- 1 stephens stepheng 106 Jun 2 05:29 TOC drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:29 src maks0.2/src: total 5 drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:29 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 05:29 .. -rw-r--r-- 1 stephens stepheng 390 Jun 2 05:29 GUM_BUILD_ROOT drwxr-xr-x 5 stephens stepheng 1024 Jun 2 05:29 bin drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 maks maks0.2/src/bin: total 134 drwxr-xr-x 5 stephens stepheng 1024 Jun 2 05:29 . -rwxr--r-- 1 stephens stepheng 2170 Feb 23 01:14 .#uud.1.2 -rwxr--r-- 1 stephens stepheng 3661 Feb 23 01:14 .#uudindex.1.2 drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:09 CVS -rw-r--r-- 1 stephens stepheng 230 Feb 17 1999 PKG -rw-r--r-- 1 stephens stepheng 9271 Feb 17 1999 addcr drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 addcr.t -rw-r--r-- 1 stephens stepheng 3385 Jun 28 1999 addrcsid.pl -rw-r--r-- 1 stephens stepheng 5118 Feb 17 1999 ccinfo -rw-r--r-- 1 stephens stepheng 3059 Feb 17 1999 ccloclibs -rw-r--r-- 1 stephens stepheng 372 Feb 19 1999 ctocnl.c -rwxr--r-- 1 stephens stepheng 1255 Jan 14 09:40 cvschrep.pl -rw-r--r-- 1 stephens stepheng 1062 Feb 17 1999 cvschroot.pl -rw-r--r-- 1 stephens stepheng 352 Oct 20 1999 cvsclean -rw-r--r-- 1 stephens stepheng 331 Oct 13 1999 cvsedited -rw-r--r-- 1 stephens stepheng 1373 Oct 20 1999 cvsfind.pl -rw-r--r-- 1 stephens stepheng 1168 Apr 9 15:43 cvsfix.pl -rw-r--r-- 1 stephens stepheng 1193 Sep 9 1999 cvsretag.pl -rw-r--r-- 1 stephens stepheng 3571 Mar 21 2000 cvsrevhist.pl -rw-r--r-- 1 stephens stepheng 945 Feb 19 1999 cwfixlib.pl -rwxr--r-- 1 stephens stepheng 3010 Jan 14 09:40 d2u.pl -rw-r--r-- 1 stephens stepheng 312 Apr 8 1994 dos2unix.c -rw-r--r-- 1 stephens stepheng 709 Feb 17 1999 ecd -rw-r--r-- 1 stephens stepheng 190 Feb 17 1999 fe -rw-r--r-- 1 stephens stepheng 103 Feb 17 1999 findsource -rw-r--r-- 1 stephens stepheng 6566 Sep 30 1999 igrep drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 lib -rw-r--r-- 1 stephens stepheng 647 Feb 17 1999 linkdups -rw-r--r-- 1 stephens stepheng 1369 Feb 17 1999 locstatic -rw-r--r-- 1 stephens stepheng 259 Sep 30 1999 lsup -rw-r--r-- 1 stephens stepheng 6485 Feb 19 1999 mergefiles.pl -rw-r--r-- 1 stephens stepheng 1965 Sep 30 1999 mkindex -rw-r--r-- 1 stephens stepheng 1739 Oct 13 1999 mvr.pl -rw-r--r-- 1 stephens stepheng 279 Feb 17 1999 nmlibs -rwxr-xr-x 1 stephens stepheng 64 Feb 17 1999 nmm -rw-r--r-- 1 stephens stepheng 2427 Feb 17 1999 objcsyms -rw-r--r-- 1 stephens stepheng 18189 Jun 2 05:24 publish.pl -rw-r--r-- 1 stephens stepheng 2957 Feb 17 1999 sci -rw-r--r-- 1 stephens stepheng 3328 Feb 17 1999 scip -rw-r--r-- 1 stephens stepheng 92 Oct 13 1999 si -rw-r--r-- 1 stephens stepheng 2374 Feb 19 1999 split.c -rwxr--r-- 1 stephens stepheng 436 Apr 3 13:40 swig2def.pl -rwxr--r-- 1 stephens stepheng 2350 Jan 14 09:41 tgz -rw-r--r-- 1 stephens stepheng 1655 Mar 21 2000 ts -rwxr--r-- 1 stephens stepheng 2170 Apr 3 13:51 uud -rwxr--r-- 1 stephens stepheng 3661 Apr 3 13:51 uudindex -rw-r--r-- 1 stephens stepheng 606 Feb 17 1999 which -rw-r--r-- 1 stephens stepheng 99 Feb 17 1999 whichall -rw-r--r-- 1 stephens stepheng 1777 Feb 17 1999 wwwsend maks0.2/src/bin/CVS: total 6 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:09 . drwxr-xr-x 5 stephens stepheng 1024 Jun 2 05:29 .. -rw-r--r-- 1 stephens stepheng 1817 Jun 2 05:09 Entries -rw-r--r-- 1 stephens stepheng 17 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/addcr.t: total 5 drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 5 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 backup -rw-r--r-- 1 stephens stepheng 143 Feb 17 1999 run maks0.2/src/bin/addcr.t/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 49 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 25 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/addcr.t/backup: total 7 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 260 Feb 19 1999 t1.c -rw-r--r-- 1 stephens stepheng 20 Feb 17 1999 t2 -rw-r--r-- 1 stephens stepheng 41 Feb 17 1999 t3 -rw-r--r-- 1 stephens stepheng 379 Feb 17 1999 t4 maks0.2/src/bin/addcr.t/backup/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 155 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 32 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/lib: total 4 drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 5 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 perl maks0.2/src/bin/lib/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 11 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 21 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/lib/perl: total 4 drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 ion maks0.2/src/bin/lib/perl/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 10 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 26 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/lib/perl/ion: total 4 drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS drwxr-xr-x 3 stephens stepheng 1024 Jun 2 03:46 _cvs maks0.2/src/bin/lib/perl/ion/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 11 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 30 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/bin/lib/perl/ion/_cvs: total 14 drwxr-xr-x 3 stephens stepheng 1024 Jun 2 03:46 . drwxr-xr-x 4 stephens stepheng 1024 Feb 2 21:29 .. drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:09 CVS -rw-r--r-- 1 stephens stepheng 1094 Mar 21 2000 entry.pm -rw-r--r-- 1 stephens stepheng 3296 Jun 2 05:09 find.pm -rw-r--r-- 1 stephens stepheng 5052 Mar 7 1999 rlog.pm maks0.2/src/bin/lib/perl/ion/_cvs/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Jun 2 05:09 . drwxr-xr-x 3 stephens stepheng 1024 Jun 2 03:46 .. -rw-r--r-- 1 stephens stepheng 123 Jun 2 05:09 Entries -rw-r--r-- 1 stephens stepheng 35 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/maks: total 28 drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 . drwxr-xr-x 4 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Apr 4 04:06 CVS -rwxr--r-- 1 stephens stepheng 206 Apr 3 13:51 PKG -rwxr--r-- 1 stephens stepheng 4407 Apr 4 04:09 basic.mak drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 bin -rw-r--r-- 1 stephens stepheng 172 Feb 19 1999 fixpound.pl -rwxr--r-- 1 stephens stepheng 2246 Apr 3 13:51 lib.mak drwxr-xr-x 3 stephens stepheng 1024 Apr 4 00:55 opengl drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 os -rwxr--r-- 1 stephens stepheng 6667 Apr 3 13:51 pre.mak -rw-r--r-- 1 stephens stepheng 1651 Mar 21 2000 tool.mak -rw-r--r-- 1 stephens stepheng 212 Sep 8 1999 tools.mak -rwxr--r-- 1 stephens stepheng 494 Apr 3 13:51 use.mak drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 win32 maks0.2/src/maks/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Apr 4 04:06 . drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 .. -rw-r--r-- 1 stephens stepheng 370 Apr 4 04:06 Entries -rw-r--r-- 1 stephens stepheng 18 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/maks/bin: total 5 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 418 Jun 28 1999 mak -rw-r--r-- 1 stephens stepheng 106 Jun 28 1999 mak.bat maks0.2/src/maks/bin/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 78 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 22 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/maks/opengl: total 5 drwxr-xr-x 3 stephens stepheng 1024 Apr 4 00:55 . drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Apr 4 04:06 CVS -rw-r--r-- 1 stephens stepheng 75 Feb 19 1999 Makefile -rw-r--r-- 1 stephens stepheng 495 Apr 4 04:09 Makefile.use maks0.2/src/maks/opengl/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Apr 4 04:06 . drwxr-xr-x 3 stephens stepheng 1024 Apr 4 00:55 .. -rw-r--r-- 1 stephens stepheng 88 Apr 4 04:06 Entries -rw-r--r-- 1 stephens stepheng 25 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/maks/os: total 6 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 88 Jan 13 2000 CYGWIN.mak -rw-r--r-- 1 stephens stepheng 116 Jan 13 2000 CYGWIN_98-4.10.mak -rw-r--r-- 1 stephens stepheng 77 Jan 13 2000 Linux.mak maks0.2/src/maks/os/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 138 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 21 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root maks0.2/src/maks/win32: total 5 drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 7 stephens stepheng 1024 Jun 2 05:29 .. drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 CVS -rw-r--r-- 1 stephens stepheng 75 Feb 19 1999 Makefile -rw-r--r-- 1 stephens stepheng 101 Feb 19 1999 Makefile.use maks0.2/src/maks/win32/CVS: total 5 drwxr-xr-x 2 stephens stepheng 1024 Feb 2 21:29 . drwxr-xr-x 3 stephens stepheng 1024 Feb 2 21:29 .. -rw-r--r-- 1 stephens stepheng 88 Feb 2 21:29 Entries -rw-r--r-- 1 stephens stepheng 24 Feb 2 21:29 Repository -rw-r--r-- 1 stephens stepheng 28 Feb 2 21:29 Root