+2021-01-29 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ * NEWS:
+ === Version 0.2.13 ===
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Update library versioning
+
+ * configure.ac: Bump library versioning to reflect API addition.
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Rename trie_byte_strlen() to trie_char_strsize().
+
+ The object of the function is TrieChar string. Let's keep
+ that semantics in the name.
+
+ * datrie/trie-string.h, datrie/trie-string.c
+ (trie_byte_strlen -> trie_char_strsize):
+ - Rename the function.
+ * datrie/tail.c (tail_get_serialized_size, tail_serialize):
+ - Replace trie_byte_strlen() calls with the new name.
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Revise test_serialization.
+
+ * tests/test_serialization.c (-trie_enum_mark_rec):
+ - Drop unused callback function.
+ * tests/test_serialization (main):
+ - Drop unused 'is_failed' variable.
+ - "%Ilu" -> "%lu" printf format.
+ - Rearrange error handling in stack unwinding style.
+ - Add '\n' to printf messages.
+ - Free 'trieSerializedData'.
+
+ We're not moving to C99 yet, but the declaration amid code is
+ too useful to remove. And it's just in the test code, not in
+ the main source. So we still allow it.
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Get rid of <unistd.h> include in the new test.
+
+ * tests/test_serialization.c (main):
+ - Replace unlink() calls with remove() from <stdio.h> and drop
+ <unistd.h> include.
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Adjust file-internal function declarations.
+
+ * datrie/fileutils.c
+ (parse_int16_be, serialize_int32_be, serialize_int16_be):
+ - Re-declare functions as static.
+ * datrie/fileutils.c (parse_int16_be):
+ - Make the 'buff' arg const pointer.
+ * datrie/fileutils.c:
+ - Remove some blank lines in source.
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix documentation.
+
+ * datrie/tail.h (Tail typedef):
+ - Fix comment (Double-array -> Tail).
+
+2021-01-24 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Cosmetic changes.
+
+ * datrie/fileutils.c:
+ * datrie/trie-string.c:
+ * datrie/alpha-map.c:
+ * datrie/darray.h:
+ * datrie/darray.c:
+ * datrie/tail.h:
+ * datrie/tail.c:
+ * datrie/trie.c:
+ * tools/trie-tool.c:
+ * tests/test_serialization.c:
+ - Use space before left parenthesis.
+ - Use old-style C comments.
+ - Remove trailing spaces.
+ - Re-wrap lines.
+
+2021-01-23 KOLANICH <KOLANICH@users.noreply.github.com>
+
+ Added serialization of the trie into a memory buffer.
+
+ * datrie/fileutils.c
+ (file_write_int32, +serialize_int32,
+ file_write_int16, +serialize_int16,
+ file_read_int32, +parse_int32_be,
+ file_read_int16, +parse_int16_be):
+ - Split binary read/write operations into separate functions.
+ * datrie/fileutils.h, datrie/fileutils.c
+ (+serialize_int32_be_incr, +serialize_int16_be_incr):
+ - Add serialization utility functions with pointer advancement.
+ * datrie/trie-string.h, datrie/trie-string.c
+ (+trie_byte_strlen):
+ - Add utility method for calculating TrieChar string size in bytes.
+
+ * datrie/alpha-map-private.h, datrie/alpha-map.c
+ (+alpha_map_get_serialized_size, +alpha_map_serialize_bin):
+ - Add AlphaMap serialization methods.
+ * datrie/darray.h, datrie/darray.c
+ (+da_get_serialized_size, +da_serialize):
+ - Add DArray serialization methods.
+ * datrie/tail.h, datrie/tail.c
+ (+tail_get_serialized_size, +tail_serialize):
+ - Add Tail serialization methods.
+ * datrie/trie.h, datrie/trie.c
+ (+trie_get_serialized_size, +trie_serialize):
+ - Add Trie serialization methods.
+ * datrie/libdatrie.map, datrie/libdatrie.def:
+ - Add export symbols for Trie serialization.
+
+ * tests/Makefile.am, +tests/test_serialization.c:
+ - Add serialization test.
+
+ Pull Request #12.
+
+2021-01-22 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Get rid of <unistd.h> include.
+
+ * tests/test_file.c (main):
+ - Replace unlink() calls with remove() from <stdio.h> and drop
+ <unistd.h> include, fixing build issue on Windows.
+
+ Addressing Windows build issue differently from what proposed by
+ @fanc999 in pull request #15. Thanks @fanc999 for first raising this.
+
+2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Use TRIE_CHAR_TERM in TAIL I/O methods.
+
+ * datrie/tail.c (tail_fwrite):
+ - Replace strlen() with trie_char_strlen() on suffix,
+ which is TrieChar string.
+ * datrie/tail.c (tail_fread):
+ - Append TRIE_CHAR_TERM, rather than literal zero,
+ as suffix terminator.
+
+2021-01-15 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Use TRIE_CHAR_TERM in TrieIterator methods.
+
+ * datrie/trie.c (trie_iterator_get_key):
+ - Replace strlen() with trie_char_strlen() on tail_str,
+ which is TrieChar string.
+ - Check tail_str termination against TRIE_CHAR_TERM, not zero.
+
+2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix wrong TRIE_CHAR_TERM semantics.
+
+ * datrie/trie.h (trie_state_is_terminal):
+ - Test for terminal state using zero AlphaChar.
+ TRIE_CHAR_TERM is a TrieChar, although it's also accidentally zero.
+
+2021-01-14 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Reduce loops in alpha_map_recalc_work_area().
+
+ * datrie/alpha-map.c (alpha_map_recalc_work_area):
+ - Instead of pre-filling trie-to-alpha map with errors
+ and setting valid cells afterward, just fill error cells
+ left after valid cells are done. Then, finally set
+ TRIE_CHAR_TERM cell.
+
+2021-01-10 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Rewrite AlphaMap recalc.
+
+ * datrie/alpha-map.c (alpha_map_recalc_work_area):
+ Rewrite alpha-to-trie & trie-to-alpha maps recalculation
+ - For clearer relation between the two maps
+ - To allow other TRIE_CHAR_TERM values than zero
+
+2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Use TRIE_CHAR_TERM macro instead of zero.
+
+ * datrie/alpha-map.c
+ (alpha_map_char_to_trie, alpha_map_char_to_trie_str):
+ * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
+ * datrie/tail.c (tail_walk_str, tail_walk_char):
+ - Use TRIE_CHAR_TERM instead of hard-wired zero when working
+ with raw trie string termination.
+ * datrie/trie-string.c (trie_string_terminate):
+ - Append TRIE_CHAR_TERM instead of simply delegating to
+ dstring_terminate().
+
+2021-01-09 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Share static trie string functions internally.
+
+ * datrie/trie-string.h, datrie/trie-string.c, datrie/tail.c
+ (tc_strlen -> trie_char_strlen, tc_strdup -> trie_char_strdup):
+ - Move private functions in tail.c to trie-string.[ch],
+ with new full names under new "static trie string" section.
+ - Check/assign string terminator using TRIE_CHAR_TERM
+ instead of zero.
+ * datrie/tail.c (tail_set_suffix):
+ - Call the new trie_char_strdup() instead of tc_strdup().
+ * datrie/alpha-map.c (alpha_map_trie_to_char_str):
+ - Call trie_char_strlen() instead of strlen().
+
+2021-01-06 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Get rid of char semantics from TrieChar
+
+ * datrie/trie.c (trie_branch_in_branch, trie_branch_in_tail):
+ - Check null TrieChar with int zero instead of char.
+
+2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Use proper #include form in installed header.
+
+ * datrie/alpha-map.h:
+ - Use angle quotes form instead of double quotes in #include.
+
+2021-01-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix some documentations.
+
+ * datrie/trie.c (trie_is_dirty):
+ - Adjust wording to make clear the file is out of sync,
+ not the other way around.
+ * datrie/trie.c (trie_store, trie_store_if_absent):
+ - Fix typo in the description of 'key' parameter.
+ * datrie/trie.c (trie_store_if_absent):
+ - Minor wording adjustment (inserted, not appended).
+
+2020-12-30 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix isspace() arg problem on NetBSD.
+
+ * tools/trietool.c (command_add_list, string_trim):
+ - Cast char to unsigned char before passing to isspace().
+
+ Thanks Sean <scole_mail@gmx.com> for the report via a personal mail.
+
+2019-12-20 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Use GitHub issue tracker as bug report address.
+
+ * configure.ac:
+ - Replace bug report e-mail address with GitHub issue tracker URL.
+
+2019-08-05 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Stop installing README.migration
+
+ It's supposed to be internal document now.
+
+ * Makefile.am:
+ - Remove README.migration from doc_DATA.
+
+2019-01-21 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix cross-compiling issue caused by AC_FUNC_MALLOC
+
+ * configure.ac:
+ - Replace AC_FUNC_MALLOC with AC_CHECK_FUNCS([malloc]),
+ as we don't rely on GNU's malloc(0) behavior.
+
+ Thanks Vanessa McHale for the report. Closes: #11
+
+2018-11-23 Theppitak Karoonboonyanan <theppitak@gmail.com>
+
+ Fix wrong key listing in byte trie
+
+ * tests/Makefile.am, +tests/test_byte_list.c:
+ - Add test case
+ * datrie/alpha-map.c (alpha_map_recalc_work_area):
+ - Index trie_to_alpha_map[] using TrieIndex, not TrieChar type,
+ to prevent overflow upon incrementing over 0xff.
+ - Drop tc variable and just reuse trie_last.
+
+ Thanks @legale for the report.
+
+ Closes: #9
+ https://github.com/tlwg/libdatrie/issues/9
+
2018-06-19 Theppitak Karoonboonyanan <theppitak@gmail.com>
* configure.ac:
build-aux/git-version-gen \
$(NULL)
-doc_DATA = README.migration
-
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = datrie-0.2.pc
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
-am__installdirs = "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"
-DATA = $(doc_DATA) $(pkgconfig_DATA)
+am__installdirs = "$(DESTDIR)$(pkgconfigdir)"
+DATA = $(pkgconfig_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
- cscope distdir dist dist-all distcheck
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
- $(LISP)config.h.in
+ cscope distdir distdir-am dist dist-all distcheck
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+ config.h.in
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
GZIP_ENV = --best
DIST_ARCHIVES = $(distdir).tar.xz
DIST_TARGETS = dist-xz
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
build-aux/git-version-gen \
$(NULL)
-doc_DATA = README.migration
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = datrie-0.2.pc
all: config.h
echo ' $(SHELL) ./config.status'; \
$(SHELL) ./config.status;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
distclean-libtool:
-rm -f libtool config.lt
-install-docDATA: $(doc_DATA)
- @$(NORMAL_INSTALL)
- @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
- if test -n "$$list"; then \
- echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \
- $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \
- fi; \
- for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- echo "$$d$$p"; \
- done | $(am__base_list) | \
- while read files; do \
- echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \
- $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \
- done
-
-uninstall-docDATA:
- @$(NORMAL_UNINSTALL)
- @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \
- files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir)
install-pkgconfigDATA: $(pkgconfig_DATA)
@$(NORMAL_INSTALL)
@list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
+dist-zstd: distdir
+ tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+ $(am__post_remove_distdir)
+
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
+ *.tar.zst*) \
+ zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(MAKE) $(AM_MAKEFLAGS) \
- && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
all-am: Makefile $(DATA) config.h
installdirs: installdirs-recursive
installdirs-am:
- for dir in "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)"; do \
+ for dir in "$(DESTDIR)$(pkgconfigdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive
info-am:
-install-data-am: install-docDATA install-pkgconfigDATA
+install-data-am: install-pkgconfigDATA
install-dvi: install-dvi-recursive
ps-am:
-uninstall-am: uninstall-docDATA uninstall-pkgconfigDATA
+uninstall-am: uninstall-pkgconfigDATA
.MAKE: $(am__recursive_targets) all install-am install-strip
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \
- dist-tarZ dist-xz dist-zip distcheck distclean \
+ dist-tarZ dist-xz dist-zip dist-zstd distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-tags distcleancheck distdir distuninstallcheck dvi \
dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-docDATA install-dvi \
- install-dvi-am install-exec install-exec-am install-html \
- install-html-am install-info install-info-am install-man \
- install-pdf install-pdf-am install-pkgconfigDATA install-ps \
- install-ps-am install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic mostlyclean mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
- uninstall-am uninstall-docDATA uninstall-pkgconfigDATA
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-pkgconfigDATA install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am tags tags-am uninstall uninstall-am \
+ uninstall-pkgconfigDATA
.PRECIOUS: Makefile
libdatrie
+0.2.13 (2021-01-29)
+======
+- Fix wrong key listing in byte trie
+ (Issue #9, Thanks @legale for the report.)
+- Fix cross-compiling issue caused by AC_FUNC_MALLOC
+ (Issue #11, Thanks Vanessa McHale for the report.)
+- Fix isspace() arg problem on NetBSD.
+ (Personal mail, Thanks Sean for the report;
+ PR #8, Thanks OBATA Akio for an individual pull request.)
+- Fix some documentations.
+- Really use TRIE_CHAR_TERM in TrieChar string termination.
+ Changing TRIE_CHAR_TERM definition now won't break the code.
+- Fix Windows build issue by avoiding <unistd.h> include.
+ (Partially addressing PR #15, Thanks @fanc999 for first raising this.)
+- [New APIs] Add serialization of the trie into memory buffer.
+ (PR #12, Thanks KOLANICH for the contribution.)
+
0.2.12 (2018-06-19)
======
- More C90 (ANSI C) compliance.
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 12
+#serial 13
dnl #########################################################################
AC_DEFUN([AX_COMPARE_VERSION], [
],
[.+],[
AC_WARNING(
- [illegal OP numeric parameter: $2])
+ [invalid OP numeric parameter: $2])
],[])
# Pad zeros at end of numbers to make same length.
[ne],[
test "x$A" != "x$B" && ax_compare_version=true
],[
- AC_WARNING([illegal OP parameter: $2])
+ AC_WARNING([invalid OP parameter: $2])
])
])
fi
]) dnl AX_COMPARE_VERSION
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15.1], [],
+m4_if([$1], [1.16.3], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15.1])dnl
+[AM_AUTOMAKE_VERSION([1.16.3])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ AS_CASE([$CONFIG_FILES],
+ [*\'*], [eval set x "$CONFIG_FILES"],
+ [*], [set x $CONFIG_FILES])
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`AS_DIRNAME("$mf")`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`AS_DIRNAME(["$file"])`
- AS_MKDIR_P([$dirpart/$fdir])
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`AS_DIRNAME(["$am_mf"])`
+ am_filepart=`AS_BASENAME(["$am_mf"])`
+ AM_RUN_LOG([cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles]) || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE="gmake" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).])
+ fi
+ AS_UNSET([am_dirpart])
+ AS_UNSET([am_filepart])
+ AS_UNSET([am_mf])
+ AS_UNSET([am_rc])
+ rm -f conftest-deps.mk
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
-# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
- [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+ [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
fi
AC_SUBST([install_sh])])
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# AM_MAKE_INCLUDE()
# -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
- ;;
- esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+ AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+ ['0:this is the am__doit target'],
+ [AS_CASE([$s],
+ [BSD], [am__include='.include' am__quote='"'],
+ [am__include='include' am__quote=''])])
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
rm -f conftest.file
])
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
])
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-10-14.11; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
MINGW*)
file_conv=mingw
;;
- CYGWIN*)
+ CYGWIN* | MSYS*)
file_conv=cygwin
;;
*)
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
- cygwin/*)
+ cygwin/* | msys/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
echo "compile $scriptversion"
exit $?
;;
- cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+ cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \
+ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2014-09-12.12; # UTC
+scriptversion=2020-11-14.01; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
"
while test $# -ne 0; do
-o) chowncmd="$chownprog $2"
shift;;
+ -p) cpprog="$cpprog -p";;
+
-s) stripcmd=$stripprog;;
+ -S) backupsuffix="$2"
+ shift;;
+
-t)
is_target_a_directory=always
dst_arg=$2
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
fi
posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- # $RANDOM is not portable (e.g. dash); use it when possible to
- # lower collision chance
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
- # create the $tmpdir first (and fail if unsuccessful) to make sure
- # that nobody tries to guess the $tmpdir name.
- if (umask $mkdir_umask &&
- $mkdirprog $mkdir_mode "$tmpdir" &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- test_tmpdir="$tmpdir/a"
- ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+ fi
+ trap '' 0;;
esac
if
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
prefixes=
else
if $posix_mkdir; then
- (umask=$mkdir_umask &&
+ (umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# file should still install successfully.
{
test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.6 Debian-2.4.6-2.1"
+VERSION="2.4.6 Debian-2.4.6-15"
package_revision=2.4.6
# libraries, which are installed to $pkgauxdir.
# Set a version string for this script.
-scriptversion=2015-10-12.13; # UTC
+scriptversion=2015-01-20.17; # UTC
# General shell script boiler plate, and helper functions.
# Written by Gary V. Vaughan, 2004
# putting '$debug_cmd' at the start of all your functions, you can get
# bash to show function call trace with:
#
-# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+# debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
debug_cmd=${debug_cmd-":"}
exit_cmd=:
{
$debug_cmd
- func_quote_arg pretty "$2"
- eval "$1+=\\ \$func_quote_arg_result"
+ func_quote_for_eval "$2"
+ eval "$1+=\\ \$func_quote_for_eval_result"
}'
else
func_append_quoted ()
{
$debug_cmd
- func_quote_arg pretty "$2"
- eval "$1=\$$1\\ \$func_quote_arg_result"
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
}
fi
}
-# func_quote_portable EVAL ARG
-# ----------------------------
-# Internal function to portably implement func_quote_arg. Note that we still
-# keep attention to performance here so we as much as possible try to avoid
-# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
-func_quote_portable ()
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+# i) func_quote_for_eval_result
+# double-quoted, suitable for a subsequent eval
+# ii) func_quote_for_eval_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified.
+func_quote_for_eval ()
{
$debug_cmd
- func_quote_portable_result=$2
-
- # one-time-loop (easy break)
- while true
- do
- if $1; then
- func_quote_portable_result=`$ECHO "$2" | $SED \
- -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
- break
- fi
-
- # Quote for eval.
- case $func_quote_portable_result in
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+ case $1 in
*[\\\`\"\$]*)
- case $func_quote_portable_result in
- *[\[\*\?]*)
- func_quote_portable_result=`$ECHO "$func_quote_portable_result" | $SED "$sed_quote_subst"`
- break
- ;;
- esac
+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+ *)
+ _G_unquoted_arg=$1 ;;
+ esac
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ fi
- func_quote_portable_old_IFS=$IFS
- for _G_char in '\' '`' '"' '$'
- do
- # STATE($1) PREV($2) SEPARATOR($3)
- set start "" ""
- func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
- IFS=$_G_char
- for _G_part in $func_quote_portable_result
- do
- case $1 in
- quote)
- func_append func_quote_portable_result "$3$2"
- set quote "$_G_part" "\\$_G_char"
- ;;
- start)
- set first "" ""
- func_quote_portable_result=
- ;;
- first)
- set quote "$_G_part" ""
- ;;
- esac
- done
- done
- IFS=$func_quote_portable_old_IFS
+ case $_G_unquoted_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_quoted_arg=\"$_G_unquoted_arg\"
;;
- *) ;;
+ *)
+ _G_quoted_arg=$_G_unquoted_arg
+ ;;
esac
- break
- done
- func_quote_portable_unquoted_result=$func_quote_portable_result
- case $func_quote_portable_result in
- # double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and variable expansion
- # for a subsequent eval.
- # many bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_portable_result=\"$func_quote_portable_result\"
- ;;
- esac
+ if test -n "$func_quote_for_eval_result"; then
+ func_append func_quote_for_eval_result " $_G_quoted_arg"
+ else
+ func_append func_quote_for_eval_result "$_G_quoted_arg"
+ fi
+ shift
+ done
}
-# func_quotefast_eval ARG
-# -----------------------
-# Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG',
-# but optimized for speed. Result is stored in $func_quotefast_eval.
-if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
- func_quotefast_eval ()
- {
- printf -v func_quotefast_eval_result %q "$1"
- }
-else
- func_quotefast_eval ()
- {
- func_quote_portable false "$1"
- func_quotefast_eval_result=$func_quote_portable_result
- }
-fi
-
+# func_quote_for_expand ARG
+# -------------------------
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+ $debug_cmd
-# func_quote_arg MODEs ARG
-# ------------------------
-# Quote one ARG to be evaled later. MODEs argument may contain zero ore more
-# specifiers listed below separated by ',' character. This function returns two
-# values:
-# i) func_quote_arg_result
-# double-quoted (when needed), suitable for a subsequent eval
-# ii) func_quote_arg_unquoted_result
-# has all characters that are still active within double
-# quotes backslashified. Available only if 'unquoted' is specified.
-#
-# Available modes:
-# ----------------
-# 'eval' (default)
-# - escape shell special characters
-# 'expand'
-# - the same as 'eval'; but do not quote variable references
-# 'pretty'
-# - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might
-# later used in func_quote to get output like: 'echo "a b"' instead of
-# 'echo a\ b'. This is slower than default on some shells.
-# 'unquoted'
-# - produce also $func_quote_arg_unquoted_result which does not contain
-# wrapping double-quotes.
-#
-# Examples for 'func_quote_arg pretty,unquoted string':
-#
-# string | *_result | *_unquoted_result
-# ------------+-----------------------+-------------------
-# " | \" | \"
-# a b | "a b" | a b
-# "a b" | "\"a b\"" | \"a b\"
-# * | "*" | *
-# z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\"
-#
-# Examples for 'func_quote_arg pretty,unquoted,expand string':
-#
-# string | *_result | *_unquoted_result
-# --------------+---------------------+--------------------
-# z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\"
-func_quote_arg ()
-{
- _G_quote_expand=false
- case ,$1, in
- *,expand,*)
- _G_quote_expand=:
- ;;
+ case $1 in
+ *[\\\`\"]*)
+ _G_arg=`$ECHO "$1" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
+ *)
+ _G_arg=$1 ;;
esac
- case ,$1, in
- *,pretty,*|*,expand,*|*,unquoted,*)
- func_quote_portable $_G_quote_expand "$2"
- func_quote_arg_result=$func_quote_portable_result
- func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
- ;;
- *)
- # Faster quote-for-eval for some shells.
- func_quotefast_eval "$2"
- func_quote_arg_result=$func_quotefast_eval_result
+ case $_G_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting and command substitution for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_arg=\"$_G_arg\"
;;
esac
-}
-
-# func_quote MODEs ARGs...
-# ------------------------
-# Quote all ARGs to be evaled later and join them into single command. See
-# func_quote_arg's description for more info.
-func_quote ()
-{
- $debug_cmd
- _G_func_quote_mode=$1 ; shift
- func_quote_result=
- while test 0 -lt $#; do
- func_quote_arg "$_G_func_quote_mode" "$1"
- if test -n "$func_quote_result"; then
- func_append func_quote_result " $func_quote_arg_result"
- else
- func_append func_quote_result "$func_quote_arg_result"
- fi
- shift
- done
+ func_quote_for_expand_result=$_G_arg
}
_G_cmd=$1
_G_fail_exp=${2-':'}
- func_quote_arg pretty,expand "$_G_cmd"
- eval "func_notquiet $func_quote_arg_result"
+ func_quote_for_expand "$_G_cmd"
+ eval "func_notquiet $func_quote_for_expand_result"
$opt_dry_run || {
eval "$_G_cmd"
_G_fail_exp=${2-':'}
$opt_quiet || {
- func_quote_arg expand,pretty "$_G_cmd"
- eval "func_echo $func_quote_arg_result"
+ func_quote_for_expand "$_G_cmd"
+ eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || {
#! /bin/sh
# Set a version string for this script.
-scriptversion=2015-10-12.13; # UTC
+scriptversion=2015-10-07.11; # UTC
# A portable, pluggable option parser for Bourne shell.
# Written by Gary V. Vaughan, 2010
# '
# # No change in '$@' (ignored completely by this hook). There is
# # no need to do the equivalent (but slower) action:
-# # func_quote eval ${1+"$@"}
-# # my_options_prep_result=$func_quote_result
+# # func_quote_for_eval ${1+"$@"}
+# # my_options_prep_result=$func_quote_for_eval_result
# false
# }
# func_add_hook func_options_prep my_options_prep
# done
#
# if $args_changed; then
-# func_quote eval ${1+"$@"}
-# my_silent_option_result=$func_quote_result
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
# fi
#
# $args_changed
if $_G_rc_options; then
func_options_result=$_G_res_var
else
- func_quote eval ${1+"$@"}
- func_options_result=$func_quote_result
+ func_quote_for_eval ${1+"$@"}
+ func_options_result=$func_quote_for_eval_result
fi
$_G_rc_options
if $_G_rc_parse_options; then
# save modified positional parameters for caller
- func_quote eval ${1+"$@"}
- func_parse_options_result=$func_quote_result
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
fi
$_G_rc_parse_options
compiler: $LTCC
compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld)
- version: $progname $scriptversion Debian-2.4.6-2.1
+ version: $progname $scriptversion Debian-2.4.6-15
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
if $_G_rc_lt_options_prep; then
# Pass back the list of options.
- func_quote eval ${1+"$@"}
- libtool_options_prep_result=$func_quote_result
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
fi
$_G_rc_lt_options_prep
if $_G_rc_lt_parse_options; then
# save modified positional parameters for caller
- func_quote eval ${1+"$@"}
- libtool_parse_options_result=$func_quote_result
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
fi
$_G_rc_lt_parse_options
}
# Pass back the unparsed argument list
- func_quote eval ${1+"$@"}
- libtool_validate_options_result=$func_quote_result
+ func_quote_for_eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_for_eval_result
}
func_add_hook func_validate_options libtool_validate_options
esac
done
- func_quote_arg pretty "$libobj"
- test "X$libobj" != "X$func_quote_arg_result" \
+ func_quote_for_eval "$libobj"
+ test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
&& func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
srcfile=$func_to_tool_file_result
- func_quote_arg pretty "$srcfile"
- qsrcfile=$func_quote_arg_result
+ func_quote_for_eval "$srcfile"
+ qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
if test yes = "$build_libtool_libs"; then
case $nonopt in *shtool*) :;; *) false;; esac
then
# Aesthetically quote it.
- func_quote_arg pretty "$nonopt"
- install_prog="$func_quote_arg_result "
+ func_quote_for_eval "$nonopt"
+ install_prog="$func_quote_for_eval_result "
arg=$1
shift
else
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
- func_quote_arg pretty "$arg"
- func_append install_prog "$func_quote_arg_result"
+ func_quote_for_eval "$arg"
+ func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
esac
# Aesthetically quote the argument.
- func_quote_arg pretty "$arg"
- func_append install_prog " $func_quote_arg_result"
+ func_quote_for_eval "$arg"
+ func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then
- func_quote_arg pretty "$arg2"
+ func_quote_for_eval "$arg2"
fi
- func_append install_shared_prog " $func_quote_arg_result"
+ func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
- func_quote_arg pretty "$install_override_mode"
- func_append install_shared_prog " -m $func_quote_arg_result"
+ func_quote_for_eval "$install_override_mode"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
fi
fi
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
$opt_quiet || {
- func_quote_arg expand,pretty "$relink_command"
- eval "func_echo $func_quote_arg_result"
+ func_quote_for_expand "$relink_command"
+ eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
if test \"\$libtool_execute_magic\" != \"$magic\"; then
file=\"\$0\""
- func_quote_arg pretty "$ECHO"
- qECHO=$func_quote_arg_result
+ qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
$ECHO "\
# A function that is used when there is no print builtin or printf.
\$1
_LTECHO_EOF'
}
- ECHO=$qECHO
+ ECHO=\"$qECHO\"
fi
# Very basic option parsing. These options are (a) specific to
while test "$#" -gt 0; do
arg=$1
shift
- func_quote_arg pretty,unquoted "$arg"
- qarg=$func_quote_arg_unquoted_result
- func_append libtool_args " $func_quote_arg_result"
+ func_quote_for_eval "$arg"
+ qarg=$func_quote_for_eval_unquoted_result
+ func_append libtool_args " $func_quote_for_eval_result"
# If the previous option needs an argument, assign it.
if test -n "$prev"; then
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_arg pretty "$flag"
- func_append arg " $func_quote_arg_result"
- func_append compiler_flags " $func_quote_arg_result"
+ func_quote_for_eval "$flag"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
save_ifs=$IFS; IFS=,
for flag in $args; do
IFS=$save_ifs
- func_quote_arg pretty "$flag"
- func_append arg " $wl$func_quote_arg_result"
- func_append compiler_flags " $wl$func_quote_arg_result"
- func_append linker_flags " $func_quote_arg_result"
+ func_quote_for_eval "$flag"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
done
IFS=$save_ifs
func_stripname ' ' '' "$arg"
# -msg_* for osf cc
-msg_*)
- func_quote_arg pretty "$arg"
- arg=$func_quote_arg_result
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
;;
# Flags to be passed through unchanged, with rationale:
# -specs=* GCC specs files
# -stdlib=* select c++ std lib with clang
# -fsanitize=* Clang/GCC memory and address sanitizer
+ # -fuse-ld=* Linker select flags for GCC
+ # -static-* direct GCC to link specific libraries statically
+ # -fcilkplus Cilk Plus language extension features for C/C++
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
-O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
- -specs=*|-fsanitize=*)
- func_quote_arg pretty "$arg"
- arg=$func_quote_arg_result
+ -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus)
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
continue
else
# Otherwise treat like 'Some other compiler flag' below
- func_quote_arg pretty "$arg"
- arg=$func_quote_arg_result
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
fi
;;
# Some other compiler flag.
-* | +*)
- func_quote_arg pretty "$arg"
- arg=$func_quote_arg_result
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
;;
*.$objext)
*)
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
- func_quote_arg pretty "$arg"
- arg=$func_quote_arg_result
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
;;
esac # arg
for cmd in $concat_cmds; do
IFS=$save_ifs
$opt_quiet || {
- func_quote_arg expand,pretty "$cmd"
- eval "func_echo $func_quote_arg_result"
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
eval cmd=\"$cmd\"
IFS=$save_ifs
$opt_quiet || {
- func_quote_arg expand,pretty "$cmd"
- eval "func_echo $func_quote_arg_result"
+ func_quote_for_expand "$cmd"
+ eval "func_echo $func_quote_for_expand_result"
}
$opt_dry_run || eval "$cmd" || {
lt_exit=$?
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_arg pretty "$var_value"
- relink_command="$var=$func_quote_arg_result; export $var; $relink_command"
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
- func_quote_arg pretty,unquoted "(cd `pwd`; $relink_command)"
- relink_command=$func_quote_arg_unquoted_result
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
fi
# Only actually do things if not in dry run mode.
elif eval var_value=\$$var; test -z "$var_value"; then
relink_command="$var=; export $var; $relink_command"
else
- func_quote_arg pretty,unquoted "$var_value"
- relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command"
+ func_quote_for_eval "$var_value"
+ relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
fi
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- func_quote_arg pretty,unquoted "$relink_command"
- relink_command=$func_quote_arg_unquoted_result
+ relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
if test yes = "$hardcode_automatic"; then
relink_command=
fi
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
{
cat <<END
Usage:
- test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
- [--expect-failure={yes|no}] [--color-tests={yes|no}]
- [--enable-hard-errors={yes|no}] [--]
+ test-driver --test-name NAME --log-file PATH --trs-file PATH
+ [--expect-failure {yes|no}] [--color-tests {yes|no}]
+ [--enable-hard-errors {yes|no}] [--]
TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
END
}
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
/* Have locale_charset() */
#undef HAVE_LOCALE_CHARSET
-/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
- to 0 otherwise. */
+/* Define to 1 if you have the `malloc' function. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to rpl_malloc if the replacement function should be used. */
-#undef malloc
-
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libdatrie 0.2.12.
+# Generated by GNU Autoconf 2.69 for libdatrie 0.2.13.
#
-# Report bugs to <theppitak@gmail.com>.
+# Report bugs to <https://github.com/tlwg/libdatrie/issues>.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
-$0: theppitak@gmail.com about your system, including any
-$0: error possibly output before this message. Then install
-$0: a modern shell, or manually run the script under such a
-$0: shell if you do have one."
+$0: https://github.com/tlwg/libdatrie/issues about your
+$0: system, including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
fi
exit 1
fi
# Identity of this package.
PACKAGE_NAME='libdatrie'
PACKAGE_TARNAME='libdatrie'
-PACKAGE_VERSION='0.2.12'
-PACKAGE_STRING='libdatrie 0.2.12'
-PACKAGE_BUGREPORT='theppitak@gmail.com'
+PACKAGE_VERSION='0.2.13'
+PACKAGE_STRING='libdatrie 0.2.13'
+PACKAGE_BUGREPORT='https://github.com/tlwg/libdatrie/issues'
PACKAGE_URL=''
ac_unique_file="datrie/trie.h"
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
-am__quote
am__include
DEPDIR
OBJEXT
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
ac_subst_files=''
ac_user_opts='
enable_option_checking
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libdatrie 0.2.12 to adapt to many kinds of systems.
+\`configure' configures libdatrie 0.2.13 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libdatrie 0.2.12:";;
+ short | recursive ) echo "Configuration of libdatrie 0.2.13:";;
esac
cat <<\_ACEOF
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
-Report bugs to <theppitak@gmail.com>.
+Report bugs to <https://github.com/tlwg/libdatrie/issues>.
_ACEOF
ac_status=$?
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libdatrie configure 0.2.12
+libdatrie configure 0.2.13
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ---------------------------------- ##
-## Report this to theppitak@gmail.com ##
-## ---------------------------------- ##"
+( $as_echo "## ------------------------------------------------------- ##
+## Report this to https://github.com/tlwg/libdatrie/issues ##
+## ------------------------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libdatrie $as_me 0.2.12, which was
+It was created by libdatrie $as_me 0.2.13, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
-am__api_version='1.15'
+am__api_version='1.16'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
am_aux_dir=`cd "$ac_aux_dir" && pwd`
if test x"${MISSING+set}" != xset; then
- case $am_aux_dir in
- *\ * | *\ *)
- MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
- *)
- MISSING="\${SHELL} $am_aux_dir/missing" ;;
- esac
+ MISSING="\${SHELL} '$am_aux_dir/missing'"
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
# Define the identity of the package.
PACKAGE='libdatrie'
- VERSION='0.2.12'
+ VERSION='0.2.13'
cat >>confdefs.h <<_ACEOF
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
# Library code modified: REVISION++
# Interfaces added: CURRENT++ REVISION=0 AGE++
# Interfaces changed/removed: CURRENT++ REVISION=0 AGE=0
-LT_CURRENT=4
-LT_REVISION=5
-LT_AGE=3
+LT_CURRENT=5
+LT_REVISION=0
+LT_AGE=4
ac_config_commands="$ac_config_commands depfiles"
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
am__doit:
- @echo this is the am__doit target
+ @echo this is the am__doit target >confinc.out
.PHONY: am__doit
END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
am__include="#"
am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
- am__include=include
- am__quote=
- _am_result=GNU
- ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
- echo '.include "confinc"' > confmf
- case `$am_make -s -f confmf 2> /dev/null` in #(
- *the\ am__doit\ target*)
- am__include=.include
- am__quote="\""
- _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+ { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+ (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ case $?:`cat confinc.out 2>/dev/null` in #(
+ '0:this is the am__doit target') :
+ case $s in #(
+ BSD) :
+ am__include='.include' am__quote='"' ;; #(
+ *) :
+ am__include='include' am__quote='' ;;
+esac ;; #(
+ *) :
;;
- esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+ if test "$am__include" != "#"; then
+ _am_result="yes ($s style)"
+ break
+ fi
+done
+rm -f confinc.* confmf.*
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+$as_echo "${_am_result}" >&6; }
# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then :
fi
: ${AR=ar}
-: ${AR_FLAGS=cru}
+: ${AR_FLAGS=cr}
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
- if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
- (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&5
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&5 && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
- echo "$AR cru libconftest.a conftest.o" >&5
- $AR cru libconftest.a conftest.o 2>&5
+ echo "$AR cr libconftest.a conftest.o" >&5
+ $AR cr libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+ 10.0,*86*-darwin8*|10.0,*-darwin[912]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[012][,.]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
+ 10.*|11.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-static'
;;
+ # flang / f18. f95 an alias for gfortran or flang on Debian
+ flang* | f18* | f95*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
# Checks for library functions.
-for ac_header in stdlib.h
+for ac_func in malloc
do :
- ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
+ ac_fn_c_check_func "$LINENO" "malloc" "ac_cv_func_malloc"
+if test "x$ac_cv_func_malloc" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
+#define HAVE_MALLOC 1
_ACEOF
fi
-
done
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- if test "$cross_compiling" = yes; then :
- ac_cv_func_malloc_0_nonnull=no
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-# include <stdlib.h>
-#else
-char *malloc ();
-#endif
-
-int
-main ()
-{
-return ! malloc (0);
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
- ac_cv_func_malloc_0_nonnull=yes
-else
- ac_cv_func_malloc_0_nonnull=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
- conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-if test $ac_cv_func_malloc_0_nonnull = yes; then :
-
-$as_echo "#define HAVE_MALLOC 1" >>confdefs.h
-
-else
- $as_echo "#define HAVE_MALLOC 0" >>confdefs.h
-
- case " $LIBOBJS " in
- *" malloc.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS malloc.$ac_objext"
- ;;
-esac
-
-
-$as_echo "#define malloc rpl_malloc" >>confdefs.h
-
-fi
-
-
ac_config_files="$ac_config_files Makefile datrie-0.2.pc datrie/Makefile tools/Makefile man/Makefile doc/Makefile doc/Doxyfile tests/Makefile"
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libdatrie $as_me 0.2.12, which was
+This file was extended by libdatrie $as_me 0.2.13, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Configuration commands:
$config_commands
-Report bugs to <theppitak@gmail.com>."
+Report bugs to <https://github.com/tlwg/libdatrie/issues>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libdatrie config.status 0.2.12
+libdatrie config.status 0.2.13
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
#
# INIT-COMMANDS
#
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
# The HP-UX ksh and POSIX shell print the target directory to stdout
# Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
- case $CONFIG_FILES in
- *\'*) eval set x "$CONFIG_FILES" ;;
- *) set x $CONFIG_FILES ;;
- esac
+ # TODO: see whether this extra hack can be removed once we start
+ # requiring Autoconf 2.70 or later.
+ case $CONFIG_FILES in #(
+ *\'*) :
+ eval set x "$CONFIG_FILES" ;; #(
+ *) :
+ set x $CONFIG_FILES ;; #(
+ *) :
+ ;;
+esac
shift
- for mf
+ # Used to flag and report bootstrapping failures.
+ am_rc=0
+ for am_mf
do
# Strip MF so we end up with the name of the file.
- mf=`echo "$mf" | sed -e 's/:.*$//'`
- # Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named 'Makefile.in', but
- # some people rename them; so instead we look at the file content.
- # Grep'ing the first line is not enough: some people post-process
- # each Makefile.in and add a new line on top of each file to say so.
- # Grep'ing the whole file is not good either: AIX grep has a line
+ am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile which includes
+ # dependency-tracking related rules and includes.
+ # Grep'ing the whole file directly is not great: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
- if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
- dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$mf" : 'X\(//\)[^/]' \| \
- X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+ sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+ || continue
+ am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$am_mf" : 'X\(//\)[^/]' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$am_mf" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
q
}
s/.*/./; q'`
- else
- continue
- fi
- # Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running 'make'.
- DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
- test -z "$DEPDIR" && continue
- am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "$am__include" && continue
- am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # Find all dependency output files, they are included files with
- # $(DEPDIR) in their names. We invoke sed twice because it is the
- # simplest approach to changing $(DEPDIR) to its actual value in the
- # expansion.
- for file in `sed -n "
- s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
- # Make sure the directory exists.
- test -f "$dirpart/$file" && continue
- fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$file" : 'X\(//\)[^/]' \| \
- X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
+ am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$am_mf" : 'X\(//\)$' \| \
+ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$am_mf" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
- /^X\(\/\/\)$/{
+ /^X\/\(\/\/\)$/{
s//\1/
q
}
- /^X\(\/\).*/{
+ /^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
- as_dir=$dirpart/$fdir; as_fn_mkdir_p
- # echo "creating $dirpart/$file"
- echo '# dummy' > "$dirpart/$file"
- done
+ { echo "$as_me:$LINENO: cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles" >&5
+ (cd "$am_dirpart" \
+ && sed -e '/# am--include-marker/d' "$am_filepart" \
+ | $MAKE -f - am--depfiles) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } || am_rc=$?
done
+ if test $am_rc -ne 0; then
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+ for automatic dependency tracking. If GNU make was not used, consider
+ re-running the configure script with MAKE=\"gmake\" (or whatever is
+ necessary). You can also try re-running configure with the
+ '--disable-dependency-tracking' option to at least be able to build
+ the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+ fi
+ { am_dirpart=; unset am_dirpart;}
+ { am_filepart=; unset am_filepart;}
+ { am_mf=; unset am_mf;}
+ { am_rc=; unset am_rc;}
+ rm -f conftest-deps.mk
}
;;
"libtool":C)
AC_PREREQ(2.59)
AC_INIT(libdatrie,
m4_esyscmd([build-aux/git-version-gen]),
- theppitak@gmail.com)
+ [https://github.com/tlwg/libdatrie/issues])
AC_CONFIG_SRCDIR([datrie/trie.h])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_AUX_DIR(build-aux)
# Library code modified: REVISION++
# Interfaces added: CURRENT++ REVISION=0 AGE++
# Interfaces changed/removed: CURRENT++ REVISION=0 AGE=0
-LT_CURRENT=4
-LT_REVISION=5
-LT_AGE=3
+LT_CURRENT=5
+LT_REVISION=0
+LT_AGE=4
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AM_CONDITIONAL(ENABLE_DOXYGEN_DOC,test "x$enable_doxygen_doc" = "xyes")
# Checks for library functions.
-AC_FUNC_MALLOC
+AC_CHECK_FUNCS([malloc])
AC_CONFIG_FILES([Makefile
datrie-0.2.pc
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/alpha-map.Plo ./$(DEPDIR)/darray.Plo \
+ ./$(DEPDIR)/dstring.Plo ./$(DEPDIR)/fileutils.Plo \
+ ./$(DEPDIR)/tail.Plo ./$(DEPDIR)/trie-string.Plo \
+ ./$(DEPDIR)/trie.Plo
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha-map.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darray.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstring.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileutils.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trie-string.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trie.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alpha-map.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/darray.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dstring.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileutils.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tail.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trie-string.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trie.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/alpha-map.Plo
+ -rm -f ./$(DEPDIR)/darray.Plo
+ -rm -f ./$(DEPDIR)/dstring.Plo
+ -rm -f ./$(DEPDIR)/fileutils.Plo
+ -rm -f ./$(DEPDIR)/tail.Plo
+ -rm -f ./$(DEPDIR)/trie-string.Plo
+ -rm -f ./$(DEPDIR)/trie.Plo
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/alpha-map.Plo
+ -rm -f ./$(DEPDIR)/darray.Plo
+ -rm -f ./$(DEPDIR)/dstring.Plo
+ -rm -f ./$(DEPDIR)/fileutils.Plo
+ -rm -f ./$(DEPDIR)/tail.Plo
+ -rm -f ./$(DEPDIR)/trie-string.Plo
+ -rm -f ./$(DEPDIR)/trie.Plo
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
.MAKE: install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
- clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libLTLIBRARIES clean-libtool cscopelist-am \
+ ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
int alpha_map_fwrite_bin (const AlphaMap *alpha_map, FILE *file);
+size_t alpha_map_get_serialized_size (const AlphaMap *alpha_map);
+
+void alpha_map_serialize_bin (const AlphaMap *alpha_map, uint8 **ptr);
+
+
TrieIndex alpha_map_char_to_trie (const AlphaMap *alpha_map,
AlphaChar ac);
#include "alpha-map-private.h"
#include "trie-private.h"
#include "fileutils.h"
+#include "trie-string.h"
/**
* @brief Alphabet string length
* to compare
*
* @return negative if @a str1 < @a str2;
- * 0 if @a str1 == @a str2;
+ * 0 if @a str1 == @a str2;
* positive if @a str1 > @a str2
*
* Available since: 0.2.7
return 0;
}
+size_t
+alpha_map_get_serialized_size (const AlphaMap *alpha_map)
+{
+ int32 ranges_count = alpha_map_get_total_ranges (alpha_map);
+ return (
+ 4 /* ALPHAMAP_SIGNATURE */
+ + sizeof (ranges_count)
+ + (sizeof (AlphaChar) * 2) * ranges_count /* range->begin, range->end */
+ );
+}
+
+void
+alpha_map_serialize_bin (const AlphaMap *alpha_map, uint8 **ptr)
+{
+ AlphaRange *range;
+ serialize_int32_be_incr (ptr, ALPHAMAP_SIGNATURE);
+ serialize_int32_be_incr (ptr, alpha_map_get_total_ranges (alpha_map));
+
+ for (range = alpha_map->first_range; range; range = range->next) {
+ serialize_int32_be_incr (ptr, range->begin);
+ serialize_int32_be_incr (ptr, range->end);
+ }
+}
+
static int
alpha_map_add_range_only (AlphaMap *alpha_map, AlphaChar begin, AlphaChar end)
{
range = alpha_map->first_range;
if (range) {
const AlphaChar alpha_begin = range->begin;
- int n_cells, i;
+ int n_alpha, n_trie, i;
AlphaChar a;
- TrieIndex trie_last = 0;
- TrieChar tc;
+ TrieIndex trie_char;
- /* reconstruct alpha-to-trie map */
alpha_map->alpha_begin = alpha_begin;
- while (range->next) {
+ n_trie = 0;
+ for ( ;; ) {
+ n_trie += range->end - range->begin + 1;
+ if (!range->next)
+ break;
range = range->next;
}
+ if (n_trie < TRIE_CHAR_TERM) {
+ n_trie = TRIE_CHAR_TERM + 1;
+ } else {
+ n_trie++;
+ }
alpha_map->alpha_end = range->end;
- alpha_map->alpha_map_sz = n_cells = range->end - alpha_begin + 1;
+
+ alpha_map->alpha_map_sz = n_alpha = range->end - alpha_begin + 1;
alpha_map->alpha_to_trie_map
- = (TrieIndex *) malloc (n_cells * sizeof (TrieIndex));
+ = (TrieIndex *) malloc (n_alpha * sizeof (TrieIndex));
if (UNLIKELY (!alpha_map->alpha_to_trie_map))
goto error_alpha_map_not_created;
- for (i = 0; i < n_cells; i++) {
+ for (i = 0; i < n_alpha; i++) {
alpha_map->alpha_to_trie_map[i] = TRIE_INDEX_MAX;
}
- for (range = alpha_map->first_range; range; range = range->next) {
- for (a = range->begin; a <= range->end; a++) {
- alpha_map->alpha_to_trie_map[a - alpha_begin] = ++trie_last;
- }
- }
- /* reconstruct trie-to-alpha map */
- alpha_map->trie_map_sz = n_cells = trie_last + 1;
+ alpha_map->trie_map_sz = n_trie;
alpha_map->trie_to_alpha_map
- = (AlphaChar *) malloc (n_cells * sizeof (AlphaChar));
+ = (AlphaChar *) malloc (n_trie * sizeof (AlphaChar));
if (UNLIKELY (!alpha_map->trie_to_alpha_map))
goto error_alpha_map_created;
- alpha_map->trie_to_alpha_map[0] = 0;
- tc = 1;
+
+ trie_char = 0;
for (range = alpha_map->first_range; range; range = range->next) {
for (a = range->begin; a <= range->end; a++) {
- alpha_map->trie_to_alpha_map[tc++] = a;
+ if (TRIE_CHAR_TERM == trie_char)
+ trie_char++;
+ alpha_map->alpha_to_trie_map[a - alpha_begin] = trie_char;
+ alpha_map->trie_to_alpha_map[trie_char] = a;
+ trie_char++;
}
}
+ while (trie_char < n_trie) {
+ alpha_map->trie_to_alpha_map[trie_char++] = ALPHA_CHAR_ERROR;
+ }
+ alpha_map->trie_to_alpha_map[TRIE_CHAR_TERM] = 0;
}
return 0;
TrieIndex alpha_begin;
if (UNLIKELY (0 == ac))
- return 0;
+ return TRIE_CHAR_TERM;
if (UNLIKELY (!alpha_map->alpha_to_trie_map))
return TRIE_INDEX_MAX;
goto error_str_allocated;
*p = (TrieChar) tc;
}
- *p = 0;
+ *p = TRIE_CHAR_TERM;
return trie_str;
{
AlphaChar *alpha_str, *p;
- alpha_str = (AlphaChar *) malloc ((strlen ((const char *)str) + 1)
+ alpha_str = (AlphaChar *) malloc ((trie_char_strlen (str) + 1)
* sizeof (AlphaChar));
if (UNLIKELY (!alpha_str))
return NULL;
#include <stdio.h>
-#include "typedefs.h"
-#include "triedefs.h"
+#include <datrie/triedefs.h>
#ifdef __cplusplus
extern "C" {
}
+size_t
+da_get_serialized_size (const DArray *d)
+{
+ if (d->num_cells > 0)
+ return 4 * d->num_cells * 2; /* 'base' and 'check' */
+ else
+ return 0;
+}
+
+
+void
+da_serialize (const DArray *d, uint8 **ptr)
+{
+ TrieIndex i;
+
+ for (i = 0; i < d->num_cells; i++) {
+ serialize_int32_be_incr (ptr, d->cells[i].base);
+ serialize_int32_be_incr (ptr, d->cells[i].check);
+ }
+}
+
+
/**
* @brief Get root state
*
void da_free (DArray *d);
+size_t da_get_serialized_size (const DArray *d);
+
+void da_serialize (const DArray *d, uint8 **ptr);
+
int da_fwrite (const DArray *d, FILE *file);
* FUNCTIONS IMPLEMENTATIONS *
*--------------------------------*/
+static int32
+parse_int32_be (const uint8 *buff)
+{
+ return (buff[0] << 24) | (buff[1] << 16) | (buff[2] << 8) | buff[3];
+}
+
Bool
file_read_int32 (FILE *file, int32 *o_val)
{
- unsigned char buff[4];
+ uint8 buff[4];
if (fread (buff, 4, 1, file) == 1) {
- *o_val = (buff[0] << 24) | (buff[1] << 16) | (buff[2] << 8) | buff[3];
+ *o_val = parse_int32_be (buff);
return TRUE;
}
return FALSE;
}
-Bool
-file_write_int32 (FILE *file, int32 val)
+static void
+serialize_int32_be (uint8 *buff, int32 val)
{
- unsigned char buff[4];
-
buff[0] = (val >> 24) & 0xff;
buff[1] = (val >> 16) & 0xff;
buff[2] = (val >> 8) & 0xff;
buff[3] = val & 0xff;
+}
+
+void
+serialize_int32_be_incr (uint8 **buff, int32 val)
+{
+ serialize_int32_be (*buff, val);
+ *buff += 4; /* don't sizeof! */
+}
+
+Bool
+file_write_int32 (FILE *file, int32 val)
+{
+ uint8 buff[4];
+ serialize_int32_be (buff, val);
return (fwrite (buff, 4, 1, file) == 1);
}
+static int16
+parse_int16_be (const uint8 *buff)
+{
+ return (buff[0] << 8) | buff[1];
+}
+
Bool
file_read_int16 (FILE *file, int16 *o_val)
{
- unsigned char buff[2];
+ uint8 buff[2];
if (fread (buff, 2, 1, file) == 1) {
- *o_val = (buff[0] << 8) | buff[1];
+ *o_val = parse_int16_be (buff);
return TRUE;
}
return FALSE;
}
-Bool
-file_write_int16 (FILE *file, int16 val)
+static void
+serialize_int16_be (uint8 *buff, int16 val)
{
- unsigned char buff[2];
-
buff[0] = val >> 8;
buff[1] = val & 0xff;
+}
+void
+serialize_int16_be_incr (uint8 **buff, int16 val)
+{
+ serialize_int16_be (*buff, val);
+ *buff += 2; /* don't sizeof! */
+}
+
+Bool
+file_write_int16 (FILE *file, int16 val)
+{
+ uint8 buff[2];
+ serialize_int16_be (buff, val);
return (fwrite (buff, 2, 1, file) == 1);
}
#include <stdio.h>
#include <datrie/typedefs.h>
+void serialize_int32_be_incr (uint8 **buff, int32 val);
Bool file_read_int32 (FILE *file, int32 *o_val);
Bool file_write_int32 (FILE *file, int32 val);
+void serialize_int16_be_incr (uint8 **buff, int16 val);
Bool file_read_int16 (FILE *file, int16 *o_val);
Bool file_write_int16 (FILE *file, int16 val);
trie_new_from_file
trie_fread
trie_free
+trie_get_serialized_size
+trie_serialize
trie_save
trie_fwrite
trie_is_dirty
alpha_char_strcmp;
} DATRIE_0.2.6;
+DATRIE_0.2.13 {
+ trie_get_serialized_size;
+ trie_serialize;
+} DATRIE_0.2.7;
#include "tail.h"
#include "trie-private.h"
#include "fileutils.h"
+#include "trie-string.h"
/*----------------------------------*
* INTERNAL TYPES DECLARATIONS *
goto exit_in_loop;
}
}
- t->tails[i].suffix[length] = '\0';
+ t->tails[i].suffix[length] = TRIE_CHAR_TERM;
}
return t;
return -1;
}
- length = t->tails[i].suffix ? strlen ((const char *)t->tails[i].suffix)
+ length = t->tails[i].suffix ? trie_char_strlen (t->tails[i].suffix)
: 0;
if (!file_write_int16 (file, length))
return -1;
}
+size_t
+tail_get_serialized_size (const Tail *t)
+{
+ size_t static_count = (
+ sizeof (int32) /* sizeof (TAIL_SIGNATURE) */
+ + sizeof (t->first_free)
+ + sizeof (t->num_tails)
+ );
+ size_t dynamic_count = 0u;
+ if (t->num_tails > 0) {
+ TrieIndex i = 0;
+ dynamic_count += (
+ sizeof (t->tails[i].next_free) + sizeof (t->tails[i].data)
+ + sizeof (int16) /* length */
+ ) * t->num_tails;
+ for (; i < t->num_tails; i++) {
+ if (t->tails[i].suffix)
+ {
+ dynamic_count += trie_char_strsize (t->tails[i].suffix);
+ }
+ }
+ }
+ return static_count + dynamic_count;
+}
+
+
+int
+tail_serialize (const Tail *t, uint8 **ptr)
+{
+ TrieIndex i;
+
+ serialize_int32_be_incr (ptr, TAIL_SIGNATURE);
+ serialize_int32_be_incr (ptr, t->first_free);
+ serialize_int32_be_incr (ptr, t->num_tails);
+
+ for (i = 0; i < t->num_tails; i++) {
+ int16 length;
+ serialize_int32_be_incr (ptr, t->tails[i].next_free);
+ serialize_int32_be_incr (ptr, t->tails[i].data);
+
+ length = t->tails[i].suffix ? trie_char_strsize (t->tails[i].suffix)
+ : 0;
+ serialize_int16_be_incr (ptr, length);
+ if (length)
+ {
+ memcpy (*ptr, (char *)t->tails[i].suffix, length);
+ *ptr += length;
+ }
+ }
+
+ return 0;
+}
+
+
/**
* @brief Get suffix
*
return LIKELY (index < t->num_tails) ? t->tails[index].suffix : NULL;
}
-static size_t
-tc_strlen (const TrieChar *str)
-{
- size_t len = 0;
- while (*str++) {
- ++len;
- }
- return len;
-}
-
-static TrieChar *
-tc_strdup (const TrieChar *str)
-{
- TrieChar *dup
- = (TrieChar *) malloc (sizeof (TrieChar) * (tc_strlen (str) + 1));
- TrieChar *p = dup;
-
- while (*str) {
- *p++ = *str++;
- }
- *p = (TrieChar) 0;
-
- return dup;
-}
-
/**
* @brief Set suffix of existing entry
*
*/
TrieChar *tmp = NULL;
if (suffix) {
- tmp = tc_strdup (suffix);
+ tmp = trie_char_strdup (suffix);
if (UNLIKELY (!tmp))
return FALSE;
}
break;
++i;
/* stop and stay at null-terminator */
- if (0 == suffix[j])
+ if (TRIE_CHAR_TERM == suffix[j])
break;
++j;
}
suffix_char = suffix[*suffix_idx];
if (suffix_char == c) {
- if (0 != suffix_char)
+ if (TRIE_CHAR_TERM != suffix_char)
++*suffix_idx;
return TRUE;
}
*/
/**
- * @brief Double-array structure type
+ * @brief Tail structure type
*/
typedef struct _Tail Tail;
void tail_free (Tail *t);
+size_t tail_get_serialized_size (const Tail *t);
+
+int tail_serialize (const Tail *t, uint8 **ptr);
+
int tail_fwrite (const Tail *t, FILE *file);
#include "triedefs.h"
#include <string.h>
+#include <stdlib.h>
+/*----------------------------*
+ * STATIC TRIECHAR STRING *
+ *----------------------------*/
+
+size_t
+trie_char_strlen (const TrieChar *str)
+{
+ size_t len = 0;
+ while (*str++ != TRIE_CHAR_TERM) {
+ ++len;
+ }
+ return len;
+}
+
+size_t
+trie_char_strsize (const TrieChar *str)
+{
+ return trie_char_strlen (str) * sizeof (TrieChar);
+}
+
+TrieChar *
+trie_char_strdup (const TrieChar *str)
+{
+ TrieChar *dup
+ = (TrieChar *) malloc (sizeof (TrieChar) * (trie_char_strlen (str) + 1));
+ TrieChar *p = dup;
+
+ while (*str != TRIE_CHAR_TERM) {
+ *p++ = *str++;
+ }
+ *p = TRIE_CHAR_TERM;
+
+ return dup;
+}
+
+/*-----------------------------*
+ * DYNAMIC TRIECHAR STRING *
+ *-----------------------------*/
struct _TrieString {
DString ds;
Bool
trie_string_terminate (TrieString *ts)
{
- return dstring_terminate ((DString *)ts);
+ static const TrieChar term = TRIE_CHAR_TERM;
+ return dstring_append_char ((DString *)ts, &term);
}
Bool
#include "dstring.h"
#include "triedefs.h"
+#include <stddef.h>
+
+/*----------------------------*
+ * STATIC TRIECHAR STRING *
+ *----------------------------*/
+
+size_t trie_char_strlen (const TrieChar *str);
+
+size_t trie_char_strsize (const TrieChar *str);
+
+TrieChar * trie_char_strdup (const TrieChar *str);
+
+/*-----------------------------*
+ * DYNAMIC TRIECHAR STRING *
+ *-----------------------------*/
+
typedef struct _TrieString TrieString;
TrieString * trie_string_new (int n_elm);
return res;
}
+
+/**
+ * @brief Get trie serialized size
+ *
+ * @param trie : the trie
+ *
+ * @return size of the trie in bytes
+ *
+ * Returns size that would be occupied by a trie if it was
+ * serialized into a binary blob or file.
+ *
+ * Available since: 0.2.13
+ */
+size_t
+trie_get_serialized_size (Trie *trie)
+{
+ return alpha_map_get_serialized_size (trie->alpha_map)
+ + da_get_serialized_size (trie->da)
+ + tail_get_serialized_size (trie->tail);
+}
+
+
+/**
+ * @brief Serializes trie data into a memory buffer (including mapping)
+ *
+ * @param trie : the trie
+ *
+ * @param ptr : a pointer to current position inside of a preallocated buffer.
+ *
+ * Write @a trie data to a current position in a buffer pointed by @a ptr.
+ * This can be useful for embedding trie index as part of a file data.
+ *
+ * The size that the trie will occupy can be calculated using
+ * trie_get_serialized_size()
+ *
+ * Available since: 0.2.13
+ */
+void
+trie_serialize (Trie *trie, uint8 *ptr)
+{
+ uint8 *ptr1 = ptr;
+ alpha_map_serialize_bin (trie->alpha_map, &ptr1);
+ da_serialize (trie->da, &ptr1);
+ tail_serialize (trie->tail, &ptr1);
+ trie->is_dirty = FALSE;
+}
+
+
/**
* @brief Write trie data to an open file
*
* @return TRUE if there are pending changes, FALSE otherwise
*
* Check if the @a trie is dirty with some pending changes and needs saving
- * to synchronize with the file.
+ * to keep the file synchronized.
*/
Bool
trie_is_dirty (const Trie *trie)
* @brief Store a value for an entry to trie
*
* @param trie : the trie
- * @param key : the key for the entry to retrieve
+ * @param key : the key for the entry to store
* @param data : the data associated to the entry
*
* @return boolean value indicating the success of the operation
* @brief Store a value for an entry to trie only if the key is not present
*
* @param trie : the trie
- * @param key : the key for the entry to retrieve
+ * @param key : the key for the entry to store
* @param data : the data associated to the entry
*
* @return boolean value indicating the success of the operation
*
* Store a @a data for the given @a key in @a trie. If @a key does not
- * exist in @a trie, it will be appended. If it does, the function will
+ * exist in @a trie, it will be inserted. If it does, the function will
* return failure and the existing value will not be touched.
*
* This can be useful for multi-thread applications, as race condition
if (TRIE_INDEX_ERROR == new_da)
return FALSE;
- if ('\0' != *suffix)
+ if (TRIE_CHAR_TERM != *suffix)
++suffix;
new_tail = tail_add_suffix (trie->tail, suffix);
if (TRIE_INDEX_ERROR == old_da)
goto fail;
- if ('\0' != *p)
+ if (TRIE_CHAR_TERM != *p)
++p;
tail_set_suffix (trie->tail, old_tail, p);
trie_da_set_tail_index (trie->da, old_da, old_tail);
tail_str += s->suffix_idx;
alpha_key = (AlphaChar *) malloc (sizeof (AlphaChar)
- * (strlen ((const char *)tail_str)
- + 1));
+ * (trie_char_strlen (tail_str) + 1));
alpha_p = alpha_key;
} else {
TrieIndex tail_idx;
key_p = trie_string_get_val (iter->key);
alpha_key = (AlphaChar *) malloc (
sizeof (AlphaChar)
- * (key_len + strlen ((const char *)tail_str) + 1)
+ * (key_len + trie_char_strlen (tail_str) + 1)
);
alpha_p = alpha_key;
for (i = key_len; i > 0; i--) {
}
}
- while (*tail_str) {
+ while (TRIE_CHAR_TERM != *tail_str) {
*alpha_p++ = alpha_map_trie_to_char (s->trie->alpha_map, *tail_str++);
}
*alpha_p = 0;
void trie_free (Trie *trie);
+size_t trie_get_serialized_size (Trie *trie);
+
+void trie_serialize (Trie *trie, uint8 *ptr);
+
int trie_save (Trie *trie, const char *path);
int trie_fwrite (Trie *trie, FILE *file);
* Check if the given state is a terminal state. A terminal state is a trie
* state that terminates a key, and stores a value associated with it.
*/
-#define trie_state_is_terminal(s) trie_state_is_walkable((s),TRIE_CHAR_TERM)
+#define trie_state_is_terminal(s) trie_state_is_walkable((s),0)
Bool trie_state_is_single (const TrieState *s);
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
- echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
- $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+ echo "$AR cr libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+ $AR cr libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
$RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
cat > conftest.c << _LT_EOF
# to the OS version, if on x86, and 10.4, the deployment
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
- 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+ 10.0,*86*-darwin8*|10.0,*-darwin[[912]]*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
10.[[012]][[,.]]*)
_lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
- 10.*)
+ 10.*|11.*)
_lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
m4_defun([_LT_PROG_AR],
[AC_CHECK_TOOLS(AR, [ar], false)
: ${AR=ar}
-: ${AR_FLAGS=cru}
+: ${AR_FLAGS=cr}
_LT_DECL([], [AR], [1], [The archiver])
_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
if AC_TRY_EVAL(ac_compile); then
# Now try to grab the symbols.
nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+ $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+ if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
# Try sorting and uniquifying the output.
if sort "$nlist" | uniq > "$nlist"T; then
mv -f "$nlist"T "$nlist"
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
;;
+ # flang / f18. f95 an alias for gfortran or flang on Debian
+ flang* | f18* | f95*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
# icc used to be incompatible with GCC.
# ICC 10 doesn't accept -KPIC any more.
icc* | ifort*)
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
GXX=no
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
if test yes = "$GXX"; then
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# FIXME: insert proper C++ library support
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
else
# g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
- output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
fi
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cscope cscopelist:
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
test_iterator \
test_store-retrieve \
test_file \
+ test_serialization \
test_nonalpha \
test_null_trie \
test_term_state \
test_byte_alpha \
+ test_byte_list \
$(NULL)
check_PROGRAMS = \
test_iterator \
test_store-retrieve \
test_file \
+ test_serialization \
test_nonalpha \
test_null_trie \
test_term_state \
test_byte_alpha \
+ test_byte_list \
$(NULL)
noinst_HEADERS = \
$(NULL)
test_file_LDADD = $(top_builddir)/datrie/libdatrie.la
+test_serialization_SOURCES = \
+ test_serialization.c \
+ utils.c \
+ $(NULL)
+test_serialization_LDADD = $(top_builddir)/datrie/libdatrie.la
+
test_nonalpha_SOURCES = \
test_nonalpha.c \
utils.c \
$(NULL)
test_byte_alpha_LDADD = $(top_builddir)/datrie/libdatrie.la
+test_byte_list_SOURCES = \
+ test_byte_list.c \
+ utils.c \
+ $(NULL)
+test_byte_list_LDADD = $(top_builddir)/datrie/libdatrie.la
+
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
host_triplet = @host@
TESTS = test_walk$(EXEEXT) test_iterator$(EXEEXT) \
test_store-retrieve$(EXEEXT) test_file$(EXEEXT) \
- test_nonalpha$(EXEEXT) test_null_trie$(EXEEXT) \
- test_term_state$(EXEEXT) test_byte_alpha$(EXEEXT)
+ test_serialization$(EXEEXT) test_nonalpha$(EXEEXT) \
+ test_null_trie$(EXEEXT) test_term_state$(EXEEXT) \
+ test_byte_alpha$(EXEEXT) test_byte_list$(EXEEXT)
check_PROGRAMS = test_walk$(EXEEXT) test_iterator$(EXEEXT) \
test_store-retrieve$(EXEEXT) test_file$(EXEEXT) \
- test_nonalpha$(EXEEXT) test_null_trie$(EXEEXT) \
- test_term_state$(EXEEXT) test_byte_alpha$(EXEEXT)
+ test_serialization$(EXEEXT) test_nonalpha$(EXEEXT) \
+ test_null_trie$(EXEEXT) test_term_state$(EXEEXT) \
+ test_byte_alpha$(EXEEXT) test_byte_list$(EXEEXT)
subdir = tests
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
+am_test_byte_list_OBJECTS = test_byte_list.$(OBJEXT) utils.$(OBJEXT)
+test_byte_list_OBJECTS = $(am_test_byte_list_OBJECTS)
+test_byte_list_DEPENDENCIES = $(top_builddir)/datrie/libdatrie.la
am_test_file_OBJECTS = test_file.$(OBJEXT) utils.$(OBJEXT)
test_file_OBJECTS = $(am_test_file_OBJECTS)
test_file_DEPENDENCIES = $(top_builddir)/datrie/libdatrie.la
am_test_null_trie_OBJECTS = test_null_trie.$(OBJEXT) utils.$(OBJEXT)
test_null_trie_OBJECTS = $(am_test_null_trie_OBJECTS)
test_null_trie_DEPENDENCIES = $(top_builddir)/datrie/libdatrie.la
+am_test_serialization_OBJECTS = test_serialization.$(OBJEXT) \
+ utils.$(OBJEXT)
+test_serialization_OBJECTS = $(am_test_serialization_OBJECTS)
+test_serialization_DEPENDENCIES = $(top_builddir)/datrie/libdatrie.la
am_test_store_retrieve_OBJECTS = test_store-retrieve.$(OBJEXT) \
utils.$(OBJEXT)
test_store_retrieve_OBJECTS = $(am_test_store_retrieve_OBJECTS)
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/test_byte_alpha.Po \
+ ./$(DEPDIR)/test_byte_list.Po ./$(DEPDIR)/test_file.Po \
+ ./$(DEPDIR)/test_iterator.Po ./$(DEPDIR)/test_nonalpha.Po \
+ ./$(DEPDIR)/test_null_trie.Po \
+ ./$(DEPDIR)/test_serialization.Po \
+ ./$(DEPDIR)/test_store-retrieve.Po \
+ ./$(DEPDIR)/test_term_state.Po ./$(DEPDIR)/test_walk.Po \
+ ./$(DEPDIR)/utils.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
-SOURCES = $(test_byte_alpha_SOURCES) $(test_file_SOURCES) \
- $(test_iterator_SOURCES) $(test_nonalpha_SOURCES) \
- $(test_null_trie_SOURCES) $(test_store_retrieve_SOURCES) \
+SOURCES = $(test_byte_alpha_SOURCES) $(test_byte_list_SOURCES) \
+ $(test_file_SOURCES) $(test_iterator_SOURCES) \
+ $(test_nonalpha_SOURCES) $(test_null_trie_SOURCES) \
+ $(test_serialization_SOURCES) $(test_store_retrieve_SOURCES) \
$(test_term_state_SOURCES) $(test_walk_SOURCES)
-DIST_SOURCES = $(test_byte_alpha_SOURCES) $(test_file_SOURCES) \
- $(test_iterator_SOURCES) $(test_nonalpha_SOURCES) \
- $(test_null_trie_SOURCES) $(test_store_retrieve_SOURCES) \
+DIST_SOURCES = $(test_byte_alpha_SOURCES) $(test_byte_list_SOURCES) \
+ $(test_file_SOURCES) $(test_iterator_SOURCES) \
+ $(test_nonalpha_SOURCES) $(test_null_trie_SOURCES) \
+ $(test_serialization_SOURCES) $(test_store_retrieve_SOURCES) \
$(test_term_state_SOURCES) $(test_walk_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
bases='$(TEST_LOGS)'; \
bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
RECHECK_LOGS = $(TEST_LOGS)
AM_RECURSIVE_TARGETS = check recheck
TEST_SUITE_LOG = test-suite.log
$(NULL)
test_file_LDADD = $(top_builddir)/datrie/libdatrie.la
+test_serialization_SOURCES = \
+ test_serialization.c \
+ utils.c \
+ $(NULL)
+
+test_serialization_LDADD = $(top_builddir)/datrie/libdatrie.la
test_nonalpha_SOURCES = \
test_nonalpha.c \
utils.c \
$(NULL)
test_byte_alpha_LDADD = $(top_builddir)/datrie/libdatrie.la
+test_byte_list_SOURCES = \
+ test_byte_list.c \
+ utils.c \
+ $(NULL)
+
+test_byte_list_LDADD = $(top_builddir)/datrie/libdatrie.la
all: all-am
.SUFFIXES:
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@rm -f test_byte_alpha$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_byte_alpha_OBJECTS) $(test_byte_alpha_LDADD) $(LIBS)
+test_byte_list$(EXEEXT): $(test_byte_list_OBJECTS) $(test_byte_list_DEPENDENCIES) $(EXTRA_test_byte_list_DEPENDENCIES)
+ @rm -f test_byte_list$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_byte_list_OBJECTS) $(test_byte_list_LDADD) $(LIBS)
+
test_file$(EXEEXT): $(test_file_OBJECTS) $(test_file_DEPENDENCIES) $(EXTRA_test_file_DEPENDENCIES)
@rm -f test_file$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_file_OBJECTS) $(test_file_LDADD) $(LIBS)
@rm -f test_null_trie$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_null_trie_OBJECTS) $(test_null_trie_LDADD) $(LIBS)
+test_serialization$(EXEEXT): $(test_serialization_OBJECTS) $(test_serialization_DEPENDENCIES) $(EXTRA_test_serialization_DEPENDENCIES)
+ @rm -f test_serialization$(EXEEXT)
+ $(AM_V_CCLD)$(LINK) $(test_serialization_OBJECTS) $(test_serialization_LDADD) $(LIBS)
+
test_store-retrieve$(EXEEXT): $(test_store_retrieve_OBJECTS) $(test_store_retrieve_DEPENDENCIES) $(EXTRA_test_store_retrieve_DEPENDENCIES)
@rm -f test_store-retrieve$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(test_store_retrieve_OBJECTS) $(test_store_retrieve_LDADD) $(LIBS)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_byte_alpha.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_file.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_iterator.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nonalpha.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_null_trie.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_store-retrieve.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_term_state.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_walk.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_byte_alpha.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_byte_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_file.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_iterator.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nonalpha.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_null_trie.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_serialization.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_store-retrieve.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_term_state.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_walk.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utils.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \
fi; \
echo "$${col}$$br$${std}"; \
- echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \
+ echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
echo "$${col}$$br$${std}"; \
create_testsuite_report --maybe-color; \
echo "$$col$$br$$std"; \
fi; \
$$success || exit 1
-check-TESTS:
+check-TESTS: $(check_PROGRAMS)
@list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list
@list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
@test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+test_serialization.log: test_serialization$(EXEEXT)
+ @p='test_serialization$(EXEEXT)'; \
+ b='test_serialization'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
test_nonalpha.log: test_nonalpha$(EXEEXT)
@p='test_nonalpha$(EXEEXT)'; \
b='test_nonalpha'; \
--log-file $$b.log --trs-file $$b.trs \
$(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
"$$tst" $(AM_TESTS_FD_REDIRECT)
+test_byte_list.log: test_byte_list$(EXEEXT)
+ @p='test_byte_list$(EXEEXT)'; \
+ b='test_byte_list'; \
+ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+ --log-file $$b.log --trs-file $$b.trs \
+ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+ "$$tst" $(AM_TESTS_FD_REDIRECT)
.test.log:
@p='$<'; \
$(am__set_b); \
@am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
@am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT)
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/test_byte_alpha.Po
+ -rm -f ./$(DEPDIR)/test_byte_list.Po
+ -rm -f ./$(DEPDIR)/test_file.Po
+ -rm -f ./$(DEPDIR)/test_iterator.Po
+ -rm -f ./$(DEPDIR)/test_nonalpha.Po
+ -rm -f ./$(DEPDIR)/test_null_trie.Po
+ -rm -f ./$(DEPDIR)/test_serialization.Po
+ -rm -f ./$(DEPDIR)/test_store-retrieve.Po
+ -rm -f ./$(DEPDIR)/test_term_state.Po
+ -rm -f ./$(DEPDIR)/test_walk.Po
+ -rm -f ./$(DEPDIR)/utils.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/test_byte_alpha.Po
+ -rm -f ./$(DEPDIR)/test_byte_list.Po
+ -rm -f ./$(DEPDIR)/test_file.Po
+ -rm -f ./$(DEPDIR)/test_iterator.Po
+ -rm -f ./$(DEPDIR)/test_nonalpha.Po
+ -rm -f ./$(DEPDIR)/test_null_trie.Po
+ -rm -f ./$(DEPDIR)/test_serialization.Po
+ -rm -f ./$(DEPDIR)/test_store-retrieve.Po
+ -rm -f ./$(DEPDIR)/test_term_state.Po
+ -rm -f ./$(DEPDIR)/test_walk.Po
+ -rm -f ./$(DEPDIR)/utils.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
.MAKE: check-am install-am install-strip
-.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am clean \
- clean-checkPROGRAMS clean-generic clean-libtool cscopelist-am \
- ctags ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags distdir dvi dvi-am html \
- html-am info info-am install install-am install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-pdf install-pdf-am \
- install-ps install-ps-am install-strip installcheck \
- installcheck-am installdirs maintainer-clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \
+ check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
recheck tags tags-am uninstall uninstall-am
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * libdatrie - Double-Array Trie Library
+ * Copyright (C) 2018 Theppitak Karoonboonyanan <theppitak@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * test_byte_list.c - Test byte trie enumeration
+ * Created: 2018-11-20
+ * Author: Theppitak Karoonboonyanan <theppitak@gmail.com>
+ * Based on test case in issue #9
+ * https://github.com/tlwg/libdatrie/issues/9
+ */
+
+#include <datrie/trie.h>
+#include "utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+typedef struct _DictEntry DictEntry;
+struct _DictEntry {
+ AlphaChar key[4];
+ TrieData data;
+ int is_checked;
+};
+
+#define N_ELM(v) (sizeof(v)/sizeof(v[0]))
+
+/* Dictionary source */
+static DictEntry Source[] = {
+ { { '1', '2', 0 }, 1, 0 },
+ { { '1', '2', '3', 0 }, 2, 0 },
+};
+
+static void
+dump_key_data (const AlphaChar *key, TrieData data)
+{
+ const AlphaChar *p;
+
+ printf ("[");
+ for (p = key; *p; ++p) {
+ if (p != key) {
+ printf (", ");
+ }
+ printf ("%04x", *p);
+ }
+ printf ("] : %d\n", data);
+}
+
+static void
+dump_entry (const TrieIterator *iter)
+{
+ AlphaChar *key = trie_iterator_get_key (iter);
+ dump_key_data (key, trie_iterator_get_data (iter));
+ free (key);
+}
+
+/*
+ * Check if the trie entry referenced by iter match any Source[] element
+ * and mark the matched element as checked.
+ * Return: 1 if matched, 0 otherwise
+ */
+static int
+validate_entry (const TrieIterator *iter)
+{
+ AlphaChar *key = trie_iterator_get_key (iter);
+ TrieData data = trie_iterator_get_data (iter);
+ int i;
+
+ for (i = 0; i < N_ELM (Source); i++) {
+ if (alpha_char_strcmp (Source[i].key, key) == 0
+ && Source[i].data == data)
+ {
+ Source[i].is_checked = 1;
+ free (key);
+ return 1;
+ }
+ }
+ free (key);
+ return 0;
+}
+
+/*
+ * Check if all Source[] elements are checked and reported unchecked one.
+ * Return: 1 if all are checked, 0 otherwise.
+ */
+static int
+is_all_checked()
+{
+ int i;
+ int ret = 1;
+
+ for (i = 0; i < N_ELM (Source); i++) {
+ if (!Source[i].is_checked) {
+ printf ("Not visited Source entry: ");
+ dump_key_data (Source[i].key, Source[i].data);
+ ret = 0;
+ }
+ }
+
+ return ret;
+}
+
+int
+main (void)
+{
+ AlphaMap *alpha_map;
+ Trie *test_trie;
+ int i;
+ TrieState *root;
+ TrieIterator *iter;
+ int ret = 0;
+
+ msg_step ("Preparing alpha map");
+ alpha_map = alpha_map_new ();
+ if (!alpha_map) {
+ printf ("Fail to allocate alpha map\n");
+ goto err_alpha_map_not_created;
+ }
+ if (alpha_map_add_range (alpha_map, 0x00, 0xff) != 0) {
+ printf ("Fail to add full alpha map range\n");
+ goto err_alpha_map_created;
+ }
+
+ msg_step ("Preparing trie");
+ test_trie = trie_new (alpha_map);
+ alpha_map_free (alpha_map);
+ if (!test_trie) {
+ printf ("Fail to create test trie\n");
+ goto err_alpha_map_created;
+ }
+
+ msg_step ("Storing entries to test trie");
+ for (i = 0; i < N_ELM (Source); i++) {
+ if (!trie_store (test_trie, Source[i].key, Source[i].data)) {
+ printf ("Fail to store entry %d to test trie:\n", i);
+ dump_key_data (Source[i].key, Source[i].data);
+ goto err_trie_created;
+ }
+ }
+
+ msg_step ("Iterating trie");
+ root = trie_root (test_trie);
+ iter = trie_iterator_new (root);
+ while (trie_iterator_next (iter)) {
+ if (!validate_entry (iter)) {
+ printf ("Fail to validate trie entry:\n");
+ dump_entry (iter);
+ ret = 1;
+ }
+ }
+ if (!is_all_checked()) {
+ ret = 1;
+ }
+ trie_iterator_free (iter);
+ trie_state_free (root);
+
+ msg_step ("Freeing test trie");
+ trie_free (test_trie);
+ return ret;
+
+err_trie_created:
+ trie_free (test_trie);
+err_alpha_map_created:
+ alpha_map_free (alpha_map);
+err_alpha_map_not_created:
+ return 1;
+}
+
+/*
+vi:ts=4:ai:expandtab
+*/
#include "utils.h"
#include <stdio.h>
#include <wchar.h>
-#include <unistd.h>
#define TRIE_FILENAME "test.tri"
/* save & close */
msg_step ("Saving trie to file");
- unlink (TRIE_FILENAME); /* error ignored */
+ remove (TRIE_FILENAME); /* error ignored */
if (trie_save (test_trie, TRIE_FILENAME) != 0) {
printf ("Failed to save trie to file '%s'.\n", TRIE_FILENAME);
goto err_trie_created;
goto err_trie_saved;
}
- unlink (TRIE_FILENAME);
+ remove (TRIE_FILENAME);
trie_free (test_trie);
return 0;
err_trie_saved:
- unlink (TRIE_FILENAME);
+ remove (TRIE_FILENAME);
err_trie_created:
trie_free (test_trie);
err_trie_not_created:
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * libdatrie - Double-Array Trie Library
+ * Copyright (C) 2013 Theppitak Karoonboonyanan <theppitak@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/*
+ * test_serialization.c - Test for datrie file and in-memory blob operations
+ * Created: 2019-11-11
+ * Author: Theppitak Karoonboonyanan <theppitak@gmail.com> and KOLANICH <KOLANICH@users.noreply.github.com>
+ */
+
+#include <datrie/trie.h>
+#include "utils.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#define TRIE_FILENAME "test.tri"
+
+int
+main (void)
+{
+ Trie *test_trie;
+ DictRec *dict_p;
+
+ msg_step ("Preparing trie");
+ test_trie = en_trie_new ();
+ if (!test_trie) {
+ printf ("Failed to allocate test trie.\n");
+ goto err_trie_not_created;
+ }
+
+ /* add/remove some words */
+ for (dict_p = dict_src; dict_p->key; dict_p++) {
+ if (!trie_store (test_trie, dict_p->key, dict_p->data)) {
+ printf ("Failed to add key '%ls', data %d.\n",
+ (wchar_t *)dict_p->key, dict_p->data);
+ goto err_trie_created;
+ }
+ }
+
+ /* save & close */
+ msg_step ("Saving trie to file");
+ remove (TRIE_FILENAME); /* error ignored */
+ if (trie_save (test_trie, TRIE_FILENAME) != 0) {
+ printf ("Failed to save trie to file '%s'.\n", TRIE_FILENAME);
+ goto err_trie_created;
+ }
+
+ msg_step ("Getting serialized trie size");
+ size_t size = trie_get_serialized_size (test_trie);
+ printf ("serialized trie size %lu\n", size);
+ msg_step ("Allocating");
+ uint8 *trieSerializedData = malloc (size);
+ if (!trieSerializedData) {
+ printf ("Failed to allocate trieSerializedData.\n");
+ goto err_trie_saved;
+ }
+ printf ("allocated %p\n", trieSerializedData);
+ msg_step ("Serializing");
+ trie_serialize (test_trie, trieSerializedData);
+ msg_step ("Serialized");
+
+ FILE *f = fopen (TRIE_FILENAME, "rb");
+ if (!f) {
+ printf ("Failed to reopen trie file " TRIE_FILENAME ".\n");
+ goto err_serial_data_allocated;
+ }
+ fseek (f, 0, SEEK_END);
+ size_t file_size = ftell (f);
+ fseek (f, 0, SEEK_SET);
+
+ if (size != file_size) {
+ printf ("Trie serialized data doesn't match size of the file.\n");
+ goto err_file_reopened;
+ }
+
+ unsigned char *trieFileData = malloc (size);
+ if (!trieFileData) {
+ printf ("Failed to allocate trieFileData.\n");
+ goto err_file_reopened;
+ }
+ fread (trieFileData, 1, size, f);
+ if (memcmp (trieSerializedData, trieFileData, size) != 0) {
+ printf ("Trie serialized data doesn't match contents of the file.\n");
+ goto err_file_data_allocated;
+ }
+ printf ("PASS!\n");
+
+ free (trieFileData);
+ fclose (f);
+ free (trieSerializedData);
+ remove (TRIE_FILENAME);
+ trie_free (test_trie);
+ return 0;
+
+err_file_data_allocated:
+ free (trieFileData);
+err_file_reopened:
+ fclose (f);
+err_serial_data_allocated:
+ free (trieSerializedData);
+err_trie_saved:
+ remove (TRIE_FILENAME);
+err_trie_created:
+ trie_free (test_trie);
+err_trie_not_created:
+ return 1;
+}
+
+/*
+vi:ts=4:ai:expandtab
+*/
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/trietool.Po
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
distclean-compile:
-rm -f *.tab.c
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trietool.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trietool.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/trietool.Po
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -rf ./$(DEPDIR)
+ -rm -f ./$(DEPDIR)/trietool.Po
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: install-am install-data-am install-strip uninstall-am
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
/* read the range
* format: [b,e]
* where: b = begin char, e = end char; both in hex values
- */
+ */
if (sscanf (buff, " [ %x , %x ] ", &b, &e) != 2)
continue;
if (b > e) {
/* mark key ending and find data begin */
if ('\0' != *data) {
*data++ = '\0';
- while (isspace (*data))
+ while (isspace ((unsigned char)*data))
++data;
}
/* decode data */
char *p;
/* skip leading white spaces */
- while (*s && isspace (*s))
+ while (*s && isspace ((unsigned char)*s))
++s;
/* trim trailing white spaces */
p = s + strlen (s) - 1;
- while (isspace (*p))
+ while (isspace ((unsigned char)*p))
--p;
*++p = '\0';