genfid
来自「java 到c的转换程序的原代码.对喜欢C程序而不懂JAVA程序的人很有帮助」· 代码 · 共 79 行
TXT
79 行
#!/bin/sh# $Id: genFID,v 1.9 1999/01/05 18:44:14 pab Exp $# Generate enumerations that need to be the same in both java and C code,# as well as additional code that connects them.# Function address names: FID_name and C namecat >/tmp/fid$$ <<__EOFnew anewarrayinitclassvmnewarraythrowAIOBE throwArrayIndexOutOfBoundsExceptiongeteltoffsintdivintremlongdivlongremlongmulremdrdtoidtollongshiftlong2flong2dlongcmpputsthrowNPE throwNullPointerExceptionmythreadsthread_got_exc sthread_got_exceptionsetjmp SETJMP_FNAMElongjmpfindhandlerathrowmonitorentermonitorexitthrowCCE throwClassCastExceptioninstanceoffindinterfacethrowNASE throwNegativeArraySizeExceptionenterclassexitclassbackjumpfn YIELD_FNtimeNow &timeNowtimeSliceEnd &timeSliceEndthrowJITIntErrCodeBlock_resolveCode resolveCode__juyFn__EOFexec < /tmp/fid$$rm -f fid.java fid.c fid.hcat >fid.c <<__EOFLonggetFuncAddr_i_m3SYh (int fid){ switch (fid) {__EOFfn=1while read fid rem ; do if [ -z "${rem}" ] ; then rem="${fid}" fi echo " static final int FID_${fid} = ${fn};" >> fid.java echo "#define FID_${fid} (${fn})" >> fid.h echo " case FID_${fid}:" >> fid.c echo " return addressToLong (${rem});" >> fid.c fn=`expr $fn + 1`donecat >>fid.c <<__EOF default: assert (0); } return 0L;}__EOFrm -f /tmp/fid$$
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?