📄 iffe
字号:
esac case $o in run) v=$p p= m=_${v} ;; mem) case $p in *.*) case $shell in bsh) eval `echo $p | sed -e 's/\\([^.]*\\)\\.\\(.*\\)/p=\\1 m=\\2/'` ;; *) eval 'm=${p#*.}' eval 'p=${p%%.*}' ;; esac v=${m}.${v} esac case $config in 0) m=_${v}_${p} ;; 1) m=_${v}_in_${p} ;; esac ;; *) case $p in '') m=_${v} ;; *) m=_${p}_${v} ;; esac ;; esac ;; *) p= v=$a f=$a m=_${v} ;; esac case $c in '') c=$v ;; esac M=$m case $o in out) case $a in -) a=- ;; ?*) test="$a $test" a= ;; esac ;; *) case " $idyes " in *" $m "*) i=1 ;; *) case " $idno " in *" $m "*) i=0 ;; *) case $m in *'*') m=`echo "$m" | sed 's,\*,_ptr,g'` ;; esac case $m in *[-+/\\]*) i=0 ;; *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) is id $m copy $tmp.c "int $m = 0;" if $cc -c $tmp.c then success - idyes="$idyes $m" i=1 else failure - idno="$idno $m" i=0 fi ;; *) i=1 ;; esac ;; esac case $i in 0) case $o in dat|dfn|key|lib|mac|mth|nos|npt|siz|sym|typ|val) continue ;; esac ;; esac ;; esac ;; esac case $m in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) m=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` ;; esac # check output redirection case $out in $cur) ;; *) case $cur in $a|$c) ;; *) case $cur in .) ;; -) case $iff in ?*) echo "#endif" ;; esac ;; *) case $iff in ?*) echo "#endif" ;; esac exec >/dev/null case $cur in *[\\/]*|*.h) x=$cur ;; *) x=$dir/$cur ;; esac case $style in C) (proto -r $protoflags $tmp.h) >/dev/null 2>&1 sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t ;; *) sed '/^#/d' $tmp.h > $tmp.c sed '/^#/d' $x > $tmp.t ;; esac if cmp -s $tmp.c $tmp.t then rm -f $tmp.h case $verbose in 1) echo "$command: $x: unchanged" >&$stderr ;; esac else case $x in ${dir}[\\/]$cur) test -d $dir || mkdir $dir || exit 1 ;; esac mv $tmp.h $x fi ;; esac case $out in +) case $status in 1) ;; *) status=0 ;; esac exit $status ;; -) eval "exec >&$stdout" ;; *) exec >$tmp.h ;; esac case $out in "") case $a in *[\\/]*|???????????????*) cur=$c ;; *) cur=$a ;; esac ;; *) cur=$out ;; esac case $in in ""|-|+) case $o in run) x=" from $a" ;; *) x= ;; esac ;; *) x=" from $in" ;; esac # output header comments case $style in C) echo "/* : : generated$x by $command version $version : : */" for x in $pragma do echo "#pragma $x" done case $out in ""|-|+) x=$m ;; *.*) case $shell in bsh) eval `echo $in | sed -e 's,\\.,_,g' -e 's/^/x=/'` ;; *) i=$out x=_ while : do case $i in *.*) eval 'x=$x${i%%.*}_' eval 'i=${i#*.}' ;; *) x=$x$i break ;; esac done ;; esac ;; *) x=_$out ;; esac case $o in iff) case $M in ""|*-*) iff= ;; *) iff=${m}_H ;; esac ;; *) case $regress in '') case $x in *-*) ;; *) x=`pwd | sed -e 's,.*[\\\\/],,' -e 's,\\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` # ksh n+ bug workaround case $x in *[!_]*) ;; *) x=_$$ ;; esac iff=_def${x} ;; esac ;; *) iff=_REGRESS ;; esac ;; esac case $iff in ?*) echo "#ifndef $iff" echo "#define $iff 1" ;; esac ;; *) echo "# : : generated$x by $command version $version : : #" ;; esac ;; esac ;; esac case $can in ?*) case $define in 1) echo "$can" ;; esac can= cansep= ;; esac # set up the candidate include list inc= for x in $defhdr $hdr do case $x in *.h) case $shell in bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` ;; *) eval 'c=${x##*[\\/]}' eval 'c=${c%%.*}' case $x in */*) eval 'c=${x%%[\\/]*}_${c}' ;; esac ;; esac case $config in 0) case $x in */*) c=_${c} ;; *) c=_hdr_${c} ;; esac ;; 1) case $shell in ksh) typeset -u u=$c ;; *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; esac c=HAVE_${u}_H ;; esac case " $puthdr " in *" $c "*) ;; *) puthdr="$puthdr $c" usr="$usr$nl#define $c 1" ;; esac inc="$inc#include <$x>" ;; esac done # set up the candidate lib list for x in $lib $deflib do case $shell in ksh) eval 'c=${x#-l}' ;; *) c=`echo '' $x | sed 's, *-l,,'` ;; esac case $c in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` ;; esac case $config in 0) c=_LIB_${c} ;; 1) case $shell in ksh) typeset -u u=$c ;; *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; esac c=HAVE_${u}_LIB ;; esac case " $putlib " in *" $c "*) ;; *) putlib="$putlib $c" usr="$usr$nl#define $c 1" ;; esac done # src overrides builtin test case $config:$def in 0:) case $o in tst|var);; *) m=_${o}${m} ;; esac ;; 1:) case $o in tst|var)m=${v} ;; esac case $shell in ksh) typeset -u u=$m ;; *) u=`echo $m | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; esac case $o in tst|var)case $m in $u) ;; *) case $m in hdr_*|lib_*|sys_*) case $shell in ksh) u=${u#????} ;; *) u=`echo $u | sed 's/....//'` ;; esac ;; esac m=HAVE_${u} ;; esac ;; dat) m=HAVE${u}_DATA ;; hdr|lcl)m=HAVE${u}_H ;; key) m=HAVE${u}_RESERVED ;; mth) m=HAVE${u}_MATH ;; npt) m=HAVE${u}_DECL ;; pth) m=${u}_PATH case $shell in ksh) m=${m#_} ;; *) m=`echo $m | sed 's,^_,,'` ;; esac ;; nxt) m=HAVE${u}_NEXT ;; siz) m=SIZEOF${u} ;; sys) m=HAVE_SYS${u}_H ;; *) m=HAVE${u} ;; esac ;; *) m=$def M=$m ;; esac case $v in *.*) pre= for x in `echo $v | sed 's,\\., ,g'` do pre="$pre#undef $x" done ;; *) case $o in siz|typ)case $v in char|short|int|long) ;; *) pre="#undef $v" ;; esac ;; *) pre="#undef $v" ;; esac ;; esac case $src in ?*) case $src in *['<"'][Ss][Tt][Dd][Ii][Oo].[Hh]['">']*)EXT= ;; *) EXT=$ext ;; esac copy $tmp.c "$std$usr$inc$EXT$src" e=0 is tst "${note:-$run}" case $run in cat*|nocat*) copy - "$src" ;; cross*|nocross*) copy $tmp.sh "$src" chmod +x $tmp.sh execute $tmp.sh <&$nullin || e=1 ;; run*|norun*) (eval "$src") <&$nullin || e=1 ;; mac*|nomac*) if $cc -E $tmp.c <&$nullin >$tmp.i then sed -e '/<<[ ]*".*"[ ]*>>/!d' -e 's/<<[ ]*"//g' -e 's/"[ ]*>>//g' $tmp.i else e=1 fi ;; p*|nop*)$cc -DTEST=$p -DID=$v -E $tmp.c <&$nullin >&$nullout || e=1 ;; c*|noc*)$cc -DTEST=$p -DID=$v -c $tmp.c <&$nullin >&$nullout || e=1 ;; *) case $run in s*|nos*)case $reallystatictest in '') #UNDENT... reallystatictest=. echo '#include <stdio.h>int main(){printf("hello");return(0);}' > ${tmp}s.c rm -f ${tmp}s.exe if $cc -c ${tmp}s.c <&$nullin >&$nullout && $cc -o ${tmp}s.exe ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe then e=`wc -l ${tmp}s.e` eval set x x $binding while : do shift shift case $# in 0) break ;; esac rm -f ${tmp}s.exe $cc -o ${tmp}s.exe $1 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue case `wc -l ${tmp}s.e` in $e) ;; *) continue ;; esac d=`ls -s ${tmp}s.exe` rm -f ${tmp}s.exe $cc -o ${tmp}s.exe $2 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue case `wc -l ${tmp}s.e` in $e) ;; *) continue ;; esac case `ls -s ${tmp}s.exe` in $d) ;; *) reallystatic=$2 set x shift break ;; esac done fi rm -f ${tmp}s.* #...INDENT ;; esac ccflags=$reallystatic ;; *) ccflags= ;; esac set x $mac e=1 while : do o= shift while : do case $# in 0) break ;; esac case $1 in -) break ;; esac o="$o $1" shift done rm -f $tmp.exe if $cc $ccflags $o -DTEST=$p -DID=$v -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe then case $run in no[ls]*);; [ls]*) e=0 && break ;; noo*) execute $tmp.exe <&$nullin || break ;; o*) execute $tmp.exe <&$nullin && e=0 && break ;; no*) execute $tmp.exe <&$nullin >&$nullout || break ;; *) execute $tmp.exe <&$nullin >&$nullout && e=0 && break ;; esac else case $run in no[els]*)e=1 && break ;; esac fi case $# in 0) case $run in no*) e=0 ;; esac break ;; esac done ;; esac case $run in no*) case $e in 0) e=1 ;; *) e=0 ;; esac ;; esac report $e 1 "${note:-$run\ passed}" "${note:-$run} failed" continue ;; esac # initialize common builtin state case $o in dat|lib|mth|run) case $statictest in "") statictest=FoobaR copy $tmp.c "$std$usr$ext_BEGIN_EXTERNS_extern int $statictest;_END_EXTERNS_int main(){char* i = (char*)&$statictest; return ((unsigned int)i)^0xaaaa;}" rm -f $tmp.exe if $cc -o $tmp.exe $tmp.c <&$nullin >&$nullout && $executable $tmp.exe then case $static in .) static= echo '#include <stdio.h>int main(){printf("hello");return(0);}' > $tmp.c rm -f $tmp.exe if $cc -c $tmp.c <&$nullin >&$nullout && $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe then e=`wc -l $tmp.e` eval set x x $binding while : do shift shift case $# in 0) break ;; esac rm -f $tmp.exe $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue case `wc -l $tmp.e` in $e) ;; *) continue ;; esac d=`ls -s $tmp.exe` rm -f $tmp.exe $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout 2>$tmp.e && $executable $tmp.exe || continue case `wc -l $tmp.e` in $e) ;; *) continue ;; esac case `ls -s $tmp.exe` in $d) ;; *) static=$2 set x shift break ;; esac done fi ;; esac else static= fi ;; esac ;; esac
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -