OSDN Git Service

* src/lha.h, src/lha_macro.h: refined.
authorarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sun, 7 Jul 2002 11:00:16 +0000 (11:00 +0000)
committerarai <arai@6a8cc165-1e22-0410-a132-eb4e3f353aba>
Sun, 7 Jul 2002 11:00:16 +0000 (11:00 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/lha/lha/trunk@325 6a8cc165-1e22-0410-a132-eb4e3f353aba

src/lha.h
src/lha_macro.h

index 860e9a3..fee2fc8 100644 (file)
--- a/src/lha.h
+++ b/src/lha.h
 #include <signal.h>
 
 #if STDC_HEADERS
+# include <string.h>
+#else
+# if !HAVE_STRCHR
+#  define strchr index
+#  define strrchr rindex
+# endif
+char *strchr (), *strrchr ();
+# if !HAVE_MEMCPY
+#  define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
+#  define memcpy(d, s, n) bcopy ((s), (d), (n))
+#  define memmove(d, s, n) bcopy ((s), (d), (n))
+# endif
+#endif
+
+#if HAVE_STRCASECMP
+#define strucmp(p,q)   strcasecmp((p),(q))
+#endif
+
+#if STDC_HEADERS
 # include <stdlib.h>
 # include <stddef.h>
 #else
 # endif
 #endif
 
+#ifndef NULL
+#define NULL ((char *)0)
+#endif
+
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
@@ -106,6 +129,43 @@ typedef int gid_t;
 #define SEEK_END               2
 #endif /* SEEK_SET */
 
+#if HAVE_LIMITS_H
+#include <limits.h>
+#else
+
+#ifndef CHAR_BIT
+#define CHAR_BIT 8
+#endif
+
+#ifndef UCHAR_MAX
+#define UCHAR_MAX ((1<<(sizeof(unsigned char)*8))-1)
+#endif
+
+#ifndef USHRT_MAX
+#define USHRT_MAX ((1<<(sizeof(unsigned short)*8))-1)
+#endif
+
+#ifndef SHRT_MAX
+#define SHRT_MAX ((1<<(sizeof(short)*8-1))-1)
+#endif
+
+#ifndef SHRT_MIN
+#define SHRT_MIN (SHRT_MAX-USHRT_MAX)
+#endif
+
+#ifndef ULONG_MAX
+#define ULONG_MAX ((1<<(sizeof(unsigned long)*8))-1)
+#endif
+
+#ifndef LONG_MAX
+#define LONG_MAX ((1<<(sizeof(long)*8-1))-1)
+#endif
+
+#ifndef LONG_MIN
+#define LONG_MIN (LONG_MAX-ULONG_MAX)
+#endif
+
+#endif /* HAVE_LIMITS_H */
 
 #include "lha_macro.h"
 
index 80d7c8b..f1bbb55 100644 (file)
 /* ------------------------------------------------------------------------ */
 /*     Slide relation                                                                                                                  */
 /* ------------------------------------------------------------------------ */
-#if HAVE_LIMITS_H
-
-#include <limits.h>
-
-#else
-
-#ifndef CHAR_BIT
-#define CHAR_BIT  8
-#endif
-
-#ifndef UCHAR_MAX
-#define UCHAR_MAX                              ((1<<(sizeof(unsigned char)*8))-1)
-#endif
-
-#ifndef USHRT_MAX
-#define USHRT_MAX                              ((1<<(sizeof(unsigned short)*8))-1)
-#endif
-
-#ifndef SHRT_MAX
-#define SHRT_MAX                               ((1<<(sizeof(short)*8-1))-1)
-#endif
-
-#ifndef SHRT_MIN
-#define SHRT_MIN                               (SHRT_MAX-USHRT_MAX)
-#endif
-
-#ifndef ULONG_MAX
-#define ULONG_MAX      ((1<<(sizeof(unsigned long)*8))-1)
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX       ((1<<(sizeof(long)*8-1))-1)
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN       (LONG_MAX-ULONG_MAX)
-#endif
-
-#endif
-
 #define LH3_DICBIT                     13
 #define LH5_DICBIT                     13
 #define LH6_DICBIT                     15
 #endif
 
 /* ------------------------------------------------------------------------ */
-/*     Memory and String function                                                                                              */
-/* ------------------------------------------------------------------------ */
-#if STDC_HEADERS
-# include <string.h>
-#else
-# if !HAVE_STRCHR
-#  define strchr index
-#  define strrchr rindex
-# endif
-char *strchr (), *strrchr ();
-# if !HAVE_MEMCPY
-#  define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
-#  define memcpy(d, s, n) bcopy ((s), (d), (n))
-#  define memmove(d, s, n) bcopy ((s), (d), (n))
-# endif
-#endif
-
-#if HAVE_STRCASECMP
-#define strucmp(p,q)   strcasecmp((p),(q))
-#endif
-
-/* ------------------------------------------------------------------------ */
 /* Individual macro define                                                                                                     */
 /* ------------------------------------------------------------------------ */
 
@@ -340,10 +278,6 @@ char *strchr (), *strrchr ();
 #define BUFFERSIZE     2048
 #define MAXSFXCODE     1024*64
 
-#ifndef NULL
-#define NULL           (char *)0
-#endif
-
 /* slide.c */
 /*
 #define PERCOLATE  1