X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcproto.sh;h=6213989c625db6f81b95c396ab0946eb3b47a505;hb=3390fc522cb5340a9879a49a830b75be84eb721b;hp=1b4180a0cd3130d8636109554add873e1b98095a;hpb=1f16322b6b0d6f47b81fbebc78110ba535ce2a20;p=lha%2Flha.git diff --git a/src/cproto.sh b/src/cproto.sh index 1b4180a..6213989 100644 --- a/src/cproto.sh +++ b/src/cproto.sh @@ -1,49 +1,76 @@ #!/bin/sh +# +# generate function prototypes `prototype.h'. +# + +trap "rm -f prototypes.h.tmp prototypes.h.bak" 0 1 2 3 15 + +CPROTO_FLAGS= +CPPFLAGS='-DSTDC_HEADERS=1 + -DHAVE_STRDUP=1 + -DHAVE_MEMSET=1 + -DHAVE_MEMMOVE=1 + -DHAVE_STRCASECMP=1 + -DHAVE_BASENAME=1 + -DMULTIBYTE_FILENAME=1 + -Dinterrupt=dummy__ + -DNEED_INCREMENTAL_INDICATOR=1 +' +# `interrupt' is the reserved word for cproto. + +SOURCES='append.c bitio.c crcio.c dhuf.c extract.c header.c + huf.c indicator.c larc.c lhadd.c lharc.c lhext.c + lhlist.c maketbl.c maketree.c patmatch.c + shuf.c slide.c util.c + pm2.c pm2tree.c pm2hist.c +' + +test -f prototypes.h && mv -f prototypes.h prototypes.h.bak + +# below makes cproto regard `RETSIGTYPE' as the variable type. +cat <prototypes.h +typedef void RETSIGTYPE; +END exec 5>&1 > prototypes.h.tmp cat <&5 -mv prototypes.h.tmp prototypes.h +if test -f prototypes.h.bak && cmp -s prototypes.h.tmp prototypes.h.bak; then + mv -f prototypes.h.bak prototypes.h +else + mv -f prototypes.h.tmp prototypes.h +fi