OSDN Git Service

* src/dhuf.c (decode_start_dyn): call init_code_cache().
[lha/lha.git] / src / cproto.sh
1 #!/bin/sh
2
3 trap "rm -f prototypes.h.tmp" 0 1 2 3 15
4
5 CPROTO_FLAGS='-m -d'
6 CPPFLAGS='-DSTDC_HEADERS=1
7         -DHAVE_STRDUP=0
8         -DHAVE_MEMSET=0
9         -DHAVE_MEMMOVE=0
10         -DMULTIBYTE_FILENAME=1
11         -DRETSIGTYPE=void
12         -DNEED_INCREMENTAL_INDICATOR=1
13         -D__extension__=
14 '
15
16 SOURCES='append.c bitio.c crcio.c dhuf.c extract.c header.c
17         huf.c larc.c lhadd.c lharc.c lhext.c
18         lhlist.c maketbl.c maketree.c patmatch.c
19         shuf.c slide.c util.c
20 '
21
22 exec 5>&1 > prototypes.h.tmp
23
24 cat <<END
25 /* This file was generated by cproto. */
26 #if PROTOTYPES /* defined in config.h */
27 #define P_(s) s
28 #else
29 #define P_(s) ()
30 #endif
31
32 END
33
34 cproto $CPROTO_FLAGS $CPPFLAGS $SOURCES | grep -v '^int main '
35
36 cat <<END
37
38 /* lharc.c */
39 RETSIGTYPE interrupt(int signo);
40 /* util.c */
41 #if !HAVE_MEMMOVE
42 void *memmove P_((void *dst, const void *src, size_t cnt));
43 #endif
44 #if !HAVE_STRDUP
45 char *strdup P_((char *buf));
46 #endif
47 #if !HAVE_MEMSET
48 char *memset P_((char *s, int c, int n));
49 #endif
50
51 /* vsnprintf.c */
52 #if !HAVE_VSNPRINTF
53 int vsnprintf P_((char *str, size_t n, const char *fmt, va_list ap));
54 int snprintf P_((char *str, size_t n, char const *fmt, ...));
55 #endif
56
57 #undef P_
58 END
59
60 exec 1>&5
61 if ! cmp prototypes.h.tmp prototypes.h; then
62   mv -f prototypes.h prototypes.h.bak
63   mv -f prototypes.h.tmp prototypes.h
64 fi