--- /dev/null
+# -*- text -*-
+# this file was generated by `ifnames' utility.
+
+AIX lha.h lha_macro.h slide.c
+ARCHIVENAME_EXTENTION lha_macro.h
+BACKUPNAME_EXTENTION lha_macro.h
+CHAR_BIT lha_macro.h
+DEBUG slide.c
+DIRBLKSIZ lhdir.h
+DIRSIZ lhdir.c
+# EUC crcio.c lha.h lharc.c --enable-text-conv
+EXTEND_TOWNSOS lhlist.c
+# FTIME header.c replace with HAVE_FTIME
+# GETTIMEOFDAY header.c replace with HAVE_GETTIMEOFDAY
+# SYSV_SYSTEM_DIR lha_macro.h replace with HAVE_DIRENT_H
+# HAVE_TM_ZONE header.c replace with HAVE_TM_GMTOFF
+LHA_MAIN_SRC lha.h lha_macro.h
+# LONG_MAX lha_macro.h
+# LONG_MIN lha_macro.h
+MKDIRPATH util.c
+# MKTIME header.c replace with HAVE_MKTIME
+MSDOS lha_macro.h
+# MULTIBYTE_CHAR header.c lha_macro.h util.c --enable-multibyte-filename
+# NEED_INCREMENTAL_INDICATOR append.c crcio.c lha.h --enable-indicator
+NEWSOS huf.c use HAVE_STDLIB_H ???
+# NOBSTRING lha_macro.h util.c use memset(), memcpy()
+NODIRECTORY lha_macro.h lharc.c
+# NOFTRUNCATE lhadd.c util.c replace with !HAVE_FTRUNCATE
+# NOINDEX lha_macro.h use strchr(), strrchr()
+# NOMEMSET util.c replace with !HAVE_MEMSET
+# NOMKDIR util.c replace with !HAVE_MKDIR
+NONSYSTEM_DIR_LIBRARY lha_macro.h no use (???)
+# NOSTRDUP util.c replace with !HAVE_STRDUP
+NOT_COMPATIBLE_MODE header.c lhext.c
+NOT_USED header.c
+NOVOID lha_macro.h
+# NO_INODE lharc.c replace with !HAVE_ST_INO (???)
+# HAVE_NO_LCHOWN lhext.c replace with !HAVE_LCHOWN
+NULL lha_macro.h
+OSK header.c
+O_RDONLY lhdir.c
+RMDIRPATH util.c
+SEEK_SET lha_macro.h
+SHRT_MAX lha_macro.h
+SHRT_MIN lha_macro.h
+# SUPPORT_LH6 lharc.c use configure --enable-lh6
+S_IFLNK header.c lha_macro.h lhadd.c lharc.c lhext.c
+# TIMELOCAL header.c replace with HAVE_TIMELOCAL
+TIMEZONE_HOOK header.c
+# TMP_FILENAME_TEMPLATE lha_macro.h lhadd.c lharc.c --with-tmp-file
+# SYSTIME_HAS_NO_TM lha_macro.h replace with TM_IN_SYS_TIME
+# TZSET header.c replace with HAVE_TZSET
+UCHAR_MAX lha_macro.h
+UINT_MAX maketree.c
+ULONG_MAX lha_macro.h
+# USESTRCASECMP lha_macro.h util.c replace with HAVE_STRCASECMP
+USE_PROF lharc.c
+# USHRT_MAX lha_macro.h
+# _MINIX header.c lha_macro.h util.c use AC_MINIX in configure.in
+__STDC__ huf.c lha.h lha_macro.h slide.c util.c
+sony_news huf.c
--- /dev/null
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = CHANGES.euc MACHINES.euc MACHINES2.euc PROBLEMS.euc README.euc \
+ change-114e.txt change-114f.txt config.eng config.jpn.euc \
+ header.doc.euc IFNAMES
+SUBDIRS= man src
# SWITCHES macro definitions ... see config.eng or config.jpn.
#-----------------------------------------------------------------------
-SHELL=/bin/sh
-MAKE = make
+top_srcdir=@top_srcdir@
+srcdir=@srcdir@
+SHELL=@SHELL@
+@SET_MAKE@
-#CC = cc
-CC = gcc
-SWITCHES = -DNEED_INCREMENTAL_INDICATOR \
- -DTMP_FILENAME_TEMPLATE="\"/tmp/lhXXXXXX\""
+CC = @CC@
+SWITCHES = @DEF_KCODE@ @DEFS@ -I$(top_srcdir)/..
+OPTIMIZE =
-#MACHINE = -DSYSTIME_HAS_NO_TM -DFTIME -DEUC
-#MACHINE = -DSYSTIME_HAS_NO_TM -DEUC -DHAVE_TM_ZONE -DSYSV_SYSTEM_DIR
-MACHINE = -DSYSTIME_HAS_NO_TM -DEUC -DSYSV_SYSTEM_DIR -DMKTIME
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-#OPTIMIZE = -O2 -fstrength-reduce -fomit-frame-pointer
-OPTIMIZE = -O2 -DSUPPORT_LH6
-
-BINDIR = /usr/local/bin
-MANDIR = /usr/local/man
+BINDIR = @bindir@
+MANDIR = @mandir@
MANSECT = n
-INSTALL = install
-INSTALLBIN = -s -m 755
-INSTALLMAN = -m 644
+INSTALL = @INSTALL@
+INSTALLBIN = @INSTALL_PROGRAM@
+INSTALLMAN = @INSTALL_DATA@
SUBDIRS = src man
-O = .o
+O = .@OBJEXT@
# missing library objects.
# memset$(O) lhdir$(O)
--- /dev/null
+# -*- Mode: text ; Coding: euc-japan -*-
+
+autoconfiguration for LHa for UNIX version 1.14f
+ Thu, Sep 30 1999 by Koji Arai
+
+¤³¤Î¥Õ¥¡¥¤¥ë¤ÏLHa for UNIX version 1.14f ¤òautoconf¡¢automake²½
+¤·¤¿¤È¤¤Î¥á¥â¤Ç¤¹¡£
+
+¡¦¥Þ¥¯¥í¤ÎÃÖ¤´¹¤¨
+
+ ¥ª¥ê¥¸¥Ê¥ë¤Îlha-1.14f ¤Ç»È¤ï¤ì¤Æ¤¤¤¿¥Þ¥¯¥í¤Ïautoconfɸ½à¤Î¥Þ¥¯¥í̾¤Ë
+ ÃÖ¤´¹¤¨¤é¤ì¤Þ¤·¤¿¡£(IFNAMES¥Õ¥¡¥¤¥ë¤Ë¾ÜºÙ¤¬½ñ¤«¤ì¤Æ¤¤¤Þ¤¹)
+
+ IFNAMES¥Õ¥¡¥¤¥ë¤Ï¡¢
+ ¥Þ¥¯¥í̾ ÄêµÁ¤Î¤¢¤ë¥Õ¥¡¥¤¥ë... ¥³¥á¥ó¥È
+ ¤È¤¤¤¦¹½À®¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥Õ¥¡¥¤¥ë¤Ïautoconf¤È°ì½ï¤ËÇÛÉÛ¤µ¤ì¤ë
+ ifnames¥³¥Þ¥ó¥É¤ÇÀ¸À®¤·¤Þ¤·¤¿¡£
+ IFNAMES¥Õ¥¡¥¤¥ë¤Î# ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤ë¹Ô¤Ï³ºÅö¤Î¥Þ¥¯¥í¤¬ÃÖ¤´¹¤¨¤é¤ì¤¿¤ê¡¢
+ configure ¥³¥Þ¥ó¥É¤Î¥³¥Þ¥ó¥É¥ª¥×¥·¥ç¥ó¤Ç»ØÄꤵ¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¤³¤È¤ò
+ ¼¨¤·¤Þ¤¹¡£¤½¤Î¤Þ¤Þ¤Î¹Ô¤Ïautoconf¤ÇȽÃǤ¹¤ëɬÍפ¬¤Ê¤¤¤«¤Þ¤¿¤Ï»ä¤¬È½ÃÇ
+ ¤Ç¤¤Ê¤¤¤¿¤á¡¢¤½¤Î¤Þ¤ÞÊüÃÖ¤·¤¿¤³¤È¤ò¼¨¤·¤Þ¤¹¡£
+
+¡¦GPL
+ automake ¤Ï¡¢--foreign ÉÕ¤¤Ç½èÍý¤·¤Þ¤·¤¿¡£¤¤¤¯¤Ä¤«¤ÎGNU¥æ¡¼¥Æ¥£¥ê¥Æ¥£
+ (config.guess, config.sub, install-sh, missing, mkinstalldirs)¤¬´Þ¤Þ
+ ¤ì¤Æ¤¤¤ë¤¿¤á¡¢GPL2¤¬µ½Ò¤µ¤ì¤¿¥Õ¥¡¥¤¥ëCOPYING¤òƱº¤·¤Þ¤·¤¿¤¬¡¢
+ Lha for UNIX¼«ÂΤÏGPL¤Ë½¾¤Ã¤Æ¤¤¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£
+
+¡¦-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼¥«¥¤¥ÖºîÀ®
+
+ lha 1.14f ¤Ç¤Ï¡¢SUPPORT_LH6¤ÎÄêµÁ¤ò¹Ô¤ï¤Ê¤±¤ì¤Ð¡¢-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼
+ ¥«¥¤¥Ö¤òºîÀ®¤Ç¤¤Þ¤»¤ó¤Ç¤·¤¿¡£¤³¤Î¤³¤È¤ÏÊ̤˹½¤ï¤Ê¤¤¤Î¤Ç¤¹¤¬
+ SUPPORT_LH6¤òÄêµÁ¤¹¤ë¤È¥Ç¥Õ¥©¥ë¥È¤Ç-lh6-¥á¥½¥Ã¥É¤Î¥¢¡¼¥«¥¤¥ÖºîÀ®¤ò¶¯
+ À©¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£¤½¤³¤Ç¡¢¤â¤¦¾¯¤·½ÀÆð¤ËlhaÍøÍѼԤ¬¤³¤ì¤é¤òÁªÂò¤Ç
+ ¤¤ë¤è¤¦SUPPORT_LH6¤ÎµóÆ°¤ò¥Ç¥Õ¥©¥ë¥È¤ÇºîÀ®¤¹¤ë¥¢¡¼¥«¥¤¥Ö¥á¥½¥Ã¥É¤Î
+ Êѹ¹¤Ë¤·¡¢¤³¤Î¥Þ¥¯¥íÄêµÁ(configure¤Ç¤Ï--enable-lh6¥Õ¥é¥°)¤Î¤¢¤ë¤Ê¤·
+ ¤Ë¤è¤é¤º¡¢o6¥ª¥×¥·¥ç¥ó¤Ç- lh6-¥¢¡¼¥«¥¤¥Ö¤òºîÀ®¤Ç¤¤ë¤è¤¦¤Ë¤·¤Þ¤·¤¿¡£
+
+ ¤Þ¤¿¡¢configure¤Î¥Ç¥Õ¥©¥ë¥È¤ÏSUPPORT_LH6¤òÄêµÁ¤·¤Þ¤»¤ó¡£½¾¤Ã¤Æ¡¢¥Ç¥Õ¥©
+ ¥ë¥È¤ÇºîÀ®¤µ¤ì¤ë¥¢¡¼¥«¥¤¥Ö¤Î¥á¥½¥Ã¥É¤Ï-lh5-¤Ç¤¹¡£(¾å¤Ç½Ò¤Ù¤¿Ä̤ꡢ
+ lha¤Î o6 ¥ª¥×¥·¥ç¥ó¤Ë¤è¤ê¤¤¤Ä¤Ç¤â-lh6-¤ÇºîÀ®¤Ç¤¡¢configure¥ª¥×¥·¥ç
+ ¥ó¤Ë¤è¤ê¥Ç¥Õ¥©¥ë¥È¤ÎµóÆ°¤òÊѹ¹¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹)
--- /dev/null
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if your struct tm has tm_zone. */
+#undef HAVE_TM_ZONE
+
+/* Define if you don't have tm_zone but do have the external array
+ tzname. */
+#undef HAVE_TZNAME
+
+/* Define if utime(file, NULL) sets file's timestamp to the present. */
+#undef HAVE_UTIME_NULL
+
+/* Define if on MINIX. */
+#undef _MINIX
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if your <sys/time.h> declares struct tm. */
+#undef TM_IN_SYS_TIME
+
+/* Define if you have the ftime function. */
+#undef HAVE_FTIME
+
+/* Define if you have the ftruncate function. */
+#undef HAVE_FTRUNCATE
+
+/* Define if you have the gettimeofday function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have the lchown function. */
+#undef HAVE_LCHOWN
+
+/* Define if you have the memcpy function. */
+#undef HAVE_MEMCPY
+
+/* Define if you have the memset function. */
+#undef HAVE_MEMSET
+
+/* Define if you have the mkdir function. */
+#undef HAVE_MKDIR
+
+/* Define if you have the mktime function. */
+#undef HAVE_MKTIME
+
+/* Define if you have the rmdir function. */
+#undef HAVE_RMDIR
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strdup function. */
+#undef HAVE_STRDUP
+
+/* Define if you have the timelocal function. */
+#undef HAVE_TIMELOCAL
+
+/* Define if you have the tzset function. */
+#undef HAVE_TZSET
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* Define if your struct tm has tm_gmtoff */
+#undef HAVE_TM_GMTOFF
+
+/* Define if your struct stat has st_ino */
+#undef HAVE_ST_INO
+
+/* Define if you want to use the -lh6- method, default */
+#undef SUPPORT_LH6
+
+/* temporary file template */
+#undef TMP_FILENAME_TEMPLATE
+
+/* Define you want to use the incremental indicator */
+#undef NEED_INCREMENTAL_INDICATOR
+
+/* Define you want to use multibyte filename */
+#undef MULTIBYTE_CHAR
+
--- /dev/null
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(src/lha.h)
+AM_INIT_AUTOMAKE(lha, 1.14f)
+AM_CONFIG_HEADER(config.h)
+
+AC_CANONICAL_HOST
+
+dnl Checks for programs.
+AC_PROG_CC
+AC_PROG_GCC_TRADITIONAL
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+dnl on MINIX, define _MINIX and _POSIX_SOURCE
+AC_MINIX
+
+AC_EXEEXT
+AC_OBJEXT
+
+dnl Checks for libraries.
+
+dnl Checks for header files.
+AC_HEADER_DIRENT
+AC_HEADER_STDC
+AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/time.h)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_TIME
+AC_STRUCT_TM
+AC_STRUCT_TIMEZONE
+
+AC_CACHE_CHECK([for tm_gmtoff in struct tm], ac_cv_struct_tm_gmtoff,
+[AC_TRY_COMPILE([
+#if TM_IN_SYS_TIME
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+ ], [struct tm t; t.tm_gmtoff;],
+ ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)
+])
+
+if test "x$ac_cv_struct_tm_gmtoff" = xyes; then
+ AC_DEFINE(HAVE_TM_GMTOFF, 1, [Define if your struct tm has tm_gmtoff])
+fi
+
+AC_CACHE_CHECK([for st_ino in struct stat], ac_cv_struct_st_ino,
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/stat.h>
+ ], [struct stat s; s.st_ino;],
+ ac_cv_struct_st_ino=yes, ac_cv_struct_st_ino=no)
+])
+
+if test "x$ac_cv_struct_st_ino" = xyes; then
+ AC_DEFINE(HAVE_ST_INO, 1, [Define if your struct stat has st_ino])
+fi
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+AC_FUNC_UTIME_NULL
+AC_CHECK_FUNCS(strchr memcpy)
+AC_CHECK_FUNCS(mktime timelocal tzset ftime gettimeofday)
+AC_CHECK_FUNCS(mkdir rmdir strdup memset ftruncate lchown)
+AC_CHECK_FUNCS(strcasecmp)
+
+AC_SUBST(LIBOBJS)
+if test $ac_header_dirent = no; then
+ LIBOBJS="$LIBOBJS lhdir.o"
+fi
+
+dnl support kanji code conversion
+AC_SUBST(DEF_KCODE)
+AC_ARG_ENABLE(text_conv,
+ [ --enable-text-conv support text code convert from/to EUC [default=yes]],
+ , enable_text_conv=yes)
+
+if test $enable_text_conv = yes; then
+ DEF_KCODE=-DEUC
+fi
+
+dnl whether use the -lh6- method
+AC_ARG_ENABLE(lh6,
+ [ --enable-lh6 create the -lh6- archive default [default=no]],
+ , enable_lh6=no)
+
+if test "x$enable_lh6" = "xyes"; then
+ AC_DEFINE(SUPPORT_LH6, 1, [Define if you want to use the -lh6- method, default])
+fi
+
+dnl decide path names
+AC_MSG_CHECKING(template of the temporary file is )
+AC_ARG_WITH(tmp_file,
+ [ --with-tmp-file=TEMPLATE temporary file template [default=/tmp/lhXXXXXX]],
+ [case $withval in
+ yes|no) AC_MSG_ERROR(you should have specified path name);;
+ esac],
+ with_tmp_file=/tmp/lhXXXXXX)
+
+AC_MSG_RESULT($with_tmp_file)
+AC_DEFINE_UNQUOTED(TMP_FILENAME_TEMPLATE, "$with_tmp_file",
+ [temporary file template])
+
+dnl incremental indicator
+AC_ARG_ENABLE(indicator,
+ [ --enable-indicator need incremental indicator [default=yes]],
+ ,
+ # default
+ enable_indicator=yes)
+
+if test "x$enable_indicator" = xyes; then
+ AC_DEFINE(NEED_INCREMENTAL_INDICATOR, 1, [Define you want to use the incremental indicator])
+fi
+
+dnl support multibyte filename
+AC_ARG_ENABLE(multibyte-char,
+ [ --enable-multibyte-char support multibyte(sjis) filename [default=yes]],
+ ,
+ # default
+ enable_multibyte_char=yes)
+
+if test "x$enable_multibyte_char" = xyes; then
+ AC_DEFINE(MULTIBYTE_CHAR, 1, [Define you want to use multibyte filename])
+fi
+
+AC_OUTPUT([Makefile src/Makefile man/Makefile])
+++ /dev/null
-################################################################
-# Makefile for LHa man directory
-################################################################
-
-NROFF = nroff
-#NROFF = jman
-
-all: lha.man
-
-lha.man: lha.n
- $(NROFF) -man lha.n > lha.man
-
-install:
- $(INSTALL) $(INSTALLMAN) lha.n $(MANDIR)/man$(MANSECT)/lha.$(MANSECT)
-
-clean:
- rm -f *~
-
-moreclean:
- rm -f lha.man core *~ *.orig
--- /dev/null
+## Process this file with automake to produce Makefile.in
+man_MANS = lha.n
+EXTRA_DIST = $(man_MANS) lha.man
+
+#lha.man: lha.n
+# $(NROFF) -man lha.n > lha.man
--- /dev/null
+## Process this file with automake to produce Makefile.in
+bin_PROGRAMS = lha
+lha_SOURCES = append.c crcio.c dhuf.c extract.c header.c huf.c larc.c lha.h \
+ lha_macro.h lhadd.c lharc.c lhext.c lhlist.c \
+ maketbl.c maketree.c patmatch.c shuf.c slide.c util.c
+lha_LDADD = @LIBOBJS@
+EXTRA_DIST = lhdir.c lhdir.h
+AM_CPPFLAGS=$(DEF_KCODE)
moreclean:
rm -f core *.o lha.tar lha.tar.Z *~ \#* *.orig
-install:
+install: lha
+ strip lha
$(INSTALL) $(INSTALLBIN) lha $(BINDIR)/lha
#endif
fflush(stdout);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
UPDATE_CRC(*p++);
return crc;
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
{
putcode(7, 0);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
return crc;
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
{
register int i;
+#define HANKAKU_KATAKANA_P(c)\
+ (0xa0 < (unsigned char)(c) && (unsigned char)(c) < 0xe0)
+
#ifdef MULTIBYTE_CHAR
+#ifdef SUPPORT_X0201
+ for (i = 0; i < len; i++) {
+ /* modified by Koji Arai */
+ if (HANKAKU_KATAKANA_P(name[i])) {
+ int j;
+ for (j = len; j >= i; j--) {
+ name[j+1] = name[j]; /* no check over */
+ }
+ name[i] = 0x8e;
+ i++;
+ len++;
+ } else
+ if (MULTIBYTE_FIRST_P(name[i]) &&
+ MULTIBYTE_SECOND_P(name[i + 1])) {
+ int c1, c2;
+ c1 = name[i]; c2 = name[i+1];
+ sjis2euc(&c1, &c2);
+ name[i] = c1; name[i+1] = c2;
+ i++;
+ }
+ else if (name[i] == '\\')
+ name[i] = '/';
+ else if (isupper(name[i]))
+ name[i] = tolower(name[i]);
+ }
+#else
for (i = 0; i < len; i++) {
if (MULTIBYTE_FIRST_P(name[i]) &&
MULTIBYTE_SECOND_P(name[i + 1]))
else if (isupper(name[i]))
name[i] = tolower(name[i]);
}
+#endif /* SUPPORT_X0201 */
#else
for (i = 0; i < len; i++) {
if (name[i] == '\\')
boolean lower_case_used = FALSE;
#ifdef MULTIBYTE_CHAR
+#ifdef SUPPORT_X0201
+ for (i = 0; i < len; i++) {
+ /* modified by Koji Arai */
+ if (HANKAKU_KATAKANA_P(name[i])) {
+ int j;
+ for (j = len; j >= i; j--) {
+ name[j+1] = name[j]; /* no check over */
+ }
+ name[i] = 0x8e;
+ i++;
+ len++;
+ } else
+
+ if (MULTIBYTE_FIRST_P(name[i]) &&
+ MULTIBYTE_SECOND_P(name[i + 1]))
+ i++;
+ else if (islower(name[i])) {
+ lower_case_used = TRUE;
+ break;
+ }
+ }
+#else
for (i = 0; i < len; i++) {
if (MULTIBYTE_FIRST_P(name[i]) &&
MULTIBYTE_SECOND_P(name[i + 1]))
break;
}
}
+#endif /* SUPPORT_X0201 */
for (i = 0; i < len; i++) {
if (MULTIBYTE_FIRST_P(name[i]) &&
MULTIBYTE_SECOND_P(name[i + 1]))
{
register int i;
+/* modified by Koji Arai */
+#ifdef SUPPORT_X0201
+ for (i = 0; i < len; i ++) {
+ /* modified by Koji Arai */
+ if (HANKAKU_KATAKANA_P(name[i])) {
+ int j;
+ for (j = len; j >= i; j--) {
+ name[j+1] = name[j]; /* no check over */
+ }
+ name[i] = 0x8e;
+ i++;
+ len++;
+ } else
+
+ if (MULTIBYTE_FIRST_P (name[i]) &&
+ MULTIBYTE_SECOND_P (name[i+1])) {
+ int c1, c2;
+ c1 = name[i]; c2 = name[i+1];
+ sjis2euc(&c1, &c2);
+ name[i] = c1; name[i+1] = c2;
+ i ++;
+ }
+ else if (name[i] == ':')
+ name[i] = '/';
+ else if (name[i] == '/')
+ name[i] = ':';
+/*
+ else if (isupper (name[i]))
+ name[i] = tolower (name[i]);
+*/
+ }
+#else
for (i = 0; i < len; i++) {
if (name[i] == ':')
name[i] = '/';
else if (name[i] == '/')
name[i] = ':';
}
+#endif /* SUPPORT_X0201 */
}
/* ------------------------------------------------------------------------ */
*/
/* choose one */
-#if defined(MKTIME)
-#ifdef TIMELOCAL
-#undef TIMELOCAL
+#if defined(HAVE_MKTIME)
+#ifdef HAVE_TIMELOCAL
+#undef HAVE_TIMELOCAL
#endif
-#endif /* defined(MKTIME) */
+#endif /* defined(HAVE_MKTIME) */
-#if defined(MKTIME) || defined(TIMELOCAL)
-#ifdef TZSET
-#undef TZSET
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL)
+#ifdef HAVE_TZSET
+#undef HAVE_TZSET
#endif
-#endif /* defined(MKTIME) || defined(TIMELOCAL) */
+#endif /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
-#if defined(MKTIME) || defined(TIMELOCAL) || defined(TZSET)
-#ifdef FTIME
-#undef FTIME
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) || defined(HAVE_TZSET)
+#ifdef HAVE_FTIME
+#undef HAVE_FTIME
#endif
#endif
-#if defined(MKTIME) || defined(TIMELOCAL) || defined(TZSET) || defined(FTIME)
-#ifdef GETTIMEOFDAY
-#undef GETTIMEOFDAY
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) || defined(HAVE_TZSET) || defined(HAVE_FTIME)
+#ifdef HAVE_GETTIMEOFDAY
+#undef HAVE_GETTIMEOFDAY
#endif
#else
-#ifndef GETTIMEOFDAY
-#define GETTIMEOFDAY /* use gettimeofday() */
+#ifndef HAVE_GETTIMEOFDAY
+#define HAVE_GETTIMEOFDAY /* use gettimeofday() */
#endif
#endif
-#ifdef FTIME
+#ifdef HAVE_FTIME
#include <sys/timeb.h>
#endif
/* Which do you like better, `TIMEZONE_HOOK' or `TIMEZONE_HOOK;' ? */
#endif
-#if defined(TZSET) && defined(_MINIX)
+#if defined(HAVE_TZSET) && defined(_MINIX)
extern long timezone; /* not defined in time.h */
#endif
/* ------------------------------------------------------------------------ */
-#if defined(FTIME) || defined(GETTIMEOFDAY) || defined(TZSET)
+#if defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY) || defined(HAVE_TZSET)
static long
gettz()
-#ifdef TZSET
+#ifdef HAVE_TZSET
{
tzset();
return timezone;
#endif
/* ------------------------------------------------------------------------ */
-#if !defined(TZSET) && defined(FTIME)
+#if !defined(HAVE_TZSET) && defined(HAVE_FTIME)
{
struct timeb buf;
#endif
/* ------------------------------------------------------------------------ */
-#if !defined(TZSET) && !defined(FTIME) /* maybe defined(GETTIMEOFDAY) */
+#if !defined(HAVE_TZSET) && !defined(HAVE_FTIME) /* maybe defined(HAVE_GETTIMEOFDAY) */
{
-#ifdef HAVE_TM_ZONE
+#ifdef HAVE_TM_GMTOFF
time_t tt;
time(&tt);
return -localtime(&tt)->tm_gmtoff;
-#else /* HAVE_TM_ZONE */
+#else /* HAVE_TM_GMTOFF */
struct timeval tp;
struct timezone tzp;
gettimeofday(&tp, &tzp);/* specific to 4.3BSD */
* 60L : 0));
*/
return (tzp.tz_minuteswest * 60L);
-#endif /* HAVE_TM_ZONE */
+#endif /* HAVE_TM_GMTOFF */
}
#endif
-#endif /* defined(FTIME) || defined(GETTIMEOFDAY) ||
- * defined(TZSET) */
+#endif /* defined(HAVE_FTIME) || defined(HAVE_GETTIMEOFDAY) ||
+ * defined(HAVE_TZSET) */
/* ------------------------------------------------------------------------ */
#ifdef NOT_USED
static time_t
generic_to_unix_stamp(t)
long t;
-#if defined(MKTIME) || defined(TIMELOCAL)
+#if defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL)
{
struct tm dostm;
dostm.tm_isdst = 0; /* correct? */
#endif
dostm.tm_isdst = -1; /* correct? */
-#ifdef MKTIME
+#ifdef HAVE_MKTIME
return (time_t) mktime(&dostm);
-#else /* maybe defined(TIMELOCAL) */
+#else /* maybe defined(HAVE_TIMELOCAL) */
return (time_t) timelocal(&dostm);
#endif
}
-#else /* defined(MKTIME) || defined(TIMELOCAL) */
+#else /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
{
int year, month, day, hour, min, sec;
long longtime;
/* LONGTIME is now the time in seconds, since 1970/01/01 00:00:00. */
return (time_t) longtime;
}
-#endif /* defined(MKTIME) || defined(TIMELOCAL) */
+#endif /* defined(HAVE_MKTIME) || defined(HAVE_TIMELOCAL) */
/* ------------------------------------------------------------------------ */
static long
for (i = 0; i < header_size - 3; i++)
hdr->name[i] = (char) get_byte();
hdr->name[header_size - 3] = '\0';
+ name_length = header_size - 3; /* modified by Koji Arai */
break;
case 2:
/*
convdelim(hdr->name, DELIM2);
if (hdr->header_level != HEADER_LEVEL2) {
- if (p = (char *) rindex(hdr->name, DELIM2))
+ if (p = (char *) strrchr(hdr->name, DELIM2))
name_length = strlen(++p);
else
name_length = strlen(hdr->name);
put_word(hdr->unix_gid);
put_word(hdr->unix_uid);
- if (p = (char *) rindex(hdr->name, DELIM2)) {
+ if (p = (char *) strrchr(hdr->name, DELIM2)) {
int i;
name_length = p - hdr->name + 1;
data[I_HEADER_CHECKSUM] = calc_sum(data + I_METHOD, header_size);
} else { /* header level 2 */
int i;
- if (p = (char *) rindex(hdr->name, DELIM2))
+ if (p = (char *) strrchr(hdr->name, DELIM2))
name_length = strlen(++p);
else {
p = hdr->name;
convdelim(hdr->name, DELIM);
}
+
+#ifdef SUPPORT_X0201
+/*
+ * SJIS <-> EUC ÊÑ´¹´Ø¿ô
+ * ¡ÖÆüËܸì¾ðÊó½èÍý¡× ¥½¥Õ¥È¥Ð¥ó¥¯(³ô)
+ * ¤è¤êÈ´¿è(by Koji Arai)
+ */
+void
+euc2sjis(int *p1, int *p2)
+{
+ unsigned char c1 = *p1 & 0x7f;
+ unsigned char c2 = *p2 & 0x7f;
+ int rowoff = c1 < 0x5f ? 0x70 : 0xb0;
+ int celoff = c1 % 2 ? (c2 > 0x5f ? 0x20 : 0x1f) : 0x7e;
+ *p1 = ((c1 + 1) >> 1) + rowoff;
+ *p2 += celoff;
+}
+
+void
+sjis2euc(int *p1, int *p2)
+{
+ unsigned char c1 = *p1;
+ unsigned char c2 = *p2;
+ int adjust = c2 < 0x9f;
+ int rowoff = c1 < 0xa0 ? 0x70 : 0xb0;
+ int celoff = adjust ? (c2 > 0x7f ? 0x20 : 0x1f) : 0x7e;
+ *p1 = ((c1 - rowoff) << 1) - adjust;
+ *p2 -= celoff;
+
+ *p1 |= 0x80;
+ *p2 |= 0x80;
+}
+#endif /* SUPPORT_X0201 */
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
#include <sys/param.h>
#endif
-#if defined(__STDC__) || defined(NEWSOS)
+#if STDC_HEADERS
#include <stdlib.h>
+#else
+extern char *malloc ();
#endif
/* ------------------------------------------------------------------------ */
init_getbits();
blocksize = 0;
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
+/* vi:set ts=4 */
memset(&text[256 * 13 + 512 + 18], 0, 128);
memset(&text[256 * 13 + 512 + 128 + 18], ' ', 128 - 18);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
Included...
lharc.h interface.h slidehuf.h
*/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stdio.h>
#include <errno.h>
#include <ctype.h>
/* from lhadd.c */
extern int encode_lzhuf();
extern int encode_stored_crc();
+
+/* from header.c */
+void euc2sjis(int *p1, int *p2);
+void sjis2euc(int *p1, int *p2);
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
/* Ver. 1.14 Soruce All chagned 1995.01.14 N.Watazaki */
/* ------------------------------------------------------------------------ */
-/* Most of System V, define SYSTIME_HAS_NO_TM */
-#ifdef SYSTIME_HAS_NO_TM
-#include <time.h>
-#else
+/* Most of System V, define TM_IN_SYS_TIME */
+#if TM_IN_SYS_TIME
#include <sys/time.h>
-#endif /* SYSTIME_HAS_NO_TM */
+#else
+#include <time.h>
+#endif /* TM_IN_SYS_TIME */
/* ------------------------------------------------------------------------ */
/* Directory Access Stuff */
/* ------------------------------------------------------------------------ */
#ifndef NODIRECTORY
-#ifdef SYSV_SYSTEM_DIR
-
-#include <dirent.h>
-
-#define DIRENTRY struct dirent
-#define NAMLEN(p) strlen (p->d_name)
-
-#else /* not SYSV_SYSTEM_DIR */
-
-#ifdef NONSYSTEM_DIR_LIBRARY
-#include "lhdir.h"
+#if HAVE_DIRENT_H
+# include <dirent.h>
+# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
-#include <sys/dir.h>
-#endif /* not NONSYSTEM_DIR_LIBRARY */
+# define dirent direct
+# define NAMLEN(dirent) (dirent)->d_namlen
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# ifdef NONSYSTEM_DIR_LIBRARY /* no use ?? */
+# include "lhdir.h"
+# endif
+#endif
-#define DIRENTRY struct direct
-#define NAMLEN(p) p->d_namlen
+#define DIRENTRY struct dirent
-#endif /* not SYSV_SYSTEM_DIR */
#endif /* NODIRECTORY */
/* ------------------------------------------------------------------------ */
#define SJC_SECOND_P(c) \
(((unsigned char)(c) >= 0x40) && \
((unsigned char)(c) < 0xfd) && \
- ((ungigned char)(c) != 0x7f))
+ ((unsigned char)(c) != 0x7f))
#ifdef MULTIBYTE_CHAR
#define MULTIBYTE_FIRST_P SJC_FIRST_P
/* ------------------------------------------------------------------------ */
/* Memory and String function */
/* ------------------------------------------------------------------------ */
-#include <string.h>
-
-#ifdef NOINDEX
-#define index strchr
-#define rindex strrchr
-#endif /* NOINDEX */
-
-#ifdef NOBSTRING
-#define bcmp(a,b,n) memcmp ((a),(b),(n))
-#define bzero(d,n) memset((d),0,(n))
-#define bcopy(s,d,n) memmove((d),(s),(n))
-#endif /* NOBSTRING */
+#if STDC_HEADERS
+# include <string.h>
+#else
+# ifndef HAVE_STRCHR
+# define strchr index
+# define strrchr rindex
+# endif
+char *strchr (), *strrchr ();
+# ifdef HAVE_MEMCPY
+# define bcmp(a,b,n) memcmp((a),(b),(n))
+# define bzero(d,n) memset((d),0,(n))
+# define bcopy(s,d,n) memmove((d),(s),(n))
+# endif
+#endif
-#ifdef USESTRCASECMP
+#if HAVE_STRCASECMP
#define strucmp(p,q) strcasecmp((p),(q))
#endif
/* alphabet = {0, 1, 2, ..., NC - 1} */
#define CBIT 9 /* $\lfloor \log_2 NC \rfloor + 1$ */
#define USHRT_BIT 16 /* (CHAR_BIT * sizeof(ushort)) */
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
&v_original_size, &v_packed_size);
fflush(nafp);
next_pos = ftell(nafp);
-#ifndef NOFTRUNCATE
+#if HAVE_FTRUNCATE
ftruncate(fileno(nafp), next_pos);
#endif
bcopy(LZHUFF0_METHOD, hdr->method, METHOD_TYPE_STRAGE);
long new_archive_size;
{
char *p;
- p = (char *) rindex(new_archive_name, '/');
+ p = (char *) strrchr(new_archive_name, '/');
p = p ? p + 1 : new_archive_name;
unlink(new_archive_name);
if (rename(temporary_name, p) < 0) {
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
x,e EXtract from archive v verbose\n\
l,v List / Verbose List n not execute\n\
u Update newer files to archive f force (over write at extract)\n\
- d Delete from archive t FILES are TEXT file\n");
-#ifdef SUPPORT_LH6
- fprintf(stderr, "\
+ d Delete from archive t FILES are TEXT file\n\
m Move to archive (means 'ad') o[56] compression method (a/u)\n\
-");
-#endif
-#ifndef SUPPORT_LH6
- fprintf(stderr, "\
- m Move to archive (means 'ad') o use LHarc compatible method (a/u)\n\
-");
-#endif
- fprintf(stderr, "\
c re-Construct new archive w=<dir> specify extract directory (a/u/m/x/e)\n\
p Print to STDOUT from archive d delete FILES after (a/u/c)\n\
t Test file CRC in archive i ignore directory path (x/e)\n\
compress_method = LZHUFF5_METHOD_NUM;
p++;
break;
-#ifdef SUPPORT_LH6
case '6':
compress_method = LZHUFF6_METHOD_NUM;
p++;
break;
-#endif
default:
fprintf(stderr, "LHa: error option o%c\n", p[-1]);
exit(1);
newname[len + n] = '\0';
if (GETSTAT(newname, &fil_stbuf) < 0)
continue;
-#ifdef NO_INODE
+#ifndef HAVE_ST_INO
if ( dp->d_name[0] != '.' ||
(n != 1 &&
(dp->d_name[1] != '.' ||
else
return NULL;
}
- if (p = (char *) rindex(archive_name, '.')) {
+ if (p = (char *) strrchr(archive_name, '.')) {
if (strucmp(".LZH", p) == 0
|| strucmp(".LZS", p) == 0
|| strucmp(".COM", p) == 0 /* DOS SFX */
}
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
close(dirp->dd_fd);
free(dirp);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
extern DIR *opendir();
extern struct direct *readdir();
extern int closedir();
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
chmod(name, hdr->unix_mode);
#endif
- if (!getuid()) {
-#ifndef HAVE_NO_LCHOWN
- if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) != UNIX_FILE_SYMLINK)
- lchown(name, hdr->unix_uid, hdr->unix_gid);
- else
-#endif /* HAVE_NO_LCHWON */
- chown(name, hdr->unix_uid, hdr->unix_gid);
+ if (!getuid()){
+#if HAVE_LCHOWN
+ if ((hdr->unix_mode & UNIX_FILE_TYPEMASK) == UNIX_FILE_SYMLINK)
+ lchown(name, hdr->unix_uid, hdr->unix_gid);
+ else
+#endif
+ chown(name, hdr->unix_uid, hdr->unix_gid);
}
errno = 0;
}
boolean save_quiet, save_verbose, up_flag;
char *q = hdr->name, c;
- if (ignore_directory && rindex(hdr->name, '/')) {
- q = (char *) rindex(hdr->name, '/') + 1;
+ if (ignore_directory && strrchr(hdr->name, '/')) {
+ q = (char *) strrchr(hdr->name, '/') + 1;
}
else {
if (*q == '/') {
return;
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
return;
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
+++ /dev/null
-##############################################################################
-# makefile.dj for LHa on djgpp
-# Copyright(c) 1996 t.okamoto
-##############################################################################
-
-CC = gcc
-O = .o
-
-MACHINE = -DSYSTIME_HAS_NO_TM -DFTIME
-SWITCHES = -DNEED_INCREMENTAL_INDICATOR -DNO_INODE
-OPTIMIZE = -O2
-
-LHOBJS = lharc$(O) lhadd$(O) lhlist$(O) lhext$(O) header$(O)
-HUFOBJS = append$(O) crcio$(O) dhuf$(O) extract$(O) huf$(O) \
- larc$(O) maketbl$(O) maketree$(O) shuf$(O) slide$(O) \
- util$(O) patmatch$(O)
-
-OBJS = $(LHOBJS) $(HUFOBJS) $(LIBRARYOBJS)
-
-CFLAGS = $(OPTIMIZE) $(SWITCHES) $(MACHINE)
-
-.c.o:
- gcc -c $(CFLAGS) $<
-
-all : lha
-
-lha : $(OBJS)
- $(CC) -o $@ $(OBJS) $(LDFLAGS)
-
-$(LHOBJS) append$(O) slide$(O) extract$(O) : lha.h
-
-$(HUFOBJS) : lha.h
-crcio$(O) extract$(O) slide$(O) : lha.h
-
-lhdir$(O) : lhdir.h
-
-$(OBJS) : makefile.dj
-
-clean:
- rm -f core $(OBJS)
-
-moreclean:
- rm -f core *.o lha.tar lha.tar.Z *~ \#* *.orig
start[k] = l;
}
}
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
make_code(nparm, lenparm, codeparm);
return k; /* return root */
}
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
}
return (!*s); /* p exhausted, ret true if s exhausted */
}
+
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
}
return (j << 6) + getbits(6);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
}
free(text);
}
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */
*/
/* ------------------------------------------------------------------------ */
-#ifdef NOSTRDUP
+#ifndef HAVE_STRDUP
char *
strdup(buf)
char *buf;
* Masaru Oki 92.01.28 added mkdir() and rmdir() by Tomohiro Ishikawa
*/
-#if defined(NOFTRUNCATE) && !defined(_MINIX)
+#if !defined(HAVE_FTRUNCATE) && !defined(_MINIX)
/* ------------------------------------------------------------------------ */
int
return (-1);
return (0);
}
-#endif /* NOFTRUNCATE */
+#endif /* !HAVE_FTRUNCATE */
/* ------------------------------------------------------------------------ */
-#ifdef NOMKDIR
+#ifndef HAVE_MKDIR
#ifndef MKDIRPATH
#define MKDIRPATH "/bin/mkdir"
#endif
* strucmp modified: Oct 29 1991 by Masaru Oki
*/
-#ifndef USESTRCASECMP
+#ifndef HAVE_STRCASECMP
static int
my_toupper(n)
register int n;
#endif
/* ------------------------------------------------------------------------ */
-#ifdef NOMEMSET
+#ifndef HAVE_MEMSET
/* Public Domain memset(3) */
char *
memset(s, c, n)
return s;
}
#endif
+/* Local Variables: */
+/* tab-width : 4 */
+/* End: */