diff options
author | Jakob Kaivo <jkk@ung.org> | 2022-03-28 17:00:30 -0400 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2022-03-28 17:00:30 -0400 |
commit | 4662dbf4240757189a6619cc2b1d7110b0b7ded8 (patch) | |
tree | 9afe330c163f44806c6666384066dab170b11021 | |
parent | 0c061784519c069853ba9e9794fc4ec41d0668f9 (diff) |
-rw-r--r-- | Makefile | 6 | ||||
-rwxr-xr-x | linkmenudriver | 7 | ||||
-rwxr-xr-x | miralib/menudriver.csh | 104 | ||||
-rwxr-xr-x | miralib/menudriver.sh | 102 |
4 files changed, 3 insertions, 216 deletions
@@ -21,7 +21,7 @@ mira: big.o cmbnms.o data.o lex.o reduce.o steer.o trans.o types.o utf8.o y.tab. $(CC) $(CFLAGS) -DVERS=`cat miralib/.version` -DVDATE="\"`./revdate`\"" \ -DHOST="`./quotehostinfo`" version.c cmbnms.o y.tab.o data.o lex.o \ big.o reduce.o steer.o trans.o types.o utf8.o -lm -o mira - strip mira$(EX) + #strip mira$(EX) y.tab.c y.tab.h: rules.y $(YACC) -d rules.y big.o cmbns.o data.o lex.o reduce.o steer.o trans.o types.o y.tab.o: \ @@ -33,12 +33,12 @@ utf8.o: utf8.h Makefile cmbnms.o: cmbnms.c Makefile cmbnms.c combs.h: gencdecs ./gencdecs + miralib/menudriver: menudriver.c Makefile $(CC) $(CFLAGS) menudriver.c -o miralib/menudriver chmod 755 miralib/menudriver$(EX) strip miralib/menudriver$(EX) -#alternative: use shell script -# ln -s miralib/menudriver.sh miralib/menudriver + tellcc: @echo $(CC) $(CFLAGS) cleanup: diff --git a/linkmenudriver b/linkmenudriver deleted file mode 100755 index 4c832be..0000000 --- a/linkmenudriver +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -rm -f miralib/menudriver -if test -z "`echo -n`" -o ! \( -x /bin/csh -o -x /usr/bin/csh \) -then ln -s menudriver.sh miralib/menudriver -else ln -s menudriver.csh miralib/menudriver -fi -echo `ls -l miralib/menudriver` diff --git a/miralib/menudriver.csh b/miralib/menudriver.csh deleted file mode 100755 index 2aa89e7..0000000 --- a/miralib/menudriver.csh +++ /dev/null @@ -1,104 +0,0 @@ -#!/bin/csh -f -# menu driver - Copyright Research Software Ltd 1985, 2006 -# this version modified to ignore execute permissions of files - -# see below for explanation of these variables, which we -# set to defaults if not present in the user's environment - -if(! $?MENUVIEWER) set MENUVIEWER = cat #ALTERNATIVE: more -if(! $?VIEWER) then -# choose one of these by removing the '#' in column one - set VIEWER = 'less -EX' RETURNTOMENU = NO -# set VIEWER = less RETURNTOMENU = YES -# set VIEWER = 'more -d' RETURNTOMENU = NO -endif - -set sansnl n invalid last oldlasts noglob -set histchars = '@^' #neutralize '!' - -if("`echo -n`" == '') then #use flag -n to suppress newline, if working -set sansnl = '-n' -endif - -if("$1" != '') cd "$1" -set top = "`pwd`" -while( -f contents ) - if("$n" == '') then - clear - if("$invalid" != '') echo invalid option "$invalid" - set invalid = '' - $MENUVIEWER contents; - echo $sansnl ::please type selection number \(or q to quit\): - set line = "$<" - set n = `expr " $line" : ' *\([^ ]*\)'` - endif - if("$n" == '.' && "$last" != '') then - set n = $last; - else if("$n" == '+' && "$last" != '' && "$last" != '.') then - set n = `expr $last + 1` - else if("$n" == '-' && "$last" != '' && "$last" != '.') then - set n = `expr $last - 1` - endif - if("$n" != '') then - if(-d "$n") then - if(-f "$n/contents") then - cd "$n"; set oldlasts = "$n,$oldlasts" last = "." - else set invalid = "$n" - endif - set n = '' - else if(-f "$n") then - if("$n" == '99') then #special case, 99 is an executable - clear; "./$n" - else clear; - $VIEWER "$n" - if("$RETURNTOMENU" == 'YES') then - set last = $n n = '' - continue #next iteration of while-loop - endif - endif - echo $sansnl ::next selection \(return to go back to menu, q to quit\): - set last = $n line = "$<" - set n = `expr " $line" : ' *\([^ ]*\)'` - else if("$n" == 'q' || "$n" == '/q') then - exit - else if("$n" == '???') then # ??? interrogates display settings - echo " MENUVIEWER='$MENUVIEWER'" - echo " VIEWER='$VIEWER', RETURNTOMENU='$RETURNTOMENU'" - echo these can be changed by setting environment variables \ -of the same names - set n = '' - echo $sansnl '[Hit return to continue]' - set lose = "$<" - else if( "$n" =~ !* ) then - set line = `expr "$line" : ' *\(.*\)'` - set line = `expr "$line" : '\(.*[^ ]\) *'` - if( ".$line" == '.!!' || ".$line" == '.!' ) then - if(! $?lastbang) then - set invalid = "$n" n = ''; continue - else echo !"$lastbang" - endif - else set lastbang = `expr "$line" : '!\(.*\)'` - endif - $lastbang - echo $sansnl '[Hit return to continue]' - set n = '' - set lose = "$<" - else set invalid = "$n" n = '' - endif - else if("$oldlasts" == '') exit #we are at the root of the tree - cd .. - set last = `expr $oldlasts : '\([^,]*\)'` - set oldlasts = `expr $oldlasts : '[^,]*,\(.*\)'` - endif -end #of while-loop -exit -# Explanation of variables -# -# MENUVIEWER is the program used to display contents pages -# -# VIEWER is the program used to display individual sections -# -# RETURNTOMENU=YES prevents another prompt being given after displaying -# each section, causing instead an immediate return to contents page. It -# should be `YES' if VIEWER is a program that pauses for input at end of -# file, `NO' if VIEWER is a program that quits silently at end of file. diff --git a/miralib/menudriver.sh b/miralib/menudriver.sh deleted file mode 100755 index 81d4362..0000000 --- a/miralib/menudriver.sh +++ /dev/null @@ -1,102 +0,0 @@ -#! /bin/sh -# menu driver - Copyright Research Software Ltd 1985, 2006 -# this version modified to ignore execute permissions of files - -# see below for explanation of these variables, which we -# set to defaults if not present in the user's environment - -test "$MENUVIEWER" || MENUVIEWER=cat #ALTERNATIVE: more -if test ! "$VIEWER" -then -# choose one of these by removing the '#' in column one - VIEWER='less -EX'; RETURNTOMENU=NO -# VIEWER=less, RETURNTOMENU=YES -# VIEWER='more -d'; RETURNTOMENU=NO -fi - -if test -z "`echo -n`" #use flag -n to suppress newline, if working -then sansnl='-n' -fi - -cd "$1" -top="`pwd`" -while test -f contents -do - if test '' = "$n" - then echo [H[J #clear - test ."$invalid" = . || echo invalid option "$invalid" - invalid="" - $MENUVIEWER contents; - echo $sansnl ::please type selection number \(or q to quit\): - read n - fi - if test '.' = "$n" -a "$last" - then n=$last - elif test '+' = "$n" -a "$last" -a "$last" != . - then n=`expr $last + 1` - elif test '-' = "$n" -a "$last" -a "$last" != . - then n=`expr $last - 1` - fi - if test '' != "$n" - then if test -d "$n" - then if test -f "$n/contents" - then cd "$n"; oldlasts=$n:$oldlasts; last="."; - else invalid="$n"; fi - n="" - elif test -f "$n" - then if test '99' = "$n" #special case, 99 is an executable - then echo [H[J; "./$n" - else echo [H[J #clear - $VIEWER "$n" - if test "$RETURNTOMENU" = YES - then last=$n; n=""; continue #next iteration of while-loop - fi - fi - echo $sansnl ::next selection \(return to go back to menu, q to quit\): - last=$n; read n - elif test ."$n" = .q -o ."$n" = ./q - then exit - elif test '???' = "$n" # ??? interrogates display settings - then echo " MENUVIEWER='$MENUVIEWER'" - echo " VIEWER='$VIEWER', RETURNTOMENU='$RETURNTOMENU'" - echo these can be changed by setting environment variables \ -of the same names - n="" - echo $sansnl '[Hit return to continue]' - read lose - else case $n in - !*) if test ".$n" = '.!!' -o ".$n" = '.!' - then if test "$lastbang" = '' - then invalid="$n"; n=""; continue - else echo !"$lastbang" - fi - else lastbang=`expr "$n" : '!\(.*\)'` - fi - $lastbang - echo $sansnl '[Hit return to continue]' - n="" - read lose ;; - *) invalid="$n"; n="" ;; - esac - fi - else test "$oldlasts" || exit #we are at the root of the tree - cd .. - last=`expr $oldlasts : '\([^:]*\)'` - oldlasts=`expr $oldlasts : '[^:]*:\(.*\)'` - fi -done -exit -# Oct 2003 modified for Peter Bartke to overcome problem on UWIN -# no test -x, instead all files displayed except 99 which is executed -# May 2006 use echo $sansnl because echo -n not portable - -# Explanation of variables -# -# MENUVIEWER is the program used to display contents pages -# -# VIEWER is the program used to display individual sections -# -# RETURNTOMENU=YES prevents another prompt being given after displaying -# each section, causing instead an immediate return to contents page. It -# should be `YES' if VIEWER is a program that pauses for input at end of -# file, `NO' if VIEWER is a program that quits silently at end of file. |