summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-05-04 18:26:00 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-05-04 18:26:00 +0200
commita7c6cf32519f775b01975b104a0c8da3c76beab5 (patch)
treece8bdf27499179198a1f264a29d34a93c3c92902
parentfd4ff4e58174679784d7698880717eefc9399ba7 (diff)
parent0ad6ddc1cbc5b0f36547798994b352a09ae5cf1c (diff)
Merge branch 'feature/upstream' into develop
-rw-r--r--CMakeLists.txt120
-rw-r--r--COPYING48
-rw-r--r--HISTORY11
-rw-r--r--Makefile.am3
-rw-r--r--README4
-rw-r--r--README.md22
-rw-r--r--cmake/Config.cmake.in4
-rw-r--r--cmake/dist.cmake321
-rwxr-xr-xcompile8
-rwxr-xr-xconfig.guess559
-rwxr-xr-xconfig.sub249
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog8
-rw-r--r--debian/control2
-rw-r--r--debian/files1
-rw-r--r--debian/symbols1
-rwxr-xr-xdepcomp8
-rw-r--r--dist.info10
-rw-r--r--doc/CALLOUTS.API385
-rw-r--r--doc/CALLOUTS.API.ja382
-rw-r--r--doc/CALLOUTS.BUILTIN35
-rw-r--r--doc/CALLOUTS.BUILTIN.ja17
-rw-r--r--doc/RE23
-rw-r--r--doc/RE.ja22
-rw-r--r--index.html3
-rw-r--r--index_ja.html3
-rwxr-xr-xinstall-sh45
-rwxr-xr-xmissing14
-rw-r--r--sample/callout.c64
-rw-r--r--sample/count.c4
-rw-r--r--src/Makefile.am5
-rw-r--r--src/ascii.c12
-rw-r--r--src/big5.c3
-rw-r--r--src/cp1251.c3
-rw-r--r--src/euc_jp.c3
-rw-r--r--src/euc_kr.c3
-rw-r--r--src/euc_tw.c3
-rw-r--r--src/gb18030.c199
-rw-r--r--src/iso8859_1.c3
-rw-r--r--src/iso8859_10.c3
-rw-r--r--src/iso8859_11.c3
-rw-r--r--src/iso8859_13.c3
-rw-r--r--src/iso8859_14.c3
-rw-r--r--src/iso8859_15.c3
-rw-r--r--src/iso8859_16.c3
-rw-r--r--src/iso8859_2.c3
-rw-r--r--src/iso8859_3.c3
-rw-r--r--src/iso8859_4.c3
-rw-r--r--src/iso8859_5.c3
-rw-r--r--src/iso8859_6.c3
-rw-r--r--src/iso8859_7.c3
-rw-r--r--src/iso8859_8.c3
-rw-r--r--src/iso8859_9.c3
-rw-r--r--src/koi8.c3
-rw-r--r--src/koi8_r.c3
-rw-r--r--src/oniguruma.h18
-rw-r--r--src/regcomp.c15
-rw-r--r--src/regenc.h11
-rw-r--r--src/regexec.c237
-rw-r--r--src/regint.h3
-rw-r--r--src/regparse.c42
-rw-r--r--src/sjis.c4
-rw-r--r--src/unicode.c2
-rw-r--r--src/utf16_be.c13
-rw-r--r--src/utf16_le.c13
-rw-r--r--src/utf32_be.c4
-rw-r--r--src/utf32_le.c4
-rw-r--r--src/utf8.c6
-rwxr-xr-xtest-driver8
-rw-r--r--test/Makefile.am7
-rw-r--r--test/test_utf8.c4
71 files changed, 1890 insertions, 1161 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1d4d3a7..1a9871d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,10 +1,10 @@
-
-cmake_minimum_required(VERSION 2.8)
-# required for exports? cmake_minimum_required (VERSION 2.8.6)
-project(oniguruma C)
+cmake_minimum_required(VERSION 3.1)
+project(oniguruma VERSION 6.8.2)
set(PACKAGE onig)
-set(PACKAGE_VERSION "6.8.1")
+set(PACKAGE_VERSION ${PROJECT_VERSION})
+
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
set(USE_CRNL_AS_LINE_TERMINATOR 0)
set(VERSION ${PACKAGE_VERSION})
@@ -23,7 +23,6 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
endif()
-include(cmake/dist.cmake)
include(CheckCSourceCompiles)
include(CheckIncludeFiles)
include(CheckFunctionExists)
@@ -54,10 +53,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake.in ${CMAKE_CURRENT
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/oniguruma.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/oniguruma.pc @ONLY)
-
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
-include_directories(${CMAKE_CURRENT_SOURCE_DIR})
-
set(_SRCS src/regint.h src/regparse.h src/regenc.h src/st.h
src/regerror.c src/regparse.c src/regext.c src/regcomp.c src/regexec.c
src/reggnu.c src/regenc.c src/regsyntax.c src/regtrav.c src/regversion.c
@@ -73,15 +68,100 @@ set(_SRCS src/regint.h src/regparse.h src/regenc.h src/st.h
src/unicode_unfold_key.c
src/unicode_fold1_key.c src/unicode_fold2_key.c src/unicode_fold3_key.c)
-
add_library(onig ${_SRCS})
-
-install_library(onig)
-
-install_header(src/oniguruma.h src/onigposix.h src/oniggnu.h)
-
-install_doc(doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja doc/CALLOUTS.BUILTIN doc/CALLOUTS.BUILTIN.ja doc/UNICODE_PROPERTIES)
-install_data(AUTHORS COPYING HISTORY README.md)
-
+target_include_directories(onig PUBLIC
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+
+# Installation (https://github.com/forexample/package-example)
+
+# Introduce variables:
+# * CMAKE_INSTALL_LIBDIR
+# * CMAKE_INSTALL_BINDIR
+# * CMAKE_INSTALL_INCLUDEDIR
+include(GNUInstallDirs)
+
+# Layout. This works for all platforms:
+# * <prefix>/lib*/cmake/<PROJECT-NAME>
+# * <prefix>/lib*/
+# * <prefix>/include/
+set(config_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
+
+set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
+
+# Configuration
+set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
+set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
+set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets")
+set(namespace "${PROJECT_NAME}::")
+
+# Include module with fuction 'write_basic_package_version_file'
+include(CMakePackageConfigHelpers)
+
+# Configure '<PROJECT-NAME>ConfigVersion.cmake'
+# Use:
+# * PROJECT_VERSION
+write_basic_package_version_file(
+ "${version_config}" COMPATIBILITY SameMajorVersion
+)
+
+# Configure '<PROJECT-NAME>Config.cmake'
+# Use variables:
+# * TARGETS_EXPORT_NAME
+# * PROJECT_NAME
+configure_package_config_file(
+ "cmake/Config.cmake.in"
+ "${project_config}"
+ INSTALL_DESTINATION "${config_install_dir}"
+)
+
+# Targets:
+# * <prefix>/lib/libonig.a
+# * header location after install: <prefix>/include/
+# * headers can be included by C code `#include <oniguruma.h>`
+install(
+ TARGETS onig
+ EXPORT "${TARGETS_EXPORT_NAME}"
+ LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
+ RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
+ INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+)
+
+# Headers:
+# * src/oniguruma.h -> <prefix>/include/oniguruma
+install(
+ FILES src/oniguruma.h src/onigposix.h src/oniggnu.h
+ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+)
+
+# Config
+# * <prefix>/lib/cmake/oniguruma/onigurumaConfig.cmake
+# * <prefix>/lib/cmake/oniguruma/onigurumaConfigVersion.cmake
+install(
+ FILES "${project_config}" "${version_config}"
+ DESTINATION "${config_install_dir}"
+)
+
+# Config
+# * <prefix>/lib/cmake/oniguruma/onigurumaTargets.cmake
+install(
+ EXPORT "${TARGETS_EXPORT_NAME}"
+ NAMESPACE "${namespace}"
+ DESTINATION "${config_install_dir}"
+)
+
+# Documentation (uses onig not oniguruma for directory)
+install(FILES doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja
+ doc/CALLOUTS.BUILTIN doc/CALLOUTS.BUILTIN.ja
+ doc/CALLOUTS.API doc/CALLOUTS.API.ja
+ doc/UNICODE_PROPERTIES
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME}")
+
+# Other files (uses onig not oniguruma for directory)
+install(FILES AUTHORS COPYING HISTORY README.md
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/${PACKAGE_NAME}")
+
+# pkg-config
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/oniguruma.pc
- DESTINATION lib/pkgconfig)
+ DESTINATION lib/pkgconfig)
diff --git a/COPYING b/COPYING
index c38f502..e999ab5 100644
--- a/COPYING
+++ b/COPYING
@@ -1,28 +1,26 @@
Oniguruma LICENSE
-----------------
-/*-
- * Copyright (c) 2002-2015 K.Kosako <kkosako0@gmail.com>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
+Copyright (c) 2002-2018 K.Kosako <kkosako0@gmail.com>
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGE.
diff --git a/HISTORY b/HISTORY
index fb5950b..23567cd 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,5 +1,16 @@
History
+2018/04/17: Version 6.8.2
+
+2018/04/13: add doc/CALLOUTS.API.ja
+2018/04/10: add doc/CALLOUTS.API
+2018/04/10: fix #87: Read unknown address in onig_error_code_to_str()
+2018/04/06: fix #86: typedef StateCheckNumType is unused
+2018/04/02: update automake 1.16.1
+2018/03/30: fix #84: stack-buffer-overflow in mbc_enc_len
+2018/03/28: PR #83: Improve CMake build
+2018/03/21: switch uses of UChar to OnigUChar in oniguruma.h (#80)
+
2018/03/19: Version 6.8.1
2018/03/19: update LTVERSION from 4:0:0 to 5:0:0
diff --git a/Makefile.am b/Makefile.am
index 1f4b38f..a73c603 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -6,10 +6,11 @@ SUBDIRS = src test sample
EXTRA_DIST = oniguruma.pc.in HISTORY README_japanese README.md \
index.html index_ja.html \
- CMakeLists.txt dist.info oniguruma.pc.cmake.in cmake/dist.cmake \
+ CMakeLists.txt oniguruma.pc.cmake.in cmake/Config.cmake.in \
src/config.h.cmake.in \
doc/API doc/API.ja doc/RE doc/RE.ja doc/FAQ doc/FAQ.ja \
doc/CALLOUTS.BUILTIN doc/CALLOUTS.BUILTIN.ja \
+ doc/CALLOUTS.API doc/CALLOUTS.API.ja \
doc/UNICODE_PROPERTIES \
src/Makefile.windows src/config.h.win32 src/config.h.win64 \
windows/testc.c contributed/libfuzzer-onig.cpp contributed/makefile
diff --git a/README b/README
index e4d9e1a..7089df2 100644
--- a/README
+++ b/README
@@ -1,10 +1,10 @@
-README 2018/01/14
+README 2018/04/05
Oniguruma ---- (C) K.Kosako
https://github.com/kkos/oniguruma
-FIXED Security Issues:
+FIXED Security Issues (in Oniguruma 6.3.0):
CVE-2017-9224, CVE-2017-9225, CVE-2017-9226
CVE-2017-9227, CVE-2017-9228, CVE-2017-9229
diff --git a/README.md b/README.md
index 0aac2b1..34a17ba 100644
--- a/README.md
+++ b/README.md
@@ -3,11 +3,6 @@ Oniguruma
https://github.com/kkos/oniguruma
-FIXED Security Issues:
---------------------------
- **CVE-2017-9224, CVE-2017-9225, CVE-2017-9226**
- **CVE-2017-9227, CVE-2017-9228, CVE-2017-9229**
-
Oniguruma is a modern and flexible regular expressions library. It
encompasses features from different regular expression implementations
that traditionally exist in different languages. It comes close to
@@ -39,6 +34,14 @@ Supported character encodings:
* CP1251: contributed by Byte
+New feature of version 6.8.2
+--------------------------
+
+* Fix: #80 UChar in header causes issue
+* NEW API: onig_set_callout_user_data_of_match_param() (* omission in 6.8.0)
+* add doc/CALLOUTS.API and doc/CALLOUTS.API.ja
+
+
New feature of version 6.8.1
--------------------------
@@ -51,9 +54,10 @@ New feature of version 6.8.0
* Retry-limit-in-match function enabled by default
* NEW: configure option --enable-posix-api=no (* enabled by default)
* NEW API: onig_search_with_param(), onig_match_with_param()
-* NEW: Callouts of contents (?{...contents...}) (?{...}\[X<>]) (?{{....}})
+* NEW: Callouts of contents (?{...contents...}) (?{...}\[tag]\[X<>]) (?{{...}})
* NEW: Callouts of name (*name) (*name\[tag]{args...})
* NEW: Builtin callouts (*FAIL) (*MISMATCH) (*ERROR{n}) (*COUNT) (*MAX{n}) etc..
+* Examples of Callouts program: [callout.c](sample/callout.c), [count.c](sample/count.c), [echo.c](sample/echo.c)
(* Callout function API is experimental level and isn't fixed definitely yet. Undocumented now)
@@ -107,6 +111,12 @@ New feature of version 6.3.0
--------------------------
* NEW: octal codepoint \o{.....}
+* Fixed CVE-2017-9224
+* Fixed CVE-2017-9225
+* Fixed CVE-2017-9226
+* Fixed CVE-2017-9227
+* Fixed CVE-2017-9228
+* Fixed CVE-2017-9229
New feature of version 6.1.2
diff --git a/cmake/Config.cmake.in b/cmake/Config.cmake.in
new file mode 100644
index 0000000..38bbde7
--- /dev/null
+++ b/cmake/Config.cmake.in
@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
+check_required_components("@PROJECT_NAME@")
diff --git a/cmake/dist.cmake b/cmake/dist.cmake
deleted file mode 100644
index 310ef94..0000000
--- a/cmake/dist.cmake
+++ /dev/null
@@ -1,321 +0,0 @@
-# LuaDist CMake utility library.
-# Provides sane project defaults and macros common to LuaDist CMake builds.
-#
-# Copyright (C) 2007-2012 LuaDist.
-# by David Manura, Peter Drahoš
-# Redistribution and use of this file is allowed according to the terms of the MIT license.
-# For details see the COPYRIGHT file distributed with LuaDist.
-# Please note that the package source code is licensed under its own license.
-
-## Extract information from dist.info
-if ( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/dist.info )
- message ( FATAL_ERROR
- "Missing dist.info file (${CMAKE_CURRENT_SOURCE_DIR}/dist.info)." )
-endif ()
-file ( READ ${CMAKE_CURRENT_SOURCE_DIR}/dist.info DIST_INFO )
-if ( "${DIST_INFO}" STREQUAL "" )
- message ( FATAL_ERROR "Failed to load dist.info." )
-endif ()
-# Reads field `name` from dist.info string `DIST_INFO` into variable `var`.
-macro ( _parse_dist_field name var )
- string ( REGEX REPLACE ".*${name}[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1"
- ${var} "${DIST_INFO}" )
- if ( ${var} STREQUAL DIST_INFO )
- message ( FATAL_ERROR "Failed to extract \"${var}\" from dist.info" )
- endif ()
-endmacro ()
-#
-_parse_dist_field ( name DIST_NAME )
-_parse_dist_field ( version DIST_VERSION )
-_parse_dist_field ( license DIST_LICENSE )
-_parse_dist_field ( author DIST_AUTHOR )
-_parse_dist_field ( maintainer DIST_MAINTAINER )
-_parse_dist_field ( url DIST_URL )
-_parse_dist_field ( desc DIST_DESC )
-message ( "DIST_NAME: ${DIST_NAME}")
-message ( "DIST_VERSION: ${DIST_VERSION}")
-message ( "DIST_LICENSE: ${DIST_LICENSE}")
-message ( "DIST_AUTHOR: ${DIST_AUTHOR}")
-message ( "DIST_MAINTAINER: ${DIST_MAINTAINER}")
-message ( "DIST_URL: ${DIST_URL}")
-message ( "DIST_DESC: ${DIST_DESC}")
-string ( REGEX REPLACE ".*depends[ \t]?=[ \t]?[\"']([^\"']+)[\"'].*" "\\1"
- DIST_DEPENDS ${DIST_INFO} )
-if ( DIST_DEPENDS STREQUAL DIST_INFO )
- set ( DIST_DEPENDS "" )
-endif ()
-message ( "DIST_DEPENDS: ${DIST_DEPENDS}")
-## 2DO: Parse DIST_DEPENDS and try to install Dependencies with automatically using externalproject_add
-
-
-## INSTALL DEFAULTS (Relative to CMAKE_INSTALL_PREFIX)
-# Primary paths
-set ( INSTALL_BIN bin CACHE PATH "Where to install binaries to." )
-set ( INSTALL_LIB lib CACHE PATH "Where to install libraries to." )
-set ( INSTALL_INC include CACHE PATH "Where to install headers to." )
-set ( INSTALL_ETC etc CACHE PATH "Where to store configuration files" )
-set ( INSTALL_SHARE share CACHE PATH "Directory for shared data." )
-
-# Secondary paths
-option ( INSTALL_VERSION
- "Install runtime libraries and executables with version information." OFF)
-set ( INSTALL_DATA ${INSTALL_SHARE}/${DIST_NAME} CACHE PATH
- "Directory the package can store documentation, tests or other data in.")
-set ( INSTALL_DOC ${INSTALL_DATA}/doc CACHE PATH
- "Recommended directory to install documentation into.")
-set ( INSTALL_EXAMPLE ${INSTALL_DATA}/example CACHE PATH
- "Recommended directory to install examples into.")
-set ( INSTALL_TEST ${INSTALL_DATA}/test CACHE PATH
- "Recommended directory to install tests into.")
-set ( INSTALL_FOO ${INSTALL_DATA}/etc CACHE PATH
- "Where to install additional files")
-
-# Tweaks and other defaults
-# Setting CMAKE to use loose block and search for find modules in source directory
-set ( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
-set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH} )
-option ( BUILD_SHARED_LIBS "Build shared libraries" ON )
-
-# In MSVC, prevent warnings that can occur when using standard libraries.
-if ( MSVC )
- add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
-endif ()
-
-# RPath and relative linking
-option ( USE_RPATH "Use relative linking." ON)
-if ( USE_RPATH )
- string ( REGEX REPLACE "[^!/]+" ".." UP_DIR ${INSTALL_BIN} )
- set ( CMAKE_SKIP_BUILD_RPATH FALSE CACHE STRING "" FORCE )
- set ( CMAKE_BUILD_WITH_INSTALL_RPATH FALSE CACHE STRING "" FORCE )
- set ( CMAKE_INSTALL_RPATH $ORIGIN/${UP_DIR}/${INSTALL_LIB}
- CACHE STRING "" FORCE )
- set ( CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE CACHE STRING "" FORCE )
- set ( CMAKE_INSTALL_NAME_DIR @executable_path/${UP_DIR}/${INSTALL_LIB}
- CACHE STRING "" FORCE )
-endif ()
-
-## MACROS
-# Parser macro
-macro ( parse_arguments prefix arg_names option_names)
- set ( DEFAULT_ARGS )
- foreach ( arg_name ${arg_names} )
- set ( ${prefix}_${arg_name} )
- endforeach ()
- foreach ( option ${option_names} )
- set ( ${prefix}_${option} FALSE )
- endforeach ()
-
- set ( current_arg_name DEFAULT_ARGS )
- set ( current_arg_list )
- foreach ( arg ${ARGN} )
- set ( larg_names ${arg_names} )
- list ( FIND larg_names "${arg}" is_arg_name )
- if ( is_arg_name GREATER -1 )
- set ( ${prefix}_${current_arg_name} ${current_arg_list} )
- set ( current_arg_name ${arg} )
- set ( current_arg_list )
- else ()
- set ( loption_names ${option_names} )
- list ( FIND loption_names "${arg}" is_option )
- if ( is_option GREATER -1 )
- set ( ${prefix}_${arg} TRUE )
- else ()
- set ( current_arg_list ${current_arg_list} ${arg} )
- endif ()
- endif ()
- endforeach ()
- set ( ${prefix}_${current_arg_name} ${current_arg_list} )
-endmacro ()
-
-
-# install_executable ( executable_targets )
-# Installs any executables generated using "add_executable".
-# USE: install_executable ( lua )
-# NOTE: subdirectories are NOT supported
-set ( CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "${DIST_NAME} Runtime" )
-set ( CPACK_COMPONENT_RUNTIME_DESCRIPTION
- "Executables and runtime libraries. Installed into ${INSTALL_BIN}." )
-macro ( install_executable )
- foreach ( _file ${ARGN} )
- if ( INSTALL_VERSION )
- set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION}
- SOVERSION ${DIST_VERSION} )
- endif ()
- install ( TARGETS ${_file} RUNTIME DESTINATION ${INSTALL_BIN}
- COMPONENT Runtime )
- endforeach()
-endmacro ()
-
-# install_library ( library_targets )
-# Installs any libraries generated using "add_library" into apropriate places.
-# USE: install_library ( libexpat )
-# NOTE: subdirectories are NOT supported
-set ( CPACK_COMPONENT_LIBRARY_DISPLAY_NAME "${DIST_NAME} Development Libraries" )
-set ( CPACK_COMPONENT_LIBRARY_DESCRIPTION
- "Static and import libraries needed for development. Installed into ${INSTALL_LIB} or ${INSTALL_BIN}." )
-macro ( install_library )
- foreach ( _file ${ARGN} )
- if ( INSTALL_VERSION )
- set_target_properties ( ${_file} PROPERTIES VERSION ${DIST_VERSION}
- SOVERSION ${DIST_VERSION} )
- endif ()
- install ( TARGETS ${_file}
- RUNTIME DESTINATION ${INSTALL_BIN} COMPONENT Runtime
- LIBRARY DESTINATION ${INSTALL_LIB} COMPONENT Runtime
- ARCHIVE DESTINATION ${INSTALL_LIB} COMPONENT Library )
- endforeach()
-endmacro ()
-
-# helper function for various install_* functions, for PATTERN/REGEX args.
-macro ( _complete_install_args )
- if ( NOT("${_ARG_PATTERN}" STREQUAL "") )
- set ( _ARG_PATTERN PATTERN ${_ARG_PATTERN} )
- endif ()
- if ( NOT("${_ARG_REGEX}" STREQUAL "") )
- set ( _ARG_REGEX REGEX ${_ARG_REGEX} )
- endif ()
-endmacro ()
-
-# install_header ( files/directories [INTO destination] )
-# Install a directories or files into header destination.
-# USE: install_header ( lua.h luaconf.h ) or install_header ( GL )
-# USE: install_header ( mylib.h INTO mylib )
-# For directories, supports optional PATTERN/REGEX arguments like install().
-set ( CPACK_COMPONENT_HEADER_DISPLAY_NAME "${DIST_NAME} Development Headers" )
-set ( CPACK_COMPONENT_HEADER_DESCRIPTION
- "Headers needed for development. Installed into ${INSTALL_INC}." )
-macro ( install_header )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO}
- COMPONENT Header ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_INC}/${_ARG_INTO}
- COMPONENT Header )
- endif ()
- endforeach()
-endmacro ()
-
-# install_data ( files/directories [INTO destination] )
-# This installs additional data files or directories.
-# USE: install_data ( extra data.dat )
-# USE: install_data ( image1.png image2.png INTO images )
-# For directories, supports optional PATTERN/REGEX arguments like install().
-set ( CPACK_COMPONENT_DATA_DISPLAY_NAME "${DIST_NAME} Data" )
-set ( CPACK_COMPONENT_DATA_DESCRIPTION
- "Application data. Installed into ${INSTALL_DATA}." )
-macro ( install_data )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file}
- DESTINATION ${INSTALL_DATA}/${_ARG_INTO}
- COMPONENT Data ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_DATA}/${_ARG_INTO}
- COMPONENT Data )
- endif ()
- endforeach()
-endmacro ()
-
-# INSTALL_DOC ( files/directories [INTO destination] )
-# This installs documentation content
-# USE: install_doc ( doc/ doc.pdf )
-# USE: install_doc ( index.html INTO html )
-# For directories, supports optional PATTERN/REGEX arguments like install().
-set ( CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "${DIST_NAME} Documentation" )
-set ( CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
- "Application documentation. Installed into ${INSTALL_DOC}." )
-macro ( install_doc )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO}
- COMPONENT Documentation ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_DOC}/${_ARG_INTO}
- COMPONENT Documentation )
- endif ()
- endforeach()
-endmacro ()
-
-# install_example ( files/directories [INTO destination] )
-# This installs additional examples
-# USE: install_example ( examples/ exampleA )
-# USE: install_example ( super_example super_data INTO super)
-# For directories, supports optional PATTERN/REGEX argument like install().
-set ( CPACK_COMPONENT_EXAMPLE_DISPLAY_NAME "${DIST_NAME} Examples" )
-set ( CPACK_COMPONENT_EXAMPLE_DESCRIPTION
- "Examples and their associated data. Installed into ${INSTALL_EXAMPLE}." )
-macro ( install_example )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO}
- COMPONENT Example ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_EXAMPLE}/${_ARG_INTO}
- COMPONENT Example )
- endif ()
- endforeach()
-endmacro ()
-
-# install_test ( files/directories [INTO destination] )
-# This installs tests and test files, DOES NOT EXECUTE TESTS
-# USE: install_test ( my_test data.sql )
-# USE: install_test ( feature_x_test INTO x )
-# For directories, supports optional PATTERN/REGEX argument like install().
-set ( CPACK_COMPONENT_TEST_DISPLAY_NAME "${DIST_NAME} Tests" )
-set ( CPACK_COMPONENT_TEST_DESCRIPTION
- "Tests and associated data. Installed into ${INSTALL_TEST}." )
-macro ( install_test )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO}
- COMPONENT Test ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_TEST}/${_ARG_INTO}
- COMPONENT Test )
- endif ()
- endforeach()
-endmacro ()
-
-# install_foo ( files/directories [INTO destination] )
-# This installs optional or otherwise unneeded content
-# USE: install_foo ( etc/ example.doc )
-# USE: install_foo ( icon.png logo.png INTO icons)
-# For directories, supports optional PATTERN/REGEX argument like install().
-set ( CPACK_COMPONENT_OTHER_DISPLAY_NAME "${DIST_NAME} Unspecified Content" )
-set ( CPACK_COMPONENT_OTHER_DESCRIPTION
- "Other unspecified content. Installed into ${INSTALL_FOO}." )
-macro ( install_foo )
- parse_arguments ( _ARG "INTO;PATTERN;REGEX" "" ${ARGN} )
- _complete_install_args()
- foreach ( _file ${_ARG_DEFAULT_ARGS} )
- if ( IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${_file}" )
- install ( DIRECTORY ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO}
- COMPONENT Other ${_ARG_PATTERN} ${_ARG_REGEX} )
- else ()
- install ( FILES ${_file} DESTINATION ${INSTALL_FOO}/${_ARG_INTO}
- COMPONENT Other )
- endif ()
- endforeach()
-endmacro ()
-
-## CTest defaults
-
-## CPack defaults
-set ( CPACK_GENERATOR "ZIP" )
-set ( CPACK_STRIP_FILES TRUE )
-set ( CPACK_PACKAGE_NAME "${DIST_NAME}" )
-set ( CPACK_PACKAGE_VERSION "${DIST_VERSION}")
-set ( CPACK_PACKAGE_VENDOR "LuaDist" )
-set ( CPACK_COMPONENTS_ALL Runtime Library Header Data Documentation Example Other )
-include ( CPack )
diff --git a/compile b/compile
index 2ab71e4..99e5052 100755
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# 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
@@ -340,7 +340,7 @@ exit $ret
# 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"
diff --git a/config.guess b/config.guess
index 2193702..256083a 100755
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2017 Free Software Foundation, Inc.
+# Copyright 1992-2018 Free Software Foundation, Inc.
-timestamp='2017-05-27'
+timestamp='2018-03-08'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-05-27'
# 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
@@ -27,7 +27,7 @@ timestamp='2017-05-27'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to <config-patches@gnu.org>.
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -107,9 +107,9 @@ trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
+ ,,) echo "int x;" > "$dummy.c" ;
for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
@@ -132,14 +132,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
- eval $set_cc_for_build
- cat <<-EOF > $dummy.c
+ eval "$set_cc_for_build"
+ cat <<-EOF > "$dummy.c"
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
@@ -149,13 +149,20 @@ Linux|GNU|GNU/*)
LIBC=gnu
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+ # If ldd exists, use it to detect musl libc.
+ if command -v ldd >/dev/null && \
+ ldd --version 2>&1 | grep -q ^musl
+ then
+ LIBC=musl
+ fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,30 +176,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
- /sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || \
+ "/sbin/$sysctl" 2>/dev/null || \
+ "/usr/sbin/$sysctl" 2>/dev/null || \
echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
- arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
- endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
- machine=${arch}${endian}-unknown
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine="${arch}${endian}"-unknown
;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ eval "$set_cc_for_build"
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -208,10 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Determine ABI tags.
- case "${UNAME_MACHINE_ARCH}" in
+ case "$UNAME_MACHINE_ARCH" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
- abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
@@ -219,46 +226,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}${abi}"
+ echo "$machine-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+ exit ;;
+ *:MidnightBSD:*:*)
+ echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:Sortix:*:*)
- echo ${UNAME_MACHINE}-unknown-sortix
+ echo "$UNAME_MACHINE"-unknown-sortix
+ exit ;;
+ *:Redox:*:*)
+ echo "$UNAME_MACHINE"-unknown-redox
exit ;;
+ mips:OSF1:*.*)
+ echo mips-dec-osf1
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -310,28 +326,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
+ echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
+ echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
@@ -343,7 +350,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
+ echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
@@ -370,19 +377,19 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
+ echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
+ eval "$set_cc_for_build"
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
@@ -395,13 +402,13 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
@@ -410,25 +417,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
exit ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
+ echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
@@ -439,44 +446,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
+ echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
+ echo m68k-milan-mint"$UNAME_RELEASE"
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
+ echo m68k-hades-mint"$UNAME_RELEASE"
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
+ echo m68k-unknown-mint"$UNAME_RELEASE"
exit ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
+ echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
+ echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
+ echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
+ echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
+ echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include <stdio.h> /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -485,23 +492,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
+ echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
@@ -527,17 +534,17 @@ EOF
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
+ [ "$TARGET_BINARY_INTERFACE"x = x ]
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ echo m88k-dg-dgux"$UNAME_RELEASE"
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ echo i586-dg-dgux"$UNAME_RELEASE"
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
@@ -554,7 +561,7 @@ EOF
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
@@ -566,14 +573,14 @@ EOF
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
#include <sys/systemcfg.h>
main()
@@ -584,7 +591,7 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
echo "$SYSTEM_NAME"
else
@@ -598,7 +605,7 @@ EOF
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
@@ -607,18 +614,18 @@ EOF
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
@@ -633,28 +640,28 @@ EOF
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ case "$UNAME_MACHINE" in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
+ case "$sc_cpu_version" in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
+ case "$sc_kernel_bits" in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if [ "$HP_ARCH" = "" ]; then
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include <stdlib.h>
@@ -687,13 +694,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = hppa2.0w ]
+ if [ "$HP_ARCH" = hppa2.0w ]
then
- eval $set_cc_for_build
+ eval "$set_cc_for_build"
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +719,15 @@ EOF
HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
+ HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
#include <unistd.h>
int
main ()
@@ -745,11 +752,11 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
@@ -758,7 +765,7 @@ EOF
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
@@ -766,9 +773,9 @@ EOF
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ echo "$UNAME_MACHINE"-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
@@ -793,128 +800,109 @@ EOF
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
+ echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ case "$UNAME_PROCESSOR" in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
+ echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
*:MINGW64*:*)
- echo ${UNAME_MACHINE}-pc-mingw64
+ echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
+ echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
+ echo "$UNAME_MACHINE"-pc-msys
exit ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
+ echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case "$UNAME_MACHINE" in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
+ echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
+ echo x86_64-unknown-interix"$UNAME_RELEASE"
exit ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
+ echo ia64-unknown-interix"$UNAME_RELEASE"
exit ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
+ echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
+ echo "$UNAME_MACHINE"-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -928,63 +916,63 @@ EOF
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ eval "$set_cc_for_build"
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+ echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
e2k:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
k1om:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ eval "$set_cc_for_build"
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
@@ -998,70 +986,70 @@ EOF
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+ eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
+ test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
;;
mips64el:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
openrisc*:Linux:*:*)
- echo or1k-unknown-linux-${LIBC}
+ echo or1k-unknown-linux-"$LIBC"
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-${LIBC}
+ echo sparc-unknown-linux-"$LIBC"
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-${LIBC}
+ echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
- PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
- *) echo hppa-unknown-linux-${LIBC} ;;
+ PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+ PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+ *) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-${LIBC}
+ echo powerpc64-unknown-linux-"$LIBC"
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-${LIBC}
+ echo powerpc-unknown-linux-"$LIBC"
exit ;;
ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-${LIBC}
+ echo powerpc64le-unknown-linux-"$LIBC"
exit ;;
ppcle:Linux:*:*)
- echo powerpcle-unknown-linux-${LIBC}
+ echo powerpcle-unknown-linux-"$LIBC"
exit ;;
riscv32:Linux:*:* | riscv64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+ echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+ echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+ echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1075,34 +1063,34 @@ EOF
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
+ echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
+ echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
+ echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
+ echo "$UNAME_MACHINE"-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
+ echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
@@ -1112,12 +1100,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
- echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
elif /bin/uname -X 2>/dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1127,9 +1115,9 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
@@ -1149,9 +1137,9 @@ EOF
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
@@ -1171,9 +1159,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1182,28 +1170,28 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
+ echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
+ echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
+ echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
@@ -1214,7 +1202,7 @@ EOF
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
@@ -1234,23 +1222,23 @@ EOF
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
+ echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
+ echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ echo mips-nec-sysv"$UNAME_RELEASE"
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ echo mips-unknown-sysv"$UNAME_RELEASE"
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
@@ -1269,39 +1257,39 @@ EOF
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
+ echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
+ echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
+ echo sx6-nec-superux"$UNAME_RELEASE"
exit ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
+ echo sx7-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
+ echo sx8-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
+ echo sx8r-nec-superux"$UNAME_RELEASE"
exit ;;
SX-ACE:SUPER-UX:*:*)
- echo sxace-nec-superux${UNAME_RELEASE}
+ echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- eval $set_cc_for_build
+ eval "$set_cc_for_build"
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
- if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+ if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
@@ -1329,7 +1317,7 @@ EOF
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
@@ -1337,22 +1325,25 @@ EOF
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-*:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
+ echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
+ echo nse-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSR-*:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
+ echo nsr-tandem-nsk"$UNAME_RELEASE"
+ exit ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ echo nsv-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSX-*:NONSTOP_KERNEL:*:*)
- echo nsx-tandem-nsk${UNAME_RELEASE}
+ echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
@@ -1361,7 +1352,7 @@ EOF
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
@@ -1372,7 +1363,7 @@ EOF
else
UNAME_MACHINE="$cputype"
fi
- echo ${UNAME_MACHINE}-unknown-plan9
+ echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
@@ -1393,14 +1384,14 @@ EOF
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
+ echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
+ case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
@@ -1409,32 +1400,44 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+ echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
exit ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
+ echo "$UNAME_MACHINE"-pc-rdos
exit ;;
i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
+ echo "$UNAME_MACHINE"-pc-aros
exit ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
+ echo "$UNAME_MACHINE"-unknown-esx
exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
esac
+echo "$0: unable to guess system type" >&2
+
+case "$UNAME_MACHINE:$UNAME_SYSTEM" in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+ ;;
+esac
+
cat >&2 <<EOF
-$0: unable to guess system type
This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+ https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
@@ -1457,16 +1460,16 @@ hostinfo = `(hostinfo) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/config.sub b/config.sub
index 40ea5df..9ccf09a 100755
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2017 Free Software Foundation, Inc.
+# Copyright 1992-2018 Free Software Foundation, Inc.
-timestamp='2017-04-02'
+timestamp='2018-03-08'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-04-02'
# 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
@@ -33,7 +33,7 @@ timestamp='2017-04-02'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -57,7 +57,7 @@ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -94,7 +94,7 @@ while test $# -gt 0 ; do
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -112,7 +112,7 @@ esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
@@ -120,16 +120,16 @@ case $maybe_os in
kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+ basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
+ basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
+ if [ "$basic_machine" != "$1" ]
+ then os=`echo "$1" | sed 's/.*-/-/'`
else os=; fi
;;
esac
@@ -178,44 +178,44 @@ case $os in
;;
-sco6)
os=-sco5v6
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
@@ -227,10 +227,7 @@ case $os in
os=-lynxos
;;
-ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
- ;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
;;
-psos*)
os=-psos
@@ -299,7 +296,7 @@ case $basic_machine in
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
- | pdp10 | pdp11 | pj | pjl \
+ | pdp10 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \
@@ -316,7 +313,6 @@ case $basic_machine in
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| wasm32 \
- | we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
@@ -337,7 +333,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown
os=-none
;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
;;
ms1)
basic_machine=mt-unknown
@@ -366,7 +362,7 @@ case $basic_machine in
;;
# Object if more than one company name word.
*-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
@@ -461,7 +457,7 @@ case $basic_machine in
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
- basic_machine=i386-unknown
+ basic_machine=i386-pc
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@@ -495,7 +491,7 @@ case $basic_machine in
basic_machine=x86_64-pc
;;
amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
@@ -540,7 +536,7 @@ case $basic_machine in
os=-linux
;;
blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
@@ -548,13 +544,13 @@ case $basic_machine in
os=-cnk
;;
c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
@@ -643,7 +639,7 @@ case $basic_machine in
basic_machine=rs6000-bull
os=-bosx
;;
- dpx2* | dpx2*-bull)
+ dpx2*)
basic_machine=m68k-bull
os=-sysv3
;;
@@ -652,7 +648,7 @@ case $basic_machine in
os=$os"spe"
;;
e500v[12]-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=$os"spe"
;;
ebmon29k)
@@ -744,9 +740,6 @@ case $basic_machine in
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
- hppa-next)
- os=-nextstep3
- ;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
@@ -759,26 +752,26 @@ case $basic_machine in
basic_machine=i370-ibm
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
- i386-vsta | vsta)
+ vsta)
basic_machine=i386-unknown
os=-vsta
;;
@@ -797,19 +790,16 @@ case $basic_machine in
os=-sysv
;;
leon-*|leon[3-9]-*)
- basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
@@ -841,10 +831,10 @@ case $basic_machine in
os=-mint
;;
mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
;;
mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
@@ -863,7 +853,7 @@ case $basic_machine in
os=-msdos
;;
ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
@@ -905,7 +895,7 @@ case $basic_machine in
basic_machine=v70-nec
os=-sysv
;;
- next | m*-next )
+ next | m*-next)
basic_machine=m68k-next
case $os in
-nextstep* )
@@ -950,6 +940,9 @@ case $basic_machine in
nsr-tandem)
basic_machine=nsr-tandem
;;
+ nsv-tandem)
+ basic_machine=nsv-tandem
+ ;;
nsx-tandem)
basic_machine=nsx-tandem
;;
@@ -985,7 +978,7 @@ case $basic_machine in
os=-linux
;;
parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
@@ -1001,7 +994,7 @@ case $basic_machine in
basic_machine=i386-pc
;;
pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
@@ -1016,16 +1009,16 @@ case $basic_machine in
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
@@ -1035,23 +1028,23 @@ case $basic_machine in
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
@@ -1105,17 +1098,10 @@ case $basic_machine in
sequent)
basic_machine=i386-sequent
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
- ;;
sh5el)
basic_machine=sh5le-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparclite-wrs | simso-wrs)
+ simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
@@ -1134,7 +1120,7 @@ case $basic_machine in
os=-sysv4
;;
strongarm-* | thumb-*)
- basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+ basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
@@ -1248,9 +1234,6 @@ case $basic_machine in
basic_machine=a29k-wrs
os=-vxworks
;;
- wasm32)
- basic_machine=wasm32-unknown
- ;;
w65*)
basic_machine=w65-wdc
os=-none
@@ -1259,6 +1242,9 @@ case $basic_machine in
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ x64)
+ basic_machine=x86_64-pc
+ ;;
xbox)
basic_machine=i686-pc
os=-mingw32
@@ -1267,20 +1253,12 @@ case $basic_machine in
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
- basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+ basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
- z8k-*-coff)
- basic_machine=z8k-unknown
- os=-sim
- ;;
- z80-*-coff)
- basic_machine=z80-unknown
- os=-sim
- ;;
none)
basic_machine=none-none
os=-none
@@ -1309,10 +1287,6 @@ case $basic_machine in
vax)
basic_machine=vax-dec
;;
- pdp10)
- # there are many clones, so DEC is not a safe bet
- basic_machine=pdp10-unknown
- ;;
pdp11)
basic_machine=pdp11-dec
;;
@@ -1322,9 +1296,6 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
- basic_machine=sparc-sun
- ;;
cydra)
basic_machine=cydra-cydrome
;;
@@ -1344,7 +1315,7 @@ case $basic_machine in
# Make sure to match an already-canonicalized machine name.
;;
*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1
;;
esac
@@ -1352,10 +1323,10 @@ esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
;;
*-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
;;
*)
;;
@@ -1366,8 +1337,8 @@ esac
if [ x"$os" != x"" ]
then
case $os in
- # First match some system type aliases
- # that might get confused with valid system types.
+ # First match some system type aliases that might get confused
+ # with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
@@ -1378,18 +1349,19 @@ case $os in
-solaris)
os=-solaris2
;;
- -svr4*)
- os=-sysv4
- ;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
- # First accept the basic system types.
+ # es1800 is here to avoid being matched by es* (a different OS)
+ -es1800*)
+ os=-ose
+ ;;
+ # Now accept the basic system types.
# The portable systems comes first.
- # Each alternative MUST END IN A *, to match a version number.
+ # Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
@@ -1399,25 +1371,26 @@ case $os in
| -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
- | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* | -hcos* \
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
- | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
- | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -morphos* | -superux* | -rtmk* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
+ | -midnightbsd*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1434,12 +1407,12 @@ case $os in
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
- -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ -sim | -xray | -os68k* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
- os=`echo $os | sed -e 's|mac|macos|'`
+ os=`echo "$os" | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
@@ -1448,10 +1421,10 @@ case $os in
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
- os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
- os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
@@ -1462,12 +1435,6 @@ case $os in
-wince*)
os=-wince
;;
- -osfrose*)
- os=-osfrose
- ;;
- -osf*)
- os=-osf
- ;;
-utek*)
os=-bsd
;;
@@ -1492,7 +1459,7 @@ case $os in
-nova*)
os=-rtmk-nova
;;
- -ns2 )
+ -ns2)
os=-nextstep2
;;
-nsk*)
@@ -1514,7 +1481,7 @@ case $os in
-oss*)
os=-sysv3
;;
- -svr4)
+ -svr4*)
os=-sysv4
;;
-svr3)
@@ -1529,24 +1496,28 @@ case $os in
-ose*)
os=-ose
;;
- -es1800*)
- os=-ose
- ;;
- -xenix)
- os=-xenix
- ;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
- -aros*)
- os=-aros
- ;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
+ -pikeos*)
+ # Until real need of OS specific support for
+ # particular features comes up, bare metal
+ # configurations are quite functional.
+ case $basic_machine in
+ arm*)
+ os=-eabi
+ ;;
+ *)
+ os=-elf
+ ;;
+ esac
+ ;;
-nacl*)
;;
-ios)
@@ -1556,7 +1527,7 @@ case $os in
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
- echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1
;;
esac
@@ -1652,9 +1623,6 @@ case $basic_machine in
*-be)
os=-beos
;;
- *-haiku)
- os=-haiku
- ;;
*-ibm)
os=-aix
;;
@@ -1694,7 +1662,7 @@ case $basic_machine in
m88k-omron*)
os=-luna
;;
- *-next )
+ *-next)
os=-nextstep
;;
*-sequent)
@@ -1709,9 +1677,6 @@ case $basic_machine in
i370-*)
os=-mvs
;;
- *-next)
- os=-nextstep3
- ;;
*-gould)
os=-sysv
;;
@@ -1821,15 +1786,15 @@ case $basic_machine in
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$basic_machine$os"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/configure.ac b/configure.ac
index b146e08..cec8aa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(onig, 6.8.1)
+AC_INIT(onig, 6.8.2)
AC_CONFIG_MACRO_DIR([m4])
diff --git a/debian/changelog b/debian/changelog
index b94e531..f746ea4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libonig (6.8.2-1) UNRELEASED; urgency=medium
+
+ * New upstream release (Closes: #897250).
+ - Refresh symbols file.
+ * Declare compliance with Debian Policy 4.1.4 (No changes needed).
+
+ -- Jörg Frings-Fürst <debian@jff.email> Wed, 02 May 2018 17:29:08 +0200
+
libonig (6.8.1-2) unstable; urgency=medium
* Upload to unstable.
diff --git a/debian/control b/debian/control
index cc33c7a..fdda3d8 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: extra
Maintainer: Jörg Frings-Fürst <debian@jff.email>
Build-Depends:
debhelper (>= 11)
-Standards-Version: 4.1.3
+Standards-Version: 4.1.4
Homepage: https://github.com/kkos/oniguruma
Vcs-Git: https://anonscm.debian.org/cgit/collab-maint/libonig.git
Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/libonig.git
diff --git a/debian/files b/debian/files
deleted file mode 100644
index b94e36b..0000000
--- a/debian/files
+++ /dev/null
@@ -1 +0,0 @@
-libonig_6.8.1-2_source.buildinfo libs extra
diff --git a/debian/symbols b/debian/symbols
index aa4d9c1..1f726bd 100644
--- a/debian/symbols
+++ b/debian/symbols
@@ -184,6 +184,7 @@ libonig.so.5 libonig5 #MINVER#
onig_set_callout_data_by_callout_args_self@Base 6.8.1
onig_set_callout_data_by_tag@Base 6.8.1
onig_set_callout_of_name@Base 6.8.1
+ onig_set_callout_user_data_of_match_param@Base 6.8.2
onig_set_capture_num_limit@Base 6.8.1
onig_set_default_case_fold_flag@Base 6.8.1
onig_set_default_syntax@Base 6.8.1
diff --git a/depcomp b/depcomp
index b39f98f..65cbf70 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,9 @@
#! /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-2018 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# 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
@@ -783,7 +783,7 @@ exit 0
# 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"
diff --git a/dist.info b/dist.info
deleted file mode 100644
index c546d9d..0000000
--- a/dist.info
+++ /dev/null
@@ -1,10 +0,0 @@
---- This file is part of LuaDist project
-
-name = "onig"
-version = "6.8.1"
-
-desc = "Oniguruma is a regular expressions library."
-author = "K.Kosako"
-license = "BSD"
-url = "https://github.com/kkos/oniguruma"
-maintainer = "K.Kosako"
diff --git a/doc/CALLOUTS.API b/doc/CALLOUTS.API
new file mode 100644
index 0000000..6003532
--- /dev/null
+++ b/doc/CALLOUTS.API
@@ -0,0 +1,385 @@
+Callouts API Version 6.8.2 2018/04/14
+
+#include <oniguruma.h>
+
+(1) Callout functions
+(2) Set/Get functions for Callouts of contents
+(3) Set functions for Callouts of name
+(4) User data
+(5) Get values from OnigCalloutArgs
+(6) Tag
+(7) Callout data (used in callout functions)
+(8) Callout data (used in applications)
+(9) Miscellaneous functions
+
+
+(1) Callout functions
+
+ type: OnigCalloutFunc
+
+ typedef int (*OnigCalloutFunc)(OnigCalloutArgs* args, void* user_data);
+
+ If 0 (NULL) is set as a callout function value, never called.
+
+
+ * Callout function return value (int)
+
+ ONIG_CALLOUT_FAIL(1): fail
+ ONIG_CALLOUT_SUCCESS(0): success
+ less than -1: error code (terminate search/match)
+
+ ONIG_CALLOUT_FAIL/SUCCESS values are ignored in retractions,
+ because retraction is a part of recovery process after failure.
+
+ * Example of callout function
+
+ extern int always_success(OnigCalloutArgs* args, void* user_data)
+ {
+ return ONIG_CALLOUT_SUCCESS;
+ }
+
+
+
+(2) Set/Get functions for Callouts of contents
+
+# OnigCalloutFunc onig_get_progress_callout(void)
+
+ Get a function for callouts of contents in progress.
+
+
+# int onig_set_progress_callout(OnigCalloutFunc f)
+
+ Set a function for callouts of contents in progress.
+ This value set in onig_initialize_match_param() as a default
+ callout function.
+
+ normal return: ONIG_NORMAL
+
+
+# OnigCalloutFunc onig_get_retraction_callout(void)
+
+ Get a function for callouts of contents in retraction (backtrack).
+
+
+# int onig_set_retraction_callout(OnigCalloutFunc f)
+
+ Set a function for callouts of contents in retraction (backtrack).
+ This value set in onig_initialize_match_param() as a default
+ callout function.
+
+ normal return: ONIG_NORMAL
+
+
+# int onig_set_progress_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f)
+
+ Set a function for callouts of contents in progress.
+
+ arguments
+ 1 mp: match-param pointer
+ 2 f: function
+
+ normal return: ONIG_NORMAL
+
+
+# int onig_set_retraction_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f)
+
+ Set a function for callouts of contents in retraction (backtrack).
+
+ arguments
+ 1 mp: match-param pointer
+ 2 f: function
+
+ normal return: ONIG_NORMAL
+
+
+
+(3) Set functions for Callouts of name
+
+# int onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int opt_arg_num, OnigValue opt_defaults[])
+
+ Set a function for callouts of name.
+ Allowed name string characters: _ A-Z a-z 0-9 (* first character: _ A-Z a-z)
+
+ (enc, name) pair is used as key value to find callout function.
+ You have to call this function for every encoding used in your applications.
+ But if enc is ASCII compatible and (enc, name) entry is not found,
+ then (ASCII, name) entry is used.
+ Therefore, if you use ASCII compatible encodings only, it is enough to call
+ this function one time for (ASCII, name).
+
+ arguments
+ 1 enc: character encoding
+ 2 type: callout type (currently ONIG_CALLOUT_TYPE_SINGLE only supported)
+ 3 name: name string address (the string is encoded by enc)
+ 4 name_end: name string end address
+ 5 callout_in: direction (ONIG_CALLOUT_IN_PROGRESS/RETRACTION/BOTH)
+ 6 callout: callout function
+ 7 end_callout: * not used currently (set 0)
+ 8 arg_num: number of arguments (*limit by ONIG_CALLOUT_MAX_ARGS_NUM == 4)
+ 9 arg_types: type array of arguments
+ 10 opt_arg_num: number of optional arguments
+ 11 opt_defaults: default values array of optional arguments
+
+ normal return: ONIG_NORMAL
+ error:
+ ONIGERR_INVALID_CALLOUT_NAME
+ ONIGERR_INVALID_ARGUMENT
+ ONIGERR_INVALID_CALLOUT_ARG
+
+
+
+(4) User data
+
+# int onig_set_callout_user_data_of_match_param(OnigMatchParam* param, void* user_data)
+
+ Set a user_data value which passed as second argument of callout.
+
+ normal return: ONIG_NORMAL
+
+
+
+(5) Get values from OnigCalloutArgs
+
+# int onig_get_callout_num_by_callout_args(OnigCalloutArgs* args)
+
+ Returns callout number of this callout.
+ "Callout number" is an identifier of callout in a regex pattern.
+
+
+# OnigCalloutIn onig_get_callout_in_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the direction of this callout.
+ (ONIG_CALLOUT_IN_PROGRESS or ONIG_CALLOUT_IN_RETRACTION)
+
+
+# int onig_get_name_id_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the name identifier of this callout.
+ If this callout is callout of contents, then returns ONIG_NON_NAME_ID.
+
+
+# const OnigUChar* onig_get_contents_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the contents string of this callout. (NULL terminated string)
+ If this callout is callout of name, then returns NULL.
+
+
+# const OnigUChar* onig_get_contents_end_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the end of contents string of this callout.
+ If this callout is callout of name, then returns NULL.
+
+
+# int onig_get_args_num_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the number of args of this callout.
+ It includes optional arguments that doesn't passed in regex pattern.
+ If this callout is callout of contents, then returns
+ ONIGERR_INVALID_ARGUMENT.
+
+
+# int onig_get_passed_args_num_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the number of args that passed really in regex pattern.
+ If this callout is callout of contents, then returns
+ ONIGERR_INVALID_ARGUMENT.
+
+
+# int onig_get_arg_by_callout_args(OnigCalloutArgs* args, int index, OnigType* type, OnigValue* val)
+
+ Returns a value and a type of the callout argument.
+ If this callout is callout of contents, then returns
+ ONIGERR_INVALID_ARGUMENT.
+
+ normal return: ONIG_NORMAL
+
+
+# const OnigUChar* onig_get_string_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the subject string adress.
+ This is the second argument(str) of onig_search().
+
+
+# const OnigUChar* onig_get_string_end_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the end address of subject string.
+ This is the third argument(end) of onig_search().
+
+
+# const OnigUChar* onig_get_start_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the start address of subject string in current match process.
+
+
+# const OnigUChar* onig_get_right_range_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the right range address of subject string.
+
+
+# const OnigUChar* onig_get_current_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the current address of subject string in current match process.
+
+
+# OnigRegex onig_get_regex_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the regex object address of this callout.
+
+
+# unsigned long onig_get_retry_counter_by_callout_args(OnigCalloutArgs* args)
+
+ Returns the current counter value for retry-limit-in-match.
+
+
+
+(6) Tag
+
+ "Tag" is a name assigned to a callout in regexp pattern.
+ Allowed tag string characters: _ A-Z a-z 0-9 (* first character: _ A-Z a-z)
+
+
+# int onig_callout_tag_is_exist_at_callout_num(OnigRegex reg, int callout_num)
+
+ Returns 1 if tag is assigned for the callout, else returns 0.
+
+
+# int onig_get_callout_num_by_tag(OnigRegex reg, const OnigUChar* tag, const OnigUChar* tag_end)
+
+ Returns the callout number for the tag.
+
+
+# const OnigUChar* onig_get_callout_tag_start(OnigRegex reg, int callout_num)
+
+ Returns the start address of tag string for the callout.
+ (NULL terminated string)
+
+
+# const OnigUChar* onig_get_callout_tag_end(OnigRegex reg, int callout_num)
+
+ Returns the end address of tag string for the callout.
+
+
+
+(7) Callout data (used in callout functions)
+
+ "Callout data" is ONIG_CALLOUT_DATA_SLOT_NUM(5) values area
+ for each callout in each search process.
+ Each value area in a callout is indicated by "slot" number (0 - 4).
+ Callout data are used for any purpose by callout function implementers.
+
+
+# int onig_get_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ Returns the callout data value/type for a callout slot indicated by
+ callout_num/slot.
+
+ normal return: ONIG_NORMAL
+ 1: not yet set (type is ONIG_TYPE_VOID)
+ < 0: error code
+
+
+# int onig_get_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
+
+ Returns self callout data value/type.
+
+ normal return: ONIG_NORMAL
+ 1: not yet set (type is ONIG_TYPE_VOID)
+ < 0: error code
+
+
+# int onig_set_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType type, OnigValue* val)
+
+ Set the callout data value/type for a callout slot indicated by callout_num/slot.
+
+ normal return: ONIG_NORMAL
+ < 0: error code
+
+
+# int onig_set_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType type, OnigValue* val)
+
+ Set self callout data value/type for a callout slot indicated by slot.
+
+ normal return: ONIG_NORMAL
+ < 0: error code
+
+
+# int onig_get_callout_data_by_callout_args_self_dont_clear_old(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
+
+ This function is almost same as onig_get_callout_data_by_callout_args_self().
+ But this function doesn't clear values which set in previous failed match process.
+ Other onig_get_callout_data_xxxx() functions clear all values which set
+ in previous failed match process.
+
+ For example, Builtin callout (*TOTAL_COUNT) is implemented by using this
+ function for accumulate count of all of match processes in a search process.
+ Builtin callout (*COUNT) returns count in last success match process only,
+ because it doesn't use this function.
+
+
+(8) Callout data (used in apllications)
+
+# int onig_get_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ Returns the callout data value/type for a callout slot indicated by
+ callout_num/slot.
+
+ normal return: ONIG_NORMAL
+ 1: not yet set (type is ONIG_TYPE_VOID)
+ < 0: error code
+
+
+# int onig_get_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val)
+
+ Returns the callout data value/type for a callout slot indicated by tag/slot.
+
+ normal return: ONIG_NORMAL
+ 1: not yet set (type is ONIG_TYPE_VOID)
+ < 0: error code
+
+
+# int onig_set_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType type, OnigValue* val)
+
+ Set the callout data value/type for a callout slot indicated by callout_num/slot.
+
+ normal return: ONIG_NORMAL
+ < 0: error code
+
+
+# int onig_set_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val)
+
+ Set the callout data value/type for a callout slot indicated by tag/slot.
+
+ normal return: ONIG_NORMAL
+ < 0: error code
+
+
+# int onig_get_callout_data_dont_clear_old(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ No needs to use this function.
+ It will be abolished.
+
+
+
+(9) Miscellaneous functions
+
+# OnigUChar* onig_get_callout_name_by_name_id(int name_id)
+
+ Returns callout name of the name id.
+ if invalid name id is passed, return 0.
+
+
+# int onig_get_capture_range_in_callout(OnigCalloutArgs* args, int mem_num, int* begin, int* end)
+
+ Returns current capture range position.
+ Position is byte length offset from subject string.
+ For uncaptured mem_num, ONIG_REGION_NOTPOS is set.
+
+
+# int onig_get_used_stack_size_in_callout(OnigCalloutArgs* args, int* used_num, int* used_bytes)
+
+ Returns current used match-stack size.
+
+ used_num: number of match-stack elements
+ used_bytes: used byte size of match-stack
+
+//END
diff --git a/doc/CALLOUTS.API.ja b/doc/CALLOUTS.API.ja
new file mode 100644
index 0000000..49d0689
--- /dev/null
+++ b/doc/CALLOUTS.API.ja
@@ -0,0 +1,382 @@
+Callouts API Version 6.8.2 2018/04/13
+
+#include <oniguruma.h>
+
+(1) 呼び出し関数
+(2) 内容の呼び出し関数の設定/取得
+(3) 名前の呼び出し関数の設定
+(4) ユーザデータ
+(5) OnigCalloutArgsからの値の取得
+(6) 名札
+(7) 呼び出しデータ (呼び出し関数内から使用される)
+(8) 呼び出しデータ (アプリケーションから使用される)
+(9) その他の関数
+
+
+(1) 呼び出し関数
+
+ 型: OnigCalloutFunc
+
+ typedef int (*OnigCalloutFunc)(OnigCalloutArgs* args, void* user_data);
+
+ 若し呼び出し関数として0(NULL)がセットされると、呼ばれることはない
+
+
+ * 呼び出し関数の戻り値 (int)
+
+ ONIG_CALLOUT_FAIL(1): 失敗
+ ONIG_CALLOUT_SUCCESS(0): 成功
+ -1未満: エラーコード (検索/照合の終了)
+
+ ONIG_CALLOUT_FAIL/SUCCESSは、後退中の呼び出しでは無視される。
+ 後退は失敗の回復過程なので。
+
+ * 呼び出し関数の例
+
+ extern int always_success(OnigCalloutArgs* args, void* user_data)
+ {
+ return ONIG_CALLOUT_SUCCESS;
+ }
+
+
+
+(2) 内容の呼び出し関数の設定/取得
+
+# OnigCalloutFunc onig_get_progress_callout(void)
+
+ 内容の呼び出し関数(前進)を返す
+
+
+# int onig_set_progress_callout(OnigCalloutFunc f)
+
+ 内容の呼び出し関数(前進)をセットする。
+ この値はonig_initialize_match_param()の中でデフォルトの呼び出し関数として
+ セットされる。
+
+ 正常終了: ONIG_NORMAL
+
+
+# OnigCalloutFunc onig_get_retraction_callout(void)
+
+ 内容の呼び出し関数(後退)を返す
+
+
+# int onig_set_retraction_callout(OnigCalloutFunc f)
+
+ 内容の呼び出し関数(後退)をセットする。
+ この値はonig_initialize_match_param()の中でデフォルトの呼び出し関数として
+ セットされる。
+
+ 正常終了: ONIG_NORMAL
+
+
+# int onig_set_progress_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f)
+
+ 内容の呼び出し関数(前進)をセットする。
+
+ 引数
+ 1 mp: match-paramアドレス
+ 2 f: 関数
+
+ 正常終了: ONIG_NORMAL
+
+
+# int onig_set_retraction_callout_of_match_param(OnigMatchParam* mp, OnigCalloutFunc f)
+
+ 内容の呼び出し関数(後退)をセットする。
+
+ 引数
+ 1 mp: match-paramアドレス
+ 2 f: 関数
+
+ 正常終了: ONIG_NORMAL
+
+
+
+(3) 名前の呼び出し関数の設定
+
+# int onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int opt_arg_num, OnigValue opt_defaults[])
+
+ 名前の呼び出し関数をセットする。
+ 名前に許される文字: _ A-Z a-z 0-9 (* 最初の文字: _ A-Z a-z)
+
+ (enc, name)のペアが、呼び出し関数を見つけるためのキーとして使用される。
+ アプリケーションで使用される各エンコーディングに対してこの関数を呼ぶ必要がある。
+ しかし若しencエンコーディングがASCII互換であり、(enc, name)に対するエントリが
+ 見つからない場合には、(ASCII, name)エントリが参照される。
+ 従って、若しASCII互換エンコーディングのみ使用している場合には、この関数を(ASCII, name)
+ について一回呼べば十分である。
+
+ 引数
+ 1 enc: 文字エンコーディング
+ 2 type: 呼び出し型 (現在は ONIG_CALLOUT_TYPE_SINGLE のみサポート)
+ 3 name: 名前のアドレス (encでエンコーディングされている文字列)
+ 4 name_end: 名前の終端アドレス
+ 5 callout_in: 方向フラグ (ONIG_CALLOUT_IN_PROGRESS/RETRACTION/BOTH)
+ 6 callout: 呼び出し関数
+ 7 end_callout: *まだ使用していない (0をセット)
+ 8 arg_num: 引数の数 (* 最大値 ONIG_CALLOUT_MAX_ARGS_NUM == 4)
+ 9 arg_types: 引数の型の配列
+ 10 opt_arg_num: オプション引数の数
+ 11 opt_defaults: オプション引数のデフォルト値
+
+ 正常終了: ONIG_NORMAL
+ error:
+ ONIGERR_INVALID_CALLOUT_NAME
+ ONIGERR_INVALID_ARGUMENT
+ ONIGERR_INVALID_CALLOUT_ARG
+
+
+
+(4) ユーザデータ
+
+# int onig_set_callout_user_data_of_match_param(OnigMatchParam* param, void* user_data)
+
+ 呼び出し関数の引数として渡されるユーザデータをセットする。
+
+ 正常終了: ONIG_NORMAL
+
+
+
+(5) OnigCalloutArgsからの値の取得
+
+# int onig_get_callout_num_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの呼び出し番号を返す。
+ "呼び出し番号"とは、正規表現パターンの中の呼び出しに対する識別子である。
+
+
+# OnigCalloutIn onig_get_callout_in_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しが起きた時の方向(前進中/後退中)を返す。
+ (ONIG_CALLOUT_IN_PROGRESS か ONIG_CALLOUT_IN_RETRACTION)
+
+
+# int onig_get_name_id_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの名前(name)の識別子を返す。
+ 若しこの呼び出しが内容の呼び出しのときには、ONIG_NON_NAME_IDが返される。
+
+
+# const OnigUChar* onig_get_contents_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの内容文字列(NULL終端あり)を返す。
+ 若しこの呼び出しが名前の呼び出しのときには、NULLを返す。
+
+
+# const OnigUChar* onig_get_contents_end_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの内容(contents)の終端を返す。
+ 若しこの呼び出しが名前の呼び出しのときには、NULLを返す。
+
+
+# int onig_get_args_num_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの引数の数を返す。
+ 正規表現パターンの中で渡されなかったオプション引数も含む。
+ 若しこの呼び出しが内容の呼び出しのときには、ONIGERR_INVALID_ARGUMENTが返される。
+
+
+# int onig_get_passed_args_num_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの本当に渡された引数の数を返す。
+ 若しこの呼び出しが内容の呼び出しのときには、ONIGERR_INVALID_ARGUMENTが返される。
+
+
+# int onig_get_arg_by_callout_args(OnigCalloutArgs* args, int index, OnigType* type, OnigValue* val)
+
+ この呼び出しの一個の引数の値と型を返す。
+ 若しこの呼び出しが内容の呼び出しのときには、ONIGERR_INVALID_ARGUMENTが返される。
+
+ 正常終了: ONIG_NORMAL
+
+
+# const OnigUChar* onig_get_string_by_callout_args(OnigCalloutArgs* args)
+
+ 対象文字列のアドレスを返す。
+ onig_search()の二番目の引数(str)である。
+
+
+# const OnigUChar* onig_get_string_end_by_callout_args(OnigCalloutArgs* args)
+
+ 対象文字列の終端アドレスを返す。
+ onig_search()の三番目の引数(end)である。
+
+
+# const OnigUChar* onig_get_start_by_callout_args(OnigCalloutArgs* args)
+
+ 対象文字列の現在の照合処理開始アドレスを返す。
+
+
+# const OnigUChar* onig_get_right_range_by_callout_args(OnigCalloutArgs* args)
+
+ 対象文字列の現在の照合範囲アドレスを返す。
+
+
+# const OnigUChar* onig_get_current_by_callout_args(OnigCalloutArgs* args)
+
+ 対象文字列の現在の照合位置アドレスを返す。
+
+
+# OnigRegex onig_get_regex_by_callout_args(OnigCalloutArgs* args)
+
+ この呼び出しの正規表現オブジェクトのアドレスを返す。
+
+
+# unsigned long onig_get_retry_counter_by_callout_args(OnigCalloutArgs* args)
+
+ retry-limit-in-matchのためのリトライカウンタの現在値を返す。
+
+
+
+(6) 名札
+
+ "Tag" (名札)とは、正規表現パターンの中で呼び出しに割り当てられた名前である。
+ tag文字列に使用できる文字: _ A-Z a-z 0-9 (* 先頭の文字: _ A-Z a-z)
+
+
+# int onig_callout_tag_is_exist_at_callout_num(OnigRegex reg, int callout_num)
+
+ その呼び出しにtagが割り当てられていれば1を返す、そうでなければ0を返す。
+
+
+# const OnigUChar* onig_get_callout_tag_start(OnigRegex reg, int callout_num)
+
+ その呼び出しに対するtag文字列(NULL終端あり)の先頭アドレスを返す。
+
+
+# const OnigUChar* onig_get_callout_tag_end(OnigRegex reg, int callout_num)
+
+ その呼び出しに対するtag文字列の終端アドレスを返す。
+
+
+# int onig_get_callout_num_by_tag(OnigRegex reg, const OnigUChar* tag, const OnigUChar* tag_end)
+
+ そのtagに対する呼び出し番号を返す。
+
+
+
+(7) 呼び出しデータ (呼び出し関数内から使用される)
+
+ "呼び出しデータ" (callout data)とは、
+ それぞれの呼び出しに対してそれぞれの検索処理の中で割り当てられた、
+ ONIG_CALLOUT_DATA_SLOT_NUM(== 5)個の値の領域である。
+ 一個の呼び出しに対する各値の領域は、"スロット"(slot)番号(0 - 4)によって示される。
+ 呼び出しデータは呼び出し関数の実装者によって任意の目的に使用される。
+
+
+# int onig_get_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ callout_num/slotによって示された呼び出しスロットに対するデータの値/型を返す。
+
+ 正常終了: ONIG_NORMAL
+ 1: 値が未セット (typeは ONIG_TYPE_VOID)
+ < 0: エラーコード
+
+
+# int onig_get_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
+
+ 自分自身の呼び出しのslotによって示されたスロットに対するデータの値/型を返す。
+
+ 正常終了: ONIG_NORMAL
+ 1: 値が未セット (typeは ONIG_TYPE_VOID)
+ < 0: エラーコード
+
+
+# int onig_set_callout_data_by_callout_args(OnigCalloutArgs* args, int callout_num, int slot, OnigType type, OnigValue* val)
+
+ callout_num/slotによって示された呼び出しスロットに対する値/型をセットする。。
+
+ 正常終了: ONIG_NORMAL
+ < 0: エラーコード
+
+
+# int onig_set_callout_data_by_callout_args_self(OnigCalloutArgs* args, int slot, OnigType type, OnigValue* val)
+
+ 自分自身の呼び出しのslotによって示されたスロットに対する値/型をセットする。。
+
+ 正常終了: ONIG_NORMAL
+ < 0: エラーコード
+
+
+# int onig_get_callout_data_by_callout_args_self_dont_clear_old(OnigCalloutArgs* args, int slot, OnigType* type, OnigValue* val)
+
+ この関数は、onig_get_callout_data_by_callout_args_self()とほぼ同じである。
+ しかしこの関数は、現在の照合処理以前の失敗した照合処理の中でセットされた値を
+ クリアしない。
+ 他のonig_get_callout_data_xxxx()関数は、以前の失敗した照合処理の中でセットされた値を
+ クリアする。
+
+ 例えば、組み込み呼び出し(*TOTAL_COUNT)は、検索処理の中の全ての照合処理の積算カウントを
+ 得るためにこの関数を使用して実装されている。
+ 組み込む呼び出し(*COUNT)は、この関数を使用しないので、最後の成功した照合処理だけの
+ カウントを返す。
+
+
+
+(8) 呼び出しデータ (アプリケーションから使用される)
+
+# int onig_get_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ callout_num/slotによって示された呼び出しスロットに対するデータの値/型を返す。
+
+ 正常終了: ONIG_NORMAL
+ 1: 値が未セット (typeは ONIG_TYPE_VOID)
+ < 0: エラーコード
+
+
+# int onig_get_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val)
+
+ tag/slotによって示された呼び出しスロットに対するデータの値/型を返す。
+
+ 正常終了: ONIG_NORMAL
+ 1: 値が未セット (typeは ONIG_TYPE_VOID)
+ < 0: エラーコード
+
+
+# int onig_set_callout_data(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType type, OnigValue* val)
+
+ callout_num/slotによって示された呼び出しスロットに対する値/型をセットする。。
+
+ 正常終了: ONIG_NORMAL
+ < 0: エラーコード
+
+
+# int onig_set_callout_data_by_tag(OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val)
+
+ tag/slotによって示された呼び出しスロットに対する値/型をセットする。。
+
+ 正常終了: ONIG_NORMAL
+ < 0: エラーコード
+
+
+# int onig_get_callout_data_dont_clear_old(OnigRegex reg, OnigMatchParam* mp, int callout_num, int slot, OnigType* type, OnigValue* val)
+
+ この関数を使用する必要はないと思われる。
+ 廃止予定。
+
+
+
+(9) その他の関数
+
+# OnigUChar* onig_get_callout_name_by_name_id(int name_id)
+
+ 名前の識別子に対する名前を返す。
+ 不正な識別子が渡された場合には0を返す。
+
+
+# int onig_get_capture_range_in_callout(OnigCalloutArgs* args, int mem_num, int* begin, int* end)
+
+ 現在の捕獲範囲を返す。
+ 位置は、対象文字列に対するバイト単位で表される。
+ 未捕獲のmem_numに対しては、ONIG_REGION_NOTPOSがセットされる。
+
+
+# int onig_get_used_stack_size_in_callout(OnigCalloutArgs* args, int* used_num, int* used_bytes)
+
+ 現在使用されている照合処理用スタックサイズを返す。
+
+ used_num: 要素数
+ used_bytes: バイト数
+
+//END
diff --git a/doc/CALLOUTS.BUILTIN b/doc/CALLOUTS.BUILTIN
index dcf87f8..26840e7 100644
--- a/doc/CALLOUTS.BUILTIN
+++ b/doc/CALLOUTS.BUILTIN
@@ -1,4 +1,4 @@
-CALLOUTS.BUILTIN 2018/03/19
+CALLOUTS.BUILTIN 2018/03/26
* FAIL (progress)
@@ -12,15 +12,15 @@ CALLOUTS.BUILTIN 2018/03/19
(*MISMATCH)
- Terminate Match process.
- Continue Search process.
+ Terminates Match process.
+ Continues Search process.
* ERROR (progress)
(*ERROR{n::LONG})
- Terminate Search/Match process.
+ Terminates Search/Match process.
Return value is the argument 'n'. (The value must be less than -1)
'n' is an optional argument. (default value is ONIG_ABORT)
@@ -28,12 +28,20 @@ CALLOUTS.BUILTIN 2018/03/19
* MAX (progress/retraction)
- (*MAX{n::LONG})
+ (*MAX{n::LONG/TAG, c::CHAR})
+
+ Restricts the maximum count of success(default), progress or retraction.
+ If 'n' type is tag, slot 0 value of the tag are used.
+ Depends on 'c' argument, the slot 0 value changes.
+ 'c' is an optional argument, default value is 'X'.
+
+ (* success count = progress count - retraction count)
- Restrict the maximum count of success.
+
+ ex. "(?:(*COUNT[T]{X})a)*(?:(*MAX{T})c)*"
[callout data]
- slot 0: current success count.
+ slot 0: '>': progress count, '<': retraction count, 'X': success count (default)
* COUNT (progress/retraction)
@@ -42,15 +50,13 @@ CALLOUTS.BUILTIN 2018/03/19
Counter.
Depends on 'c' argument, the slot 0 value changes.
- 'c' is an optional argument, deefault value is '>'.
+ 'c' is an optional argument, default value is '>'.
[callout data]
- slot 0: '>': progress count, '<': retraction count, 'X': success count
+ slot 0: '>': progress count (default), '<': retraction count, 'X': success count
slot 1: progress count
slot 2: retraction count
- (* success count = progress count - retraction count)
-
** If option ONIG_OPTION_FIND_LONGEST or ONIG_OPTION_FIND_NOT_EMPTY is used,
counts are not accurate.
@@ -61,10 +67,10 @@ CALLOUTS.BUILTIN 2018/03/19
It's the almost same as COUNT.
But the counts are integrated in a search process.
- 'c' is an optional argument, deefault value is '>'.
+ 'c' is an optional argument, default value is '>'.
[callout data]
- slot 0: '>': progress count, '<': retraction count, 'X': success count
+ slot 0: '>': progress count (default), '<': retraction count, 'X': success count
slot 1: progress count
slot 2: retraction count
@@ -76,7 +82,8 @@ CALLOUTS.BUILTIN 2018/03/19
(*CMP{x::TAG/LONG, op::STRING, y::TAG/LONG})
- Compare x value and y value with op operator.
+ Compares x value and y value with op operator.
+ If x and y types are tag, slot 0 value of the tag are used.
op: '==', '!=', '>', '<', '>=', '<='
diff --git a/doc/CALLOUTS.BUILTIN.ja b/doc/CALLOUTS.BUILTIN.ja
index e1a5b7a..d371beb 100644
--- a/doc/CALLOUTS.BUILTIN.ja
+++ b/doc/CALLOUTS.BUILTIN.ja
@@ -1,4 +1,4 @@
-CALLOUTS.BUILTIN.ja 2018/03/19
+CALLOUTS.BUILTIN.ja 2018/03/26
* FAIL (前進)
@@ -27,12 +27,17 @@ CALLOUTS.BUILTIN.ja 2018/03/19
* MAX (前進/後退)
- (*MAX{n::LONG})
+ (*MAX{n::LONG/TAG, c::CHAR})
- 成功回数を制限する
+ 成功(デフォルト)、前進または後退回数を制限する
+ 'n'がTAGのときは、そのTAGのcalloutのslot 0の値が使用される
+ 'c'引数の値によって、slot 0の値が変化する
+ 'c'はオプション引数で、デフォルト値は'X'
+
+ 例: "(?:(*COUNT[T]{X})a)*(?:(*MAX{T})c)*"
[callout data]
- slot 0: 現在の成功回数
+ slot 0: '>': 前進回数, '<': 後退回数, 'X': 成功回数(デフォルト)
* COUNT (前進/後退)
@@ -44,7 +49,7 @@ CALLOUTS.BUILTIN.ja 2018/03/19
'c'はオプション引数で、デフォルト値は'>'
[callout data]
- slot 0: '>': 前進回数, '<': 後退回数, 'X': 成功回数
+ slot 0: '>': 前進回数(デフォルト), '<': 後退回数, 'X': 成功回数
slot 1: 前進回数
slot 2: 後退回数
@@ -63,7 +68,7 @@ CALLOUTS.BUILTIN.ja 2018/03/19
'c'はオプション引数で、デフォルト値は'>'
[callout data]
- slot 0: '>': 前進回数, '<': 後退回数, 'X': 成功回数
+ slot 0: '>': 前進回数(デフォルト), '<': 後退回数, 'X': 成功回数
slot 1: 前進回数
slot 2: 後退回数
diff --git a/doc/RE b/doc/RE
index 4bd0e7d..e75daad 100644
--- a/doc/RE
+++ b/doc/RE
@@ -1,4 +1,4 @@
-Oniguruma Regular Expressions Version 6.8.0 2018/03/08
+Oniguruma Regular Expressions Version 6.8.0 2018/04/13
syntax: ONIG_SYNTAX_ONIGURUMA (default)
@@ -266,19 +266,32 @@ syntax: ONIG_SYNTAX_ONIGURUMA (default)
<Callouts>
* Callouts of contents
- (?{...contents...}) callouts in progress
- (?{...contents...}D) D is a direction flag char. ('X' or '<' or '>')
- D = 'X': progress and retraction, '<': retraction only
- '>': progress only (default)
+ (?{...contents...}) callout in progress
+ (?{...contents...}D) D is a direction flag char
+ D = 'X': in progress and retraction
+ '<': in retraction only
+ '>': in progress only
(?{...contents...}[tag]) tag assigned
(?{...contents...}[tag]D)
+ * Escape characters have no effects in contents.
+ * contents is not allowed to start with '{'.
+
+ (?{{{...contents...}}}) n times continuations '}' in contents is allowed in
+ (n+1) times continuations {{{...}}}.
+
+ Allowed tag string characters: _ A-Z a-z 0-9 (* first character: _ A-Z a-z)
+
+
* Callouts of name
(*name)
(*name{args...}) with args
(*name[tag]) tag assigned
(*name[tag]{args...})
+ Allowed name string characters: _ A-Z a-z 0-9 (* first character: _ A-Z a-z)
+ Allowed tag string characters: _ A-Z a-z 0-9 (* first character: _ A-Z a-z)
+
<Absent functions>
diff --git a/doc/RE.ja b/doc/RE.ja
index a7f6b8d..8cc0990 100644
--- a/doc/RE.ja
+++ b/doc/RE.ja
@@ -1,4 +1,4 @@
-鬼車 正規表現 Version 6.8.0 2018/03/08
+鬼車 正規表現 Version 6.8.0 2018/04/13
使用文法: ONIG_SYNTAX_ONIGURUMA (既定値)
@@ -269,17 +269,31 @@
* 内容の呼び出し
(?{...contents...}) 前進中のみの呼び出し
- (?{...contents...}D) Dは方向指定文字 ('X' or '<' or '>')
- D = 'X': 前進および後退, '<' 後退のみ, '>': 前進のみ
+ (?{...contents...}D) Dは方向指定文字
+ D = 'X': 前進中および後退中
+ '<': 後退中のみ
+ '>': 前進中のみ
(?{...contents...}[tag]) 名札付き
(?{...contents...}[tag]D)
+ * エスケープ文字はcontentsの中で何の機能も持たない
+ * contentsは、'{'文字で始まってはならない
+
+ (?{{{...contents...}}}) contentsの中のn個連続の'}'は、(n+1)個連続の{{{...}}}
+ の中で許される
+
+ tagに許される文字: _ A-Z a-z 0-9 (* 最初の文字: _ A-Z a-z)
+
+
* 名前の呼び出し
(*name)
(*name{args...}) 引数付き
(*name[tag]) 名札付き
(*name[tag]{args...})
+ nameに許される文字: _ A-Z a-z 0-9 (* 最初の文字: _ A-Z a-z)
+ tag に許される文字: _ A-Z a-z 0-9 (* 最初の文字: _ A-Z a-z)
+
<不在機能群>
@@ -296,7 +310,7 @@
例 (?~|345|\d*) "12345678" ==> "12", "1", ""
(?~|不在式) 不在停止 (* 原作)
- この演算子を通過した後は、対象文字列の適合範囲の最後が
+ この演算子を通過した後は、対象文字列の適合範囲が
<不在式>に適合する文字列を含まない範囲に制限される。
(?~|) 範囲消去
diff --git a/index.html b/index.html
index de58ba0..82405af 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
<h1>Oniguruma</h1> (<a href="index_ja.html">Japanese</a>)
<p>
-(c) K.Kosako, updated at: 2018/03/19
+(c) K.Kosako, updated at: 2018/04/14
</p>
<dl>
@@ -16,6 +16,7 @@
<dt><b>What's new</b>
</font>
<ul>
+<li>2018/04/17: Version 6.8.2 released.</li>
<li>2018/03/19: Version 6.8.1 released.</li>
<li>2018/03/16: Version 6.8.0 released.</li>
<li>2018/01/26: Version 6.7.1 released.</li>
diff --git a/index_ja.html b/index_ja.html
index 02565a0..c93f406 100644
--- a/index_ja.html
+++ b/index_ja.html
@@ -8,7 +8,7 @@
<h1>鬼車</h1>
<p>
-(c) K.Kosako, 最終更新: 2018/03/19
+(c) K.Kosako, 最終更新: 2018/04/14
</p>
<dl>
@@ -16,6 +16,7 @@
<dt><b>更新情報</b>
</font>
<ul>
+<li>2018/04/17: Version 6.8.2 リリース</li>
<li>2018/03/19: Version 6.8.1 リリース</li>
<li>2018/03/16: Version 6.8.0 リリース</li>
<li>2018/01/26: Version 6.7.1 リリース</li>
diff --git a/install-sh b/install-sh
index 0360b79..8175c64 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -271,15 +271,18 @@ do
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"`
@@ -288,6 +291,11 @@ do
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
@@ -324,34 +332,43 @@ do
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
+ # Note that $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/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+ 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' feature.
if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ $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.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ 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 -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ $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/d" "$tmpdir"
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
@@ -427,8 +444,8 @@ do
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
@@ -493,7 +510,7 @@ do
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: "UTC0"
diff --git a/missing b/missing
index c6e3795..625aeb1 100755
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 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
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
# 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
@@ -101,9 +101,9 @@ else
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 ()
{
@@ -207,7 +207,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
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: "UTC0"
diff --git a/sample/callout.c b/sample/callout.c
index ab89543..b5e3d91 100644
--- a/sample/callout.c
+++ b/sample/callout.c
@@ -13,7 +13,6 @@ callout_body(OnigCalloutArgs* args, void* user_data)
int i;
int n;
int begin, end;
- int len;
int used_num;
int used_bytes;
OnigCalloutIn in;
@@ -41,6 +40,8 @@ callout_body(OnigCalloutArgs* args, void* user_data)
in == ONIG_CALLOUT_IN_PROGRESS ? "PROGRESS" : "RETRACTION",
contents, start, current);
+ fprintf(stdout, "user_data: %s\n", (char* )user_data);
+
(void )onig_get_used_stack_size_in_callout(args, &used_num, &used_bytes);
fprintf(stdout, "stack: used_num: %d, used_bytes: %d\n", used_num, used_bytes);
@@ -119,7 +120,7 @@ bar(OnigCalloutArgs* args, void* user_data)
}
static int
-test(OnigEncoding enc, char* in_pattern, char* in_str)
+test(OnigEncoding enc, OnigMatchParam* mp, char* in_pattern, char* in_str)
{
int r;
unsigned char *start, *range, *end;
@@ -146,7 +147,8 @@ test(OnigEncoding enc, char* in_pattern, char* in_str)
end = str + strlen((char* )str);
start = str;
range = end;
- r = onig_search(reg, str, end, start, range, region, ONIG_OPTION_NONE);
+ r = onig_search_with_param(reg, str, end, start, range, region,
+ ONIG_OPTION_NONE, mp);
if (r >= 0) {
int i;
@@ -173,11 +175,13 @@ extern int main(int argc, char* argv[])
{
int r;
int id;
+ void* user_data;
UChar* name;
OnigEncoding use_encs[1];
unsigned int arg_types[4];
OnigValue opt_defaults[4];
OnigEncoding enc;
+ OnigMatchParam* mp;
enc = ONIG_ENCODING_UTF8;
use_encs[0] = enc;
@@ -219,36 +223,46 @@ extern int main(int argc, char* argv[])
(void)onig_set_progress_callout(progress_callout_func);
(void)onig_set_retraction_callout(retraction_callout_func);
+ mp = onig_new_match_param();
+
+ user_data = (void* )"something data";
+ r = onig_set_callout_user_data_of_match_param(mp, user_data);
+ if (r != ONIG_NORMAL) {
+ fprintf(stderr, "ERROR: fail onig_set_callout_user_data_of_match_param(): %d\n", r);
+ }
+
/* callout of contents */
- test(enc, "a+(?{foo bar baz...}X)$", "aaab");
- test(enc, "(?{{!{}#$%&'()=-~^|[_]`@*:+;<>?/.\\,}}[symbols])c", "abc");
- test(enc, "\\A(...)(?{{{booooooooooooo{{ooo}}ooooooooooz}}}<)", "aaab");
- test(enc, "\\A(?!a(?{in prec-read-not}[xxx]X)b)", "ac");
- test(enc, "(?<!a(?{in look-behind-not}X)c)c", "abc");
+ test(enc, mp, "a+(?{foo bar baz...}X)$", "aaab");
+ test(enc, mp, "(?{{!{}#$%&'()=-~^|[_]`@*:+;<>?/.\\,}}[symbols])c", "abc");
+ test(enc, mp, "\\A(...)(?{{{booooooooooooo{{ooo}}ooooooooooz}}}<)", "aaab");
+ test(enc, mp, "\\A(?!a(?{in prec-read-not}[xxx]X)b)", "ac");
+ test(enc, mp, "(?<!a(?{in look-behind-not}X)c)c", "abc");
// callout of name
- test(enc, "\\A(*foo)abc", "abc");
- test(enc, "abc(?:(*FAIL)|$)", "abcabc");
- test(enc, "abc(?:$|(*MISMATCH)|abc$)", "abcabc");
- test(enc, "abc(?:(*ERROR)|$)", "abcabc");
- test(enc, "ab(*foo{})(*FAIL)", "abc");
- test(enc, "abc(d|(*ERROR{-999}))", "abc");
- test(enc, "ab(*bar{372,I am a bar's argument,あ})c(*FAIL)", "abc");
- test(enc, "ab(*bar{1234567890})", "abc");
- test(enc, "(?:a(*MAX{2})|b)*", "abbabbabbabb");
- test(enc, "(?:(*MAX{2})a|b)*", "abbabbabbabb");
- test(enc, "(?:(*MAX{1})a|b)*", "bbbbbabbbbbabbbbb");
- test(enc, "(?:(*MAX{3})a|(*MAX{4})b)*", "bbbaabbab");
- test(enc, "(?:(*MAX[A]{3})a|(*MAX[B]{5})b)*(*CMP{A,<,B})", "abababc");
- test(enc, "(?:(*MAX[A]{7})a|(*MAX[B]{5})b)*(*CMP{A,>=,4})", "abababcabababaa");
+ test(enc, mp, "\\A(*foo)abc", "abc");
+ test(enc, mp, "abc(?:(*FAIL)|$)", "abcabc");
+ test(enc, mp, "abc(?:$|(*MISMATCH)|abc$)", "abcabc");
+ test(enc, mp, "abc(?:(*ERROR)|$)", "abcabc");
+ test(enc, mp, "ab(*foo{})(*FAIL)", "abc");
+ test(enc, mp, "abc(d|(*ERROR{-999}))", "abc");
+ test(enc, mp, "ab(*bar{372,I am a bar's argument,あ})c(*FAIL)", "abc");
+ test(enc, mp, "ab(*bar{1234567890})", "abc");
+ test(enc, mp, "(?:a(*MAX{2})|b)*", "abbabbabbabb");
+ test(enc, mp, "(?:(*MAX{2})a|b)*", "abbabbabbabb");
+ test(enc, mp, "(?:(*MAX{1})a|b)*", "bbbbbabbbbbabbbbb");
+ test(enc, mp, "(?:(*MAX{3})a|(*MAX{4})b)*", "bbbaabbab");
+ test(enc, mp, "(?:(*MAX[A]{3})a|(*MAX[B]{5})b)*(*CMP{A,<,B})", "abababc");
+ test(enc, mp, "(?:(*MAX[A]{7})a|(*MAX[B]{5})b)*(*CMP{A,>=,4})", "abababcabababaa");
+ test(enc, mp, "(?:(*MAX[T]{3})a)*(?:(*MAX{T})c)*", "aaccc");
/* callouts in condition */
- test(enc, "\\A(?(?{in condition})then|else)\\z", "then");
- test(enc, "\\A(?(*FAIL)then|else)\\z", "else");
+ test(enc, mp, "\\A(?(?{in condition})then|else)\\z", "then");
+ test(enc, mp, "\\A(?(*FAIL)then|else)\\z", "else");
/* monitor test */
- test(enc, "(?:(*MON{X})(*FAIL)|.{,3}(*MON[FOO])k)", "abcdefghijk");
+ test(enc, mp, "(?:(*MON{X})(*FAIL)|.{,3}(*MON[FOO])k)", "abcdefghijk");
+ onig_free_match_param(mp);
onig_end();
return 0;
}
diff --git a/sample/count.c b/sample/count.c
index 0f0e1f2..2b67db7 100644
--- a/sample/count.c
+++ b/sample/count.c
@@ -88,12 +88,8 @@ test(OnigEncoding enc, OnigMatchParam* mp, char* in_pattern, char* in_str)
extern int main(int argc, char* argv[])
{
int r;
- int id;
- UChar* name;
OnigMatchParam* mp;
OnigEncoding encs[3];
- OnigType arg_types[4];
- OnigValue opt_defaults[4];
encs[0] = ONIG_ENCODING_UTF8;
encs[1] = ONIG_ENCODING_UTF16_BE;
diff --git a/src/Makefile.am b/src/Makefile.am
index 911aecd..c7a4705 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,8 +19,9 @@ endif
lib_LTLIBRARIES = $(libname)
libonig_la_SOURCES = regint.h regparse.h regenc.h st.h \
- regerror.c regparse.c regext.c regcomp.c regexec.c reggnu.c \
- regenc.c regsyntax.c regtrav.c regversion.c st.c \
+ regparse.c regcomp.c regexec.c \
+ regenc.c regerror.c regext.c regsyntax.c regtrav.c regversion.c st.c \
+ reggnu.c \
$(posix_sources) \
unicode.c \
unicode_unfold_key.c \
diff --git a/src/ascii.c b/src/ascii.c
index 7efaa26..eb38944 100644
--- a/src/ascii.c
+++ b/src/ascii.c
@@ -37,16 +37,19 @@ init(void)
int id;
OnigEncoding enc;
char* name;
- unsigned int t_long;
unsigned int args[4];
OnigValue opts[4];
enc = ONIG_ENCODING_ASCII;
- t_long = ONIG_TYPE_LONG;
name = "FAIL"; BC0_P(name, fail);
name = "MISMATCH"; BC0_P(name, mismatch);
- name = "MAX"; BC_B(name, max, 1, &t_long);
+
+ name = "MAX";
+ args[0] = ONIG_TYPE_TAG | ONIG_TYPE_LONG;
+ args[1] = ONIG_TYPE_CHAR;
+ opts[0].c = 'X';
+ BC_B_O(name, max, 2, args, 1, opts);
name = "ERROR";
args[0] = ONIG_TYPE_LONG; opts[0].l = ONIG_ABORT;
@@ -110,5 +113,6 @@ OnigEncodingType OnigEncodingASCII = {
init,
0, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/big5.c b/src/big5.c
index ff0c51b..dbc750d 100644
--- a/src/big5.c
+++ b/src/big5.c
@@ -187,5 +187,6 @@ OnigEncodingType OnigEncodingBIG5 = {
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/cp1251.c b/src/cp1251.c
index f7b43c3..e217037 100644
--- a/src/cp1251.c
+++ b/src/cp1251.c
@@ -200,5 +200,6 @@ OnigEncodingType OnigEncodingCP1251 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/euc_jp.c b/src/euc_jp.c
index 8dd6ac1..ae8c2fe 100644
--- a/src/euc_jp.c
+++ b/src/euc_jp.c
@@ -307,5 +307,6 @@ OnigEncodingType OnigEncodingEUC_JP = {
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/euc_kr.c b/src/euc_kr.c
index 08bfa1c..def311b 100644
--- a/src/euc_kr.c
+++ b/src/euc_kr.c
@@ -185,5 +185,6 @@ OnigEncodingType OnigEncodingEUC_CN = {
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/euc_tw.c b/src/euc_tw.c
index dbf0eac..8738598 100644
--- a/src/euc_tw.c
+++ b/src/euc_tw.c
@@ -168,5 +168,6 @@ OnigEncodingType OnigEncodingEUC_TW = {
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/gb18030.c b/src/gb18030.c
index 073c83b..d4a1108 100644
--- a/src/gb18030.c
+++ b/src/gb18030.c
@@ -89,25 +89,25 @@ is_valid_mbc_string(const UChar* p, const UChar* end)
p++;
if (p >= end) return FALSE;
if (*p < 0x40) {
- if (*p < 0x30 || *p > 0x39)
- return FALSE;
+ if (*p < 0x30 || *p > 0x39)
+ return FALSE;
- p++;
- if (p >= end) return FALSE;
- if (*p < 0x81 || *p == 0xff) return FALSE;
+ p++;
+ if (p >= end) return FALSE;
+ if (*p < 0x81 || *p == 0xff) return FALSE;
- p++;
- if (p >= end) return FALSE;
- if (*p < 0x30 || *p > 0x39)
- return FALSE;
+ p++;
+ if (p >= end) return FALSE;
+ if (*p < 0x30 || *p > 0x39)
+ return FALSE;
- p++;
+ p++;
}
else if (*p == 0x7f || *p == 0xff) {
- return FALSE;
+ return FALSE;
}
else {
- p++;
+ p++;
}
}
}
@@ -138,7 +138,7 @@ gb18030_mbc_case_fold(OnigCaseFoldType flag, const UChar** pp, const UChar* end,
#if 0
static int
gb18030_is_mbc_ambiguous(OnigCaseFoldType flag,
- const UChar** pp, const UChar* end)
+ const UChar** pp, const UChar* end)
{
return onigenc_mbn_is_mbc_ambiguous(ONIG_ENCODING_GB18030, flag, pp, end);
}
@@ -197,16 +197,16 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case S_START:
switch (GB18030_MAP[*p]) {
case C1:
- return (UChar *)s;
+ return (UChar *)s;
case C2:
- state = S_one_C2; /* C2 */
- break;
+ state = S_one_C2; /* C2 */
+ break;
case C4:
- state = S_one_C4; /* C4 */
- break;
+ state = S_one_C4; /* C4 */
+ break;
case CM:
- state = S_one_CM; /* CM */
- break;
+ state = S_one_CM; /* CM */
+ break;
}
break;
case S_one_C2: /* C2 */
@@ -214,10 +214,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)s;
+ return (UChar *)s;
case CM:
- state = S_odd_CM_one_CX; /* CM C2 */
- break;
+ state = S_odd_CM_one_CX; /* CM C2 */
+ break;
}
break;
case S_one_C4: /* C4 */
@@ -225,23 +225,23 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)s;
+ return (UChar *)s;
case CM:
- state = S_one_CMC4;
- break;
+ state = S_one_CMC4;
+ break;
}
break;
case S_one_CM: /* CM */
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)s;
+ return (UChar *)s;
case C4:
- state = S_odd_C4CM;
- break;
+ state = S_odd_C4CM;
+ break;
case CM:
- state = S_odd_CM_one_CX; /* CM CM */
- break;
+ state = S_odd_CM_one_CX; /* CM CM */
+ break;
}
break;
@@ -250,10 +250,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case CM:
- state = S_even_CM_one_CX;
- break;
+ state = S_even_CM_one_CX;
+ break;
}
break;
case S_even_CM_one_CX: /* CM CM C2 */ /* CM CM CM */ /* CM CM C4 */
@@ -261,10 +261,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)s;
+ return (UChar *)s;
case CM:
- state = S_odd_CM_one_CX;
- break;
+ state = S_odd_CM_one_CX;
+ break;
}
break;
@@ -272,26 +272,26 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case C4:
- state = S_one_C4_odd_CMC4; /* C4 CM C4 */
- break;
+ state = S_one_C4_odd_CMC4; /* C4 CM C4 */
+ break;
case CM:
- state = S_even_CM_one_CX; /* CM CM C4 */
- break;
+ state = S_even_CM_one_CX; /* CM CM C4 */
+ break;
}
break;
case S_odd_CMC4: /* CM C4 CM C4 CM C4 */
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case C4:
- state = S_one_C4_odd_CMC4;
- break;
+ state = S_one_C4_odd_CMC4;
+ break;
case CM:
- state = S_odd_CM_odd_CMC4;
- break;
+ state = S_odd_CM_odd_CMC4;
+ break;
}
break;
case S_one_C4_odd_CMC4: /* C4 CM C4 */
@@ -299,23 +299,23 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case CM:
- state = S_even_CMC4; /* CM C4 CM C4 */
- break;
+ state = S_even_CMC4; /* CM C4 CM C4 */
+ break;
}
break;
case S_even_CMC4: /* CM C4 CM C4 */
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)(s - 3);
+ return (UChar *)(s - 3);
case C4:
- state = S_one_C4_even_CMC4;
- break;
+ state = S_one_C4_even_CMC4;
+ break;
case CM:
- state = S_odd_CM_even_CMC4;
- break;
+ state = S_odd_CM_even_CMC4;
+ break;
}
break;
case S_one_C4_even_CMC4: /* C4 CM C4 CM C4 */
@@ -323,10 +323,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 3);
+ return (UChar *)(s - 3);
case CM:
- state = S_odd_CMC4;
- break;
+ state = S_odd_CMC4;
+ break;
}
break;
@@ -335,10 +335,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 3);
+ return (UChar *)(s - 3);
case CM:
- state = S_even_CM_odd_CMC4;
- break;
+ state = S_even_CM_odd_CMC4;
+ break;
}
break;
case S_even_CM_odd_CMC4: /* CM CM CM C4 CM C4 CM C4 */
@@ -346,10 +346,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case CM:
- state = S_odd_CM_odd_CMC4;
- break;
+ state = S_odd_CM_odd_CMC4;
+ break;
}
break;
@@ -358,10 +358,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 1);
+ return (UChar *)(s - 1);
case CM:
- state = S_even_CM_even_CMC4;
- break;
+ state = S_even_CM_even_CMC4;
+ break;
}
break;
case S_even_CM_even_CMC4: /* CM CM CM C4 CM C4 */
@@ -369,10 +369,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 3);
+ return (UChar *)(s - 3);
case CM:
- state = S_odd_CM_even_CMC4;
- break;
+ state = S_odd_CM_even_CMC4;
+ break;
}
break;
@@ -381,23 +381,23 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)s;
+ return (UChar *)s;
case CM:
- state = S_one_CM_odd_C4CM; /* CM C4 CM */
- break;
+ state = S_one_CM_odd_C4CM; /* CM C4 CM */
+ break;
}
break;
case S_one_CM_odd_C4CM: /* CM C4 CM */ /* CM C4 CM C4 CM C4 CM */
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)(s - 2); /* |CM C4 CM */
+ return (UChar *)(s - 2); /* |CM C4 CM */
case C4:
- state = S_even_C4CM;
- break;
+ state = S_even_C4CM;
+ break;
case CM:
- state = S_even_CM_odd_C4CM;
- break;
+ state = S_even_CM_odd_C4CM;
+ break;
}
break;
case S_even_C4CM: /* C4 CM C4 CM */
@@ -405,23 +405,23 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 2); /* C4|CM C4 CM */
+ return (UChar *)(s - 2); /* C4|CM C4 CM */
case CM:
- state = S_one_CM_even_C4CM;
- break;
+ state = S_one_CM_even_C4CM;
+ break;
}
break;
case S_one_CM_even_C4CM: /* CM C4 CM C4 CM */
switch (GB18030_MAP[*p]) {
case C1:
case C2:
- return (UChar *)(s - 0); /*|CM C4 CM C4|CM */
+ return (UChar *)(s - 0); /*|CM C4 CM C4|CM */
case C4:
- state = S_odd_C4CM;
- break;
+ state = S_odd_C4CM;
+ break;
case CM:
- state = S_even_CM_even_C4CM;
- break;
+ state = S_even_CM_even_C4CM;
+ break;
}
break;
@@ -430,10 +430,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 0); /* |CM CM|C4|CM */
+ return (UChar *)(s - 0); /* |CM CM|C4|CM */
case CM:
- state = S_odd_CM_odd_C4CM;
- break;
+ state = S_odd_CM_odd_C4CM;
+ break;
}
break;
case S_odd_CM_odd_C4CM: /* CM CM CM C4 CM */
@@ -441,10 +441,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 2); /* |CM CM|CM C4 CM */
+ return (UChar *)(s - 2); /* |CM CM|CM C4 CM */
case CM:
- state = S_even_CM_odd_C4CM;
- break;
+ state = S_even_CM_odd_C4CM;
+ break;
}
break;
@@ -453,10 +453,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */
+ return (UChar *)(s - 2); /* |CM CM|C4|CM C4 CM */
case CM:
- state = S_odd_CM_even_C4CM;
- break;
+ state = S_odd_CM_even_C4CM;
+ break;
}
break;
case S_odd_CM_even_C4CM: /* CM CM CM C4 CM C4 CM */
@@ -464,10 +464,10 @@ gb18030_left_adjust_char_head(const UChar* start, const UChar* s)
case C1:
case C2:
case C4:
- return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */
+ return (UChar *)(s - 0); /* |CM CM|CM C4 CM C4|CM */
case CM:
- state = S_even_CM_even_C4CM;
- break;
+ state = S_even_CM_even_C4CM;
+ break;
}
break;
}
@@ -535,5 +535,6 @@ OnigEncodingType OnigEncodingGB18030 = {
NULL, /* init */
NULL, /* is_initialized */
is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_1.c b/src/iso8859_1.c
index bcd7e26..ff47b80 100644
--- a/src/iso8859_1.c
+++ b/src/iso8859_1.c
@@ -272,5 +272,6 @@ OnigEncodingType OnigEncodingISO_8859_1 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_10.c b/src/iso8859_10.c
index a5946cc..f9804e2 100644
--- a/src/iso8859_10.c
+++ b/src/iso8859_10.c
@@ -239,5 +239,6 @@ OnigEncodingType OnigEncodingISO_8859_10 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_11.c b/src/iso8859_11.c
index ec94fd1..108ee8a 100644
--- a/src/iso8859_11.c
+++ b/src/iso8859_11.c
@@ -96,5 +96,6 @@ OnigEncodingType OnigEncodingISO_8859_11 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_13.c b/src/iso8859_13.c
index fba7fd4..9585355 100644
--- a/src/iso8859_13.c
+++ b/src/iso8859_13.c
@@ -228,5 +228,6 @@ OnigEncodingType OnigEncodingISO_8859_13 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_14.c b/src/iso8859_14.c
index e1f71f5..83fc551 100644
--- a/src/iso8859_14.c
+++ b/src/iso8859_14.c
@@ -241,5 +241,6 @@ OnigEncodingType OnigEncodingISO_8859_14 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_15.c b/src/iso8859_15.c
index 236e9e7..3a7ad05 100644
--- a/src/iso8859_15.c
+++ b/src/iso8859_15.c
@@ -235,5 +235,6 @@ OnigEncodingType OnigEncodingISO_8859_15 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_16.c b/src/iso8859_16.c
index 42045bd..02022d9 100644
--- a/src/iso8859_16.c
+++ b/src/iso8859_16.c
@@ -237,5 +237,6 @@ OnigEncodingType OnigEncodingISO_8859_16 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_2.c b/src/iso8859_2.c
index db93046..ecdbb99 100644
--- a/src/iso8859_2.c
+++ b/src/iso8859_2.c
@@ -235,5 +235,6 @@ OnigEncodingType OnigEncodingISO_8859_2 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_3.c b/src/iso8859_3.c
index 6fe5e6f..739f1c9 100644
--- a/src/iso8859_3.c
+++ b/src/iso8859_3.c
@@ -235,5 +235,6 @@ OnigEncodingType OnigEncodingISO_8859_3 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_4.c b/src/iso8859_4.c
index ee1eb93..4f2b6a0 100644
--- a/src/iso8859_4.c
+++ b/src/iso8859_4.c
@@ -237,5 +237,6 @@ OnigEncodingType OnigEncodingISO_8859_4 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_5.c b/src/iso8859_5.c
index 7d828e1..cf41061 100644
--- a/src/iso8859_5.c
+++ b/src/iso8859_5.c
@@ -226,5 +226,6 @@ OnigEncodingType OnigEncodingISO_8859_5 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_6.c b/src/iso8859_6.c
index a959e98..1ffe99f 100644
--- a/src/iso8859_6.c
+++ b/src/iso8859_6.c
@@ -96,5 +96,6 @@ OnigEncodingType OnigEncodingISO_8859_6 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_7.c b/src/iso8859_7.c
index e695523..87288c2 100644
--- a/src/iso8859_7.c
+++ b/src/iso8859_7.c
@@ -222,5 +222,6 @@ OnigEncodingType OnigEncodingISO_8859_7 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_8.c b/src/iso8859_8.c
index 66b63b8..8f162a4 100644
--- a/src/iso8859_8.c
+++ b/src/iso8859_8.c
@@ -96,5 +96,6 @@ OnigEncodingType OnigEncodingISO_8859_8 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/iso8859_9.c b/src/iso8859_9.c
index d780293..52589cf 100644
--- a/src/iso8859_9.c
+++ b/src/iso8859_9.c
@@ -228,5 +228,6 @@ OnigEncodingType OnigEncodingISO_8859_9 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/koi8.c b/src/koi8.c
index 8531825..9fb2ee5 100644
--- a/src/koi8.c
+++ b/src/koi8.c
@@ -250,5 +250,6 @@ OnigEncodingType OnigEncodingKOI8 = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/koi8_r.c b/src/koi8_r.c
index e88cfe3..8adc399 100644
--- a/src/koi8_r.c
+++ b/src/koi8_r.c
@@ -212,5 +212,6 @@ OnigEncodingType OnigEncodingKOI8_R = {
NULL, /* init */
NULL, /* is_initialized */
onigenc_always_true_is_valid_mbc_string,
- 0, 0, 0
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/oniguruma.h b/src/oniguruma.h
index 349c00e..322959a 100644
--- a/src/oniguruma.h
+++ b/src/oniguruma.h
@@ -36,7 +36,7 @@ extern "C" {
#define ONIGURUMA
#define ONIGURUMA_VERSION_MAJOR 6
#define ONIGURUMA_VERSION_MINOR 8
-#define ONIGURUMA_VERSION_TEENY 1
+#define ONIGURUMA_VERSION_TEENY 2
#define ONIGURUMA_VERSION_INT 60801
@@ -115,7 +115,7 @@ typedef struct {
OnigCodePoint one_or_more_time;
OnigCodePoint anychar_anytime;
} OnigMetaCharTableType;
-
+
typedef int (*OnigApplyAllCaseFoldFunc)(OnigCodePoint from, OnigCodePoint* to, int to_len, void* arg);
typedef struct OnigEncodingTypeST {
@@ -344,7 +344,7 @@ int onigenc_str_bytelen_null P_((OnigEncoding enc, const OnigUChar* p));
ONIG_EXTERN
int onigenc_is_valid_mbc_string P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
ONIG_EXTERN
-UChar* onigenc_strdup P_((OnigEncoding enc, const UChar* s, const UChar* end));
+OnigUChar* onigenc_strdup P_((OnigEncoding enc, const OnigUChar* s, const OnigUChar* end));
/* PART: regular expression */
@@ -549,7 +549,7 @@ ONIG_EXTERN OnigSyntaxType* OnigDefaultSyntax;
#define ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR -22
#define ONIGERR_FAIL_TO_INITIALIZE -23
/* general error */
-#define ONIGERR_INVALID_ARGUMENT -30
+#define ONIGERR_INVALID_ARGUMENT -30
/* syntax error */
#define ONIGERR_END_PATTERN_AT_LEFT_BRACE -100
#define ONIGERR_END_PATTERN_AT_LEFT_BRACKET -101
@@ -894,6 +894,8 @@ ONIG_EXTERN
int onig_set_progress_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));
ONIG_EXTERN
int onig_set_retraction_callout_of_match_param P_((OnigMatchParam* param, OnigCalloutFunc f));
+ONIG_EXTERN
+int onig_set_callout_user_data_of_match_param P_((OnigMatchParam* param, void* user_data));
/* for callout functions */
ONIG_EXTERN
@@ -905,15 +907,15 @@ OnigCalloutFunc onig_get_retraction_callout P_((void));
ONIG_EXTERN
int onig_set_retraction_callout P_((OnigCalloutFunc f));
ONIG_EXTERN
-int onig_set_callout_of_name P_((OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int optional_arg_num, OnigValue opt_defaults[])); /* name: single-byte string */
+int onig_set_callout_of_name P_((OnigEncoding enc, OnigCalloutType type, OnigUChar* name, OnigUChar* name_end, int callout_in, OnigCalloutFunc callout, OnigCalloutFunc end_callout, int arg_num, unsigned int arg_types[], int optional_arg_num, OnigValue opt_defaults[]));
ONIG_EXTERN
OnigUChar* onig_get_callout_name_by_name_id P_((int id));
ONIG_EXTERN
-int onig_get_callout_num_by_tag P_((OnigRegex reg, const UChar* tag, const UChar* tag_end));
+int onig_get_callout_num_by_tag P_((OnigRegex reg, const OnigUChar* tag, const OnigUChar* tag_end));
ONIG_EXTERN
-int onig_get_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const UChar* tag, const UChar* tag_end, int slot, OnigType* type, OnigValue* val));
+int onig_get_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType* type, OnigValue* val));
ONIG_EXTERN
-int onig_set_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const UChar* tag, const UChar* tag_end, int slot, OnigType type, OnigValue* val));
+int onig_set_callout_data_by_tag P_((OnigRegex reg, OnigMatchParam* mp, const OnigUChar* tag, const OnigUChar* tag_end, int slot, OnigType type, OnigValue* val));
/* used in callout functions */
ONIG_EXTERN
diff --git a/src/regcomp.c b/src/regcomp.c
index a19109f..f953ed1 100644
--- a/src/regcomp.c
+++ b/src/regcomp.c
@@ -2450,7 +2450,6 @@ is_exclusive(Node* x, Node* y, regex_t* reg)
if (NODE_STRING_LEN(x) == 0)
break;
- //c = *(xs->s);
switch (ytype) {
case NODE_CTYPE:
switch (CTYPE_(y)->ctype) {
@@ -2758,7 +2757,7 @@ tree_min_len(Node* node, ScanEnv* env)
len = en->min_len;
else {
if (NODE_IS_MARK1(node))
- len = 0; // recursive
+ len = 0; /* recursive */
else {
NODE_STATUS_ADD(node, NST_MARK1);
len = tree_min_len(NODE_BODY(node), env);
@@ -3763,7 +3762,7 @@ expand_case_fold_string(Node* node, regex_t* reg)
return r;
}
-#ifdef USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT
+#ifdef USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT
static enum QuantBodyEmpty
quantifiers_memory_node_info(Node* node)
{
@@ -3847,7 +3846,7 @@ quantifiers_memory_node_info(Node* node)
return r;
}
-#endif /* USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT */
+#endif /* USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT */
#define IN_ALT (1<<0)
@@ -4375,7 +4374,7 @@ setup_quant(Node* node, regex_t* reg, int state, ScanEnv* env)
if (IS_REPEAT_INFINITE(qn->upper) || qn->upper >= 1) {
d = tree_min_len(body, env);
if (d == 0) {
-#ifdef USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT
+#ifdef USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT
qn->body_empty_info = quantifiers_memory_node_info(body);
if (qn->body_empty_info == QUANT_BODY_IS_EMPTY_REC) {
if (NODE_TYPE(body) == NODE_ENCLOSURE &&
@@ -5979,7 +5978,10 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
#endif
root = 0;
- if (IS_NOT_NULL(einfo)) einfo->par = (UChar* )NULL;
+ if (IS_NOT_NULL(einfo)) {
+ einfo->enc = reg->enc;
+ einfo->par = (UChar* )NULL;
+ }
#ifdef ONIG_DEBUG
print_enc_string(stderr, reg->enc, pattern, pattern_end);
@@ -6124,7 +6126,6 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
err:
if (IS_NOT_NULL(scan_env.error)) {
if (IS_NOT_NULL(einfo)) {
- einfo->enc = scan_env.enc;
einfo->par = scan_env.error;
einfo->par_end = scan_env.error_end;
}
diff --git a/src/regenc.h b/src/regenc.h
index 4dd89ba..ae7a774 100644
--- a/src/regenc.h
+++ b/src/regenc.h
@@ -120,6 +120,10 @@ struct PropertyNameCtype {
#define ONIG_ENCODING_INIT_DEFAULT ONIG_ENCODING_ASCII
+#define ENC_FLAG_ASCII_COMPATIBLE (1<<0)
+#define ENC_FLAG_UNICODE (1<<1)
+
+
/* for encoding system implementation (internal) */
extern int onigenc_end(void);
extern int onigenc_ascii_apply_all_case_fold P_((OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg));
@@ -156,7 +160,7 @@ extern int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UCh
extern int onigenc_mb4_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
extern struct PropertyNameCtype* euc_jp_lookup_property_name P_((register const char *str, register unsigned int len));
extern struct PropertyNameCtype* sjis_lookup_property_name P_((register const char *str, register unsigned int len));
-//extern const struct PropertyNameCtype* unicode_lookup_property_name P_((register const char *str, register unsigned int len));
+/* extern const struct PropertyNameCtype* unicode_lookup_property_name P_((register const char *str, register unsigned int len)); */
/* in enc/unicode.c */
extern int onigenc_unicode_is_code_ctype P_((OnigCodePoint code, unsigned int ctype));
@@ -250,8 +254,9 @@ extern const unsigned short OnigEncAsciiCtypeTable[];
ONIGENC_IS_ASCII_CODE_CTYPE(code, ONIGENC_CTYPE_LOWER))
#define ONIGENC_IS_UNICODE_ENCODING(enc) \
- ((enc)->is_code_ctype == onigenc_unicode_is_code_ctype)
+ (((enc)->flag & ENC_FLAG_UNICODE) != 0)
-#define ONIGENC_IS_ASCII_COMPATIBLE_ENCODING(enc) ((enc)->min_enc_len == 1)
+#define ONIGENC_IS_ASCII_COMPATIBLE_ENCODING(enc) \
+ (((enc)->flag & ENC_FLAG_ASCII_COMPATIBLE) != 0)
#endif /* REGENC_H */
diff --git a/src/regexec.c b/src/regexec.c
index 35e3698..1ec5183 100644
--- a/src/regexec.c
+++ b/src/regexec.c
@@ -52,9 +52,9 @@ typedef struct {
struct OnigMatchParamStruct {
unsigned int match_stack_limit;
unsigned long retry_limit_in_match;
+#ifdef USE_CALLOUT
OnigCalloutFunc progress_callout_of_contents;
OnigCalloutFunc retraction_callout_of_contents;
-#ifdef USE_CALLOUT
int match_at_call_counter;
void* callout_user_data;
CalloutData* callout_data;
@@ -81,15 +81,34 @@ onig_set_retry_limit_in_match_of_match_param(OnigMatchParam* param,
extern int
onig_set_progress_callout_of_match_param(OnigMatchParam* param, OnigCalloutFunc f)
{
+#ifdef USE_CALLOUT
param->progress_callout_of_contents = f;
return ONIG_NORMAL;
+#else
+ return ONIG_NO_SUPPORT_CONFIG;
+#endif
}
extern int
onig_set_retraction_callout_of_match_param(OnigMatchParam* param, OnigCalloutFunc f)
{
+#ifdef USE_CALLOUT
param->retraction_callout_of_contents = f;
return ONIG_NORMAL;
+#else
+ return ONIG_NO_SUPPORT_CONFIG;
+#endif
+}
+
+extern int
+onig_set_callout_user_data_of_match_param(OnigMatchParam* param, void* user_data)
+{
+#ifdef USE_CALLOUT
+ param->callout_user_data = user_data;
+ return ONIG_NORMAL;
+#else
+ return ONIG_NO_SUPPORT_CONFIG;
+#endif
}
@@ -114,19 +133,21 @@ typedef struct {
#ifdef ONIG_DEBUG
/* arguments type */
-#define ARG_SPECIAL -1
-#define ARG_NON 0
-#define ARG_RELADDR 1
-#define ARG_ABSADDR 2
-#define ARG_LENGTH 3
-#define ARG_MEMNUM 4
-#define ARG_OPTION 5
-#define ARG_MODE 6
+typedef enum {
+ ARG_SPECIAL = -1,
+ ARG_NON = 0,
+ ARG_RELADDR = 1,
+ ARG_ABSADDR = 2,
+ ARG_LENGTH = 3,
+ ARG_MEMNUM = 4,
+ ARG_OPTION = 5,
+ ARG_MODE = 6
+} OpArgType;
typedef struct {
short int opcode;
char* name;
- short int arg_type;
+ OpArgType arg_type;
} OpInfoType;
static OpInfoType OpInfo[] = {
@@ -295,11 +316,12 @@ extern void
onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp, UChar* start,
OnigEncoding enc)
{
- int i, n, arg_type;
+ int i, n;
+ OpArgType arg_type;
RelAddrType addr;
- LengthType len;
- MemNumType mem;
- OnigCodePoint code;
+ LengthType len;
+ MemNumType mem;
+ OnigCodePoint code;
OnigOptionType option;
ModeType mode;
UChar *q;
@@ -336,12 +358,13 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp, UChar* start,
fprintf(f, ":%d", option);
}
break;
-
case ARG_MODE:
mode = *((ModeType* )bp);
bp += SIZE_MODE;
fprintf(f, ":%d", mode);
break;
+ default:
+ break;
}
}
else {
@@ -546,7 +569,7 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp, UChar* start,
#ifdef USE_CALLOUT
case OP_CALLOUT_CONTENTS:
{
- GET_MEMNUM_INC(mem, bp); // number
+ GET_MEMNUM_INC(mem, bp); /* number */
fprintf(f, ":%d", mem);
}
break;
@@ -555,8 +578,8 @@ onig_print_compiled_byte_code(FILE* f, UChar* bp, UChar** nextp, UChar* start,
{
int id;
- GET_MEMNUM_INC(id, bp); // id
- GET_MEMNUM_INC(mem, bp); // number
+ GET_MEMNUM_INC(id, bp); /* id */
+ GET_MEMNUM_INC(mem, bp); /* number */
fprintf(f, ":%d:%d", id, mem);
}
@@ -959,8 +982,8 @@ typedef struct _StackType {
struct {
UChar *pstr; /* start/end position */
/* Following information is set, if this stack type is MEM-START */
- StackIndex start; /* prev. info (for backtrack "(...)*" ) */
- StackIndex end; /* prev. info (for backtrack "(...)*" ) */
+ StackIndex prev_start; /* prev. info (for backtrack "(...)*" ) */
+ StackIndex prev_end; /* prev. info (for backtrack "(...)*" ) */
} mem;
struct {
UChar *pstr; /* start position */
@@ -996,7 +1019,7 @@ struct OnigCalloutArgsStruct {
const OnigUChar* string_end;
const OnigUChar* start;
const OnigUChar* right_range;
- const OnigUChar* current; // current matching position
+ const OnigUChar* current; /* current matching position */
unsigned long retry_in_match_counter;
/* invisible to users */
@@ -1127,7 +1150,7 @@ onig_get_retry_limit_in_match(void)
#ifdef USE_RETRY_LIMIT_IN_MATCH
return RetryLimitInMatch;
#else
- //return ONIG_NO_SUPPORT_CONFIG;
+ /* return ONIG_NO_SUPPORT_CONFIG; */
return 0;
#endif
}
@@ -1520,11 +1543,11 @@ stack_double(int is_alloca, char** arg_alloc_base,
STACK_ENSURE(1);\
stk->type = STK_MEM_START;\
stk->zid = (mnum);\
- stk->u.mem.pstr = (s);\
- stk->u.mem.start = mem_start_stk[mnum];\
- stk->u.mem.end = mem_end_stk[mnum];\
- mem_start_stk[mnum] = GET_STACK_INDEX(stk);\
- mem_end_stk[mnum] = INVALID_STACK_INDEX;\
+ stk->u.mem.pstr = (s);\
+ stk->u.mem.prev_start = mem_start_stk[mnum];\
+ stk->u.mem.prev_end = mem_end_stk[mnum];\
+ mem_start_stk[mnum] = GET_STACK_INDEX(stk);\
+ mem_end_stk[mnum] = INVALID_STACK_INDEX;\
STACK_INC;\
} while(0)
@@ -1532,9 +1555,9 @@ stack_double(int is_alloca, char** arg_alloc_base,
STACK_ENSURE(1);\
stk->type = STK_MEM_END;\
stk->zid = (mnum);\
- stk->u.mem.pstr = (s);\
- stk->u.mem.start = mem_start_stk[mnum];\
- stk->u.mem.end = mem_end_stk[mnum];\
+ stk->u.mem.pstr = (s);\
+ stk->u.mem.prev_start = mem_start_stk[mnum];\
+ stk->u.mem.prev_end = mem_end_stk[mnum];\
mem_end_stk[mnum] = GET_STACK_INDEX(stk);\
STACK_INC;\
} while(0)
@@ -1758,8 +1781,8 @@ stack_double(int is_alloca, char** arg_alloc_base,
STACK_BASE_CHECK(stk, "STACK_POP 2"); \
if ((stk->type & STK_MASK_POP_USED) != 0) break;\
else if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->zid] = stk->u.mem.start;\
- mem_end_stk[stk->zid] = stk->u.mem.end;\
+ mem_start_stk[stk->zid] = stk->u.mem.prev_start;\
+ mem_end_stk[stk->zid] = stk->u.mem.prev_end;\
}\
}\
break;\
@@ -1770,15 +1793,15 @@ stack_double(int is_alloca, char** arg_alloc_base,
if ((stk->type & STK_MASK_POP_USED) != 0) break;\
else if ((stk->type & STK_MASK_POP_HANDLED) != 0) {\
if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->zid] = stk->u.mem.start;\
- mem_end_stk[stk->zid] = stk->u.mem.end;\
+ mem_start_stk[stk->zid] = stk->u.mem.prev_start;\
+ mem_end_stk[stk->zid] = stk->u.mem.prev_end;\
}\
else if (stk->type == STK_REPEAT_INC) {\
STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
}\
else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->zid] = stk->u.mem.start;\
- mem_end_stk[stk->zid] = stk->u.mem.end;\
+ mem_start_stk[stk->zid] = stk->u.mem.prev_start;\
+ mem_end_stk[stk->zid] = stk->u.mem.prev_end;\
}\
POP_CALLOUT_CASE\
}\
@@ -1795,15 +1818,15 @@ stack_double(int is_alloca, char** arg_alloc_base,
if (stk->type == (til_type)) break;\
else {\
if (stk->type == STK_MEM_START) {\
- mem_start_stk[stk->zid] = stk->u.mem.start;\
- mem_end_stk[stk->zid] = stk->u.mem.end;\
+ mem_start_stk[stk->zid] = stk->u.mem.prev_start;\
+ mem_end_stk[stk->zid] = stk->u.mem.prev_end;\
}\
else if (stk->type == STK_REPEAT_INC) {\
STACK_AT(stk->u.repeat_inc.si)->u.repeat.count--;\
}\
else if (stk->type == STK_MEM_END) {\
- mem_start_stk[stk->zid] = stk->u.mem.start;\
- mem_end_stk[stk->zid] = stk->u.mem.end;\
+ mem_start_stk[stk->zid] = stk->u.mem.prev_start;\
+ mem_end_stk[stk->zid] = stk->u.mem.prev_end;\
}\
/* Don't call callout here because negation of total success by (?!..) (?<!..) */\
}\
@@ -1849,12 +1872,24 @@ stack_double(int is_alloca, char** arg_alloc_base,
}\
} while(0)
-#ifdef USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT
-#define STACK_EMPTY_CHECK_MEMST(isnull,sid,s,reg) do {\
+#define STACK_MEM_START_GET_PREV_END_ADDR(k /* STK_MEM_START*/, reg, addr) do {\
+ if (k->u.mem.prev_end == INVALID_STACK_INDEX) {\
+ (addr) = 0;\
+ }\
+ else {\
+ if (MEM_STATUS_AT((reg)->bt_mem_end, k->zid))\
+ (addr) = STACK_AT(k->u.mem.prev_end)->u.mem.pstr;\
+ else\
+ (addr) = (UChar* )k->u.mem.prev_end;\
+ }\
+} while (0)
+
+#ifdef USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT
+#define STACK_EMPTY_CHECK_MEM(isnull,sid,s,reg) do {\
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k, "STACK_EMPTY_CHECK_MEMST"); \
+ STACK_BASE_CHECK(k, "STACK_EMPTY_CHECK_MEM"); \
if (k->type == STK_EMPTY_CHECK_START) {\
if (k->zid == (sid)) {\
if (k->u.empty_check.pstr != (s)) {\
@@ -1866,15 +1901,11 @@ stack_double(int is_alloca, char** arg_alloc_base,
(isnull) = 1;\
while (k < stk) {\
if (k->type == STK_MEM_START) {\
- if (k->u.mem.end == INVALID_STACK_INDEX) {\
+ STACK_MEM_START_GET_PREV_END_ADDR(k, reg, endp);\
+ if (endp == 0) {\
(isnull) = 0; break;\
}\
- if (MEM_STATUS_AT(reg->bt_mem_end, k->zid))\
- endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\
- else\
- endp = (UChar* )k->u.mem.end;\
- /*fprintf(stderr, "num: %d, pstr: %p, endp: %p\n", k->u.mem.num, STACK_AT(k->u.mem.start)->u.mem.pstr, endp);*/ \
- if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\
+ else if (STACK_AT(k->u.mem.prev_start)->u.mem.pstr != endp) {\
(isnull) = 0; break;\
}\
else if (endp != s) {\
@@ -1890,12 +1921,12 @@ stack_double(int is_alloca, char** arg_alloc_base,
}\
} while(0)
-#define STACK_EMPTY_CHECK_MEMST_REC(isnull,sid,s,reg) do {\
+#define STACK_EMPTY_CHECK_MEM_REC(isnull,sid,s,reg) do {\
int level = 0;\
StackType* k = stk;\
while (1) {\
k--;\
- STACK_BASE_CHECK(k, "STACK_EMPTY_CHECK_MEMST_REC"); \
+ STACK_BASE_CHECK(k, "STACK_EMPTY_CHECK_MEM_REC");\
if (k->type == STK_EMPTY_CHECK_START) {\
if (k->zid == (sid)) {\
if (level == 0) {\
@@ -1908,20 +1939,25 @@ stack_double(int is_alloca, char** arg_alloc_base,
(isnull) = 1;\
while (k < stk) {\
if (k->type == STK_MEM_START) {\
- if (k->u.mem.end == INVALID_STACK_INDEX) {\
- (isnull) = 0; break;\
- }\
- if (MEM_STATUS_AT(reg->bt_mem_end, k->zid))\
- endp = STACK_AT(k->u.mem.end)->u.mem.pstr;\
- else\
- endp = (UChar* )k->u.mem.end;\
- if (STACK_AT(k->u.mem.start)->u.mem.pstr != endp) {\
- (isnull) = 0; break;\
- }\
- else if (endp != s) {\
- (isnull) = -1; /* empty, but position changed */ \
+ if (level == 0) {\
+ STACK_MEM_START_GET_PREV_END_ADDR(k, reg, endp);\
+ if (endp == 0) {\
+ (isnull) = 0; break;\
+ }\
+ else if (STACK_AT(k->u.mem.prev_start)->u.mem.pstr != endp) { \
+ (isnull) = 0; break;\
+ }\
+ else if (endp != s) {\
+ (isnull) = -1; /* empty, but position changed */\
+ }\
}\
}\
+ else if (k->type == STK_EMPTY_CHECK_START) {\
+ if (k->zid == (sid)) level++;\
+ }\
+ else if (k->type == STK_EMPTY_CHECK_END) {\
+ if (k->zid == (sid)) level--;\
+ }\
k++;\
}\
break;\
@@ -1958,7 +1994,7 @@ stack_double(int is_alloca, char** arg_alloc_base,
}\
}\
} while(0)
-#endif /* USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT */
+#endif /* USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT */
#define STACK_GET_REPEAT(sid, k) do {\
int level = 0;\
@@ -2348,7 +2384,6 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
retry_limit_in_match = msa->retry_limit_in_match;
#endif
- //n = reg->num_repeat + reg->num_mem * 2;
pop_level = reg->stack_pop_level;
num_mem = reg->num_mem;
STACK_INIT(INIT_MATCH_STACK_SIZE);
@@ -2996,7 +3031,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
case OP_WORD_BOUNDARY: SOP_IN(OP_WORD_BOUNDARY);
{
ModeType mode;
- GET_MODE_INC(mode, p); // ascii_mode
+ GET_MODE_INC(mode, p); /* ascii_mode */
if (ON_STR_BEGIN(s)) {
DATA_ENSURE(1);
@@ -3020,7 +3055,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
case OP_NO_WORD_BOUNDARY: SOP_IN(OP_NO_WORD_BOUNDARY);
{
ModeType mode;
- GET_MODE_INC(mode, p); // ascii_mode
+ GET_MODE_INC(mode, p); /* ascii_mode */
if (ON_STR_BEGIN(s)) {
if (DATA_ENSURE_CHECK1 && IS_MBC_WORD_ASCII_MODE(encode, s, end, mode))
@@ -3044,7 +3079,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
case OP_WORD_BEGIN: SOP_IN(OP_WORD_BEGIN);
{
ModeType mode;
- GET_MODE_INC(mode, p); // ascii_mode
+ GET_MODE_INC(mode, p); /* ascii_mode */
if (DATA_ENSURE_CHECK1 && IS_MBC_WORD_ASCII_MODE(encode, s, end, mode)) {
if (ON_STR_BEGIN(s) || !IS_MBC_WORD_ASCII_MODE(encode, sprev, end, mode)) {
@@ -3059,7 +3094,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
case OP_WORD_END: SOP_IN(OP_WORD_END);
{
ModeType mode;
- GET_MODE_INC(mode, p); // ascii_mode
+ GET_MODE_INC(mode, p); /* ascii_mode */
if (!ON_STR_BEGIN(s) && IS_MBC_WORD_ASCII_MODE(encode, sprev, end, mode)) {
if (ON_STR_END(s) || ! IS_MBC_WORD_ASCII_MODE(encode, s, end, mode)) {
@@ -3395,9 +3430,10 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sprev = s;
if (backref_match_at_nested_level(reg, stk, stk_base, ic
, case_fold_flag, (int )level, (int )tlen, p, &s, end)) {
- while (sprev + (len = enclen(encode, sprev)) < s)
- sprev += len;
-
+ if (sprev < end) {
+ while (sprev + (len = enclen(encode, sprev)) < s)
+ sprev += len;
+ }
p += (SIZE_MEMNUM * tlen);
}
else
@@ -3504,16 +3540,16 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
continue;
break;
-#ifdef USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT
+#ifdef USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT
case OP_EMPTY_CHECK_END_MEMST: SOP_IN(OP_EMPTY_CHECK_END_MEMST);
{
int is_empty;
GET_MEMNUM_INC(mem, p); /* mem: null check id */
- STACK_EMPTY_CHECK_MEMST(is_empty, mem, s, reg);
+ STACK_EMPTY_CHECK_MEM(is_empty, mem, s, reg);
if (is_empty) {
#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "EMPTY_CHECK_END_MEMST: skip id:%d, s:%p\n", (int)mem, s);
+ fprintf(stderr, "EMPTY_CHECK_END_MEM: skip id:%d, s:%p\n", (int)mem, s);
#endif
if (is_empty == -1) goto fail;
goto empty_check_found;
@@ -3531,14 +3567,14 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
int is_empty;
GET_MEMNUM_INC(mem, p); /* mem: null check id */
-#ifdef USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT
- STACK_EMPTY_CHECK_MEMST_REC(is_empty, mem, s, reg);
+#ifdef USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT
+ STACK_EMPTY_CHECK_MEM_REC(is_empty, mem, s, reg);
#else
STACK_EMPTY_CHECK_REC(is_empty, mem, s);
#endif
if (is_empty) {
#ifdef ONIG_DEBUG_MATCH
- fprintf(stderr, "EMPTY_CHECK_END_MEMST_PUSH: skip id:%d, s:%p\n",
+ fprintf(stderr, "EMPTY_CHECK_END_MEM_PUSH: skip id:%d, s:%p\n",
(int )mem, s);
#endif
if (is_empty == -1) goto fail;
@@ -3577,8 +3613,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
case OP_POP_OUT: SOP_IN(OP_POP_OUT);
STACK_POP_ONE;
- // for stop backtrack
- //CHECK_RETRY_LIMIT_IN_MATCH;
+ /* for stop backtrack */
+ /* CHECK_RETRY_LIMIT_IN_MATCH; */
SOP_OUT;
continue;
break;
@@ -5137,7 +5173,7 @@ onig_get_args_num_by_callout_args(OnigCalloutArgs* args)
num = args->num;
e = onig_reg_callout_list_at(args->regex, num);
- if (IS_NULL(e)) return 0;
+ if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT;
if (e->of == ONIG_CALLOUT_OF_NAME) {
return e->u.arg.num;
}
@@ -5153,7 +5189,7 @@ onig_get_passed_args_num_by_callout_args(OnigCalloutArgs* args)
num = args->num;
e = onig_reg_callout_list_at(args->regex, num);
- if (IS_NULL(e)) return 0;
+ if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT;
if (e->of == ONIG_CALLOUT_OF_NAME) {
return e->u.arg.passed_num;
}
@@ -5170,7 +5206,7 @@ onig_get_arg_by_callout_args(OnigCalloutArgs* args, int index,
num = args->num;
e = onig_reg_callout_list_at(args->regex, num);
- if (IS_NULL(e)) return 0;
+ if (IS_NULL(e)) return ONIGERR_INVALID_ARGUMENT;
if (e->of == ONIG_CALLOUT_OF_NAME) {
if (IS_NOT_NULL(type)) *type = e->u.arg.types[index];
if (IS_NOT_NULL(val)) *val = e->u.arg.vals[index];
@@ -5393,6 +5429,8 @@ onig_builtin_max(OnigCalloutArgs* args, void* user_data ARG_UNUSED)
{
int r;
int slot;
+ long max_val;
+ OnigCodePoint count_type;
OnigType type;
OnigValue val;
OnigValue aval;
@@ -5411,13 +5449,38 @@ onig_builtin_max(OnigCalloutArgs* args, void* user_data ARG_UNUSED)
r = onig_get_arg_by_callout_args(args, 0, &type, &aval);
if (r != ONIG_NORMAL) return r;
+ if (type == ONIG_TYPE_TAG) {
+ r = onig_get_callout_data_by_callout_args(args, aval.tag, 0, &type, &aval);
+ if (r < ONIG_NORMAL) return r;
+ else if (r > ONIG_NORMAL)
+ max_val = 0L;
+ else
+ max_val = aval.l;
+ }
+ else { /* LONG */
+ max_val = aval.l;
+ }
+
+ r = onig_get_arg_by_callout_args(args, 1, &type, &aval);
+ if (r != ONIG_NORMAL) return r;
+
+ count_type = aval.c;
+ if (count_type != '>' && count_type != 'X' && count_type != '<')
+ return ONIGERR_INVALID_CALLOUT_ARG;
if (args->in == ONIG_CALLOUT_IN_RETRACTION) {
- val.l--;
+ if (count_type == '<') {
+ if (val.l >= max_val) return ONIG_CALLOUT_FAIL;
+ val.l++;
+ }
+ else if (count_type == 'X')
+ val.l--;
}
else {
- if (val.l >= aval.l) return ONIG_CALLOUT_FAIL;
- val.l++;
+ if (count_type != '<') {
+ if (val.l >= max_val) return ONIG_CALLOUT_FAIL;
+ val.l++;
+ }
}
r = onig_set_callout_data_by_callout_args_self(args, slot, ONIG_TYPE_LONG, &val);
diff --git a/src/regint.h b/src/regint.h
index ba8407a..357b489 100644
--- a/src/regint.h
+++ b/src/regint.h
@@ -59,7 +59,7 @@
#define USE_CALL
#define USE_CALLOUT
#define USE_BACKREF_WITH_LEVEL /* \k<name+n>, \k<name-n> */
-#define USE_INSISTENT_CHECK_CAPTURES_STATUS_IN_ENDLESS_REPEAT /* /(?:()|())*\2/ */
+#define USE_INSISTENT_CHECK_CAPTURES_IN_EMPTY_REPEAT /* /(?:()|())*\2/ */
#define USE_NEWLINE_AT_END_OF_STRING_HAS_EMPTY_LINE /* /\n$/ =~ "\n" */
#define USE_WARNING_REDUNDANT_NESTED_REPEAT_OPERATOR
@@ -710,7 +710,6 @@ typedef int AbsAddrType;
typedef int LengthType;
typedef int RepeatNumType;
typedef int MemNumType;
-typedef short int StateCheckNumType;
typedef void* PointerType;
typedef int SaveType;
typedef int UpdateVarType;
diff --git a/src/regparse.c b/src/regparse.c
index 6e95a14..64923ad 100644
--- a/src/regparse.c
+++ b/src/regparse.c
@@ -525,7 +525,7 @@ onig_st_insert_strend(hash_table_type* table, const UChar* str_key,
typedef struct {
OnigEncoding enc;
- int type; // callout type: single or not
+ int type; /* callout type: single or not */
UChar* s;
UChar* end;
} st_callout_name_key;
@@ -1583,7 +1583,7 @@ onig_set_callout_of_name(OnigEncoding enc, OnigCalloutType callout_type,
}
}
- r = id; // return id
+ r = id;
return r;
}
@@ -1637,24 +1637,36 @@ onig_get_callout_tag_end(regex_t* reg, int callout_num)
extern OnigCalloutType
onig_get_callout_type_by_name_id(int name_id)
{
+ if (name_id < 0 || name_id >= GlobalCalloutNameList->n)
+ return 0;
+
return GlobalCalloutNameList->v[name_id].type;
}
extern OnigCalloutFunc
onig_get_callout_start_func_by_name_id(int name_id)
{
+ if (name_id < 0 || name_id >= GlobalCalloutNameList->n)
+ return 0;
+
return GlobalCalloutNameList->v[name_id].start_func;
}
extern OnigCalloutFunc
onig_get_callout_end_func_by_name_id(int name_id)
{
+ if (name_id < 0 || name_id >= GlobalCalloutNameList->n)
+ return 0;
+
return GlobalCalloutNameList->v[name_id].end_func;
}
extern int
onig_get_callout_in_by_name_id(int name_id)
{
+ if (name_id < 0 || name_id >= GlobalCalloutNameList->n)
+ return 0;
+
return GlobalCalloutNameList->v[name_id].in;
}
@@ -1685,6 +1697,9 @@ get_callout_opt_default_by_name_id(int name_id, int index)
extern UChar*
onig_get_callout_name_by_name_id(int name_id)
{
+ if (name_id < 0 || name_id >= GlobalCalloutNameList->n)
+ return 0;
+
return GlobalCalloutNameList->v[name_id].name;
}
@@ -2689,7 +2704,7 @@ make_absent_engine(Node** node, int pre_save_right_id, Node* absent,
for (i = 0; i < 4; i++) ns[i] = NULL_NODE;
ns[1] = absent;
- ns[3] = step_one; // for err
+ ns[3] = step_one; /* for err */
r = node_new_save_gimmick(&ns[0], SAVE_S, env);
if (r != 0) goto err;
@@ -5341,8 +5356,11 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
if (num_type != IS_NOT_NUM) {
if (num_type == IS_REL_NUM) {
gnum = backref_rel_to_abs(gnum, env);
- if (gnum < 0)
+ if (gnum < 0) {
+ onig_scan_env_set_error_string(env, ONIGERR_UNDEFINED_NAME_REFERENCE,
+ prev, name_end);
return ONIGERR_UNDEFINED_GROUP_REFERENCE;
+ }
}
tok->u.call.by_number = 1;
tok->u.call.gnum = gnum;
@@ -5563,8 +5581,11 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
else {
if (num_type == IS_REL_NUM) {
gnum = backref_rel_to_abs(gnum, env);
- if (gnum < 0)
+ if (gnum < 0) {
+ onig_scan_env_set_error_string(env,
+ ONIGERR_UNDEFINED_NAME_REFERENCE, name, name_end);
return ONIGERR_UNDEFINED_GROUP_REFERENCE;
+ }
}
tok->u.call.by_number = 1;
tok->u.call.gnum = gnum;
@@ -6583,7 +6604,6 @@ parse_callout_of_contents(Node** np, int cterm, UChar** src, UChar* end, ScanEnv
PFETCH_S(c);
}
else if (c == '>') { /* no needs (default) */
- //in = ONIG_CALLOUT_IN_PROGRESS;
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
PFETCH_S(c);
}
@@ -6823,7 +6843,7 @@ parse_callout_of_name(Node** np, int cterm, UChar** src, UChar* end, ScanEnv* en
OnigEncoding enc = env->enc;
UChar* p = *src;
- //PFETCH_READY;
+ /* PFETCH_READY; */
if (PEND) return ONIGERR_INVALID_CALLOUT_PATTERN;
node = 0;
@@ -7053,12 +7073,12 @@ parse_enclosure(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
- if (PPEEK_IS('|')) { // (?~|generator|absent)
+ if (PPEEK_IS('|')) { /* (?~|generator|absent) */
PINC;
if (PEND) return ONIGERR_END_PATTERN_IN_GROUP;
head_bar = 1;
- if (PPEEK_IS(')')) { // (?~|) : range clear
+ if (PPEEK_IS(')')) { /* (?~|) : range clear */
PINC;
r = make_range_clear(np, env);
if (r != 0) return r;
@@ -7083,7 +7103,7 @@ parse_enclosure(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
if (NODE_TYPE(top) != NODE_ALT || IS_NULL(NODE_CDR(top))) {
expr = NULL_NODE;
is_range_cutter = 1;
- //return ONIGERR_INVALID_ABSENT_GROUP_GENERATOR_PATTERN;
+ /* return ONIGERR_INVALID_ABSENT_GROUP_GENERATOR_PATTERN; */
}
else {
absent = NODE_CAR(top);
@@ -7778,7 +7798,7 @@ parse_exp(Node** np, OnigToken* tok, int term, UChar** src, UChar* end,
len = 1;
while (1) {
if (len >= ONIGENC_MBC_MINLEN(env->enc)) {
- if (len == enclen(env->enc, STR_(*np)->s)) {//should not enclen_end()
+ if (len == enclen(env->enc, STR_(*np)->s)) {/* should not enclen_end() */
r = fetch_token(tok, src, end, env);
NODE_STRING_CLEAR_RAW(*np);
goto string_end;
diff --git a/src/sjis.c b/src/sjis.c
index e1bf3e1..12e93e8 100644
--- a/src/sjis.c
+++ b/src/sjis.c
@@ -337,5 +337,7 @@ OnigEncodingType OnigEncodingSJIS = {
is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_ASCII_COMPATIBLE,
+ 0, 0
};
diff --git a/src/unicode.c b/src/unicode.c
index e585937..a8bae66 100644
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -335,7 +335,7 @@ onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc,
n++;
}
}
- code = items[0].code[0]; // for multi-code to unfold search.
+ code = items[0].code[0]; /* for multi-code to unfold search. */
}
else if ((flag & INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR) != 0) {
OnigCodePoint cs[3][4];
diff --git a/src/utf16_be.c b/src/utf16_be.c
index 098ab54..8f5b8bf 100644
--- a/src/utf16_be.c
+++ b/src/utf16_be.c
@@ -38,16 +38,19 @@ init(void)
int id;
OnigEncoding enc;
char* name;
- unsigned int t_long;
unsigned int args[4];
OnigValue opts[4];
enc = ONIG_ENCODING_UTF16_BE;
- t_long = ONIG_TYPE_LONG;
name = "\000F\000A\000I\000L\000\000"; BC0_P(name, fail);
name = "\000M\000I\000S\000M\000A\000T\000C\000H\000\000"; BC0_P(name, mismatch);
- name = "\000M\000A\000X\000\000"; BC_B(name, max, 1, &t_long);
+
+ name = "\000M\000A\000X\000\000";
+ args[0] = ONIG_TYPE_TAG | ONIG_TYPE_LONG;
+ args[1] = ONIG_TYPE_CHAR;
+ opts[0].c = 'X';
+ BC_B_O(name, max, 2, args, 1, opts);
name = "\000E\000R\000R\000O\000R\000\000";
args[0] = ONIG_TYPE_LONG; opts[0].l = ONIG_ABORT;
@@ -274,5 +277,7 @@ OnigEncodingType OnigEncodingUTF16_BE = {
onigenc_always_false_is_allowed_reverse_match,
init,
0, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_UNICODE,
+ 0, 0
};
diff --git a/src/utf16_le.c b/src/utf16_le.c
index dc0d3f1..92bf318 100644
--- a/src/utf16_le.c
+++ b/src/utf16_le.c
@@ -36,16 +36,19 @@ init(void)
int id;
OnigEncoding enc;
char* name;
- unsigned int t_long;
unsigned int args[4];
OnigValue opts[4];
enc = ONIG_ENCODING_UTF16_LE;
- t_long = ONIG_TYPE_LONG;
name = "F\000A\000I\000L\000\000\000"; BC0_P(name, fail);
name = "M\000I\000S\000M\000A\000T\000C\000H\000\000\000"; BC0_P(name, mismatch);
- name = "M\000A\000X\000\000\000"; BC_B(name, max, 1, &t_long);
+
+ name = "M\000A\000X\000\000\000";
+ args[0] = ONIG_TYPE_TAG | ONIG_TYPE_LONG;
+ args[1] = ONIG_TYPE_CHAR;
+ opts[0].c = 'X';
+ BC_B_O(name, max, 2, args, 1, opts);
name = "E\000R\000R\000O\000R\000\000\000";
args[0] = ONIG_TYPE_LONG; opts[0].l = ONIG_ABORT;
@@ -282,5 +285,7 @@ OnigEncodingType OnigEncodingUTF16_LE = {
onigenc_always_false_is_allowed_reverse_match,
init,
0, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_UNICODE,
+ 0, 0
};
diff --git a/src/utf32_be.c b/src/utf32_be.c
index 68760bb..92476ec 100644
--- a/src/utf32_be.c
+++ b/src/utf32_be.c
@@ -190,5 +190,7 @@ OnigEncodingType OnigEncodingUTF32_BE = {
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_UNICODE,
+ 0, 0
};
diff --git a/src/utf32_le.c b/src/utf32_le.c
index 8208cd0..dc3fd92 100644
--- a/src/utf32_le.c
+++ b/src/utf32_le.c
@@ -190,5 +190,7 @@ OnigEncodingType OnigEncodingUTF32_LE = {
onigenc_always_false_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_UNICODE,
+ 0, 0
};
diff --git a/src/utf8.c b/src/utf8.c
index a5c4dbe..22a8db1 100644
--- a/src/utf8.c
+++ b/src/utf8.c
@@ -29,7 +29,7 @@
#include "regenc.h"
-//#define USE_INVALID_CODE_SCHEME
+/* #define USE_INVALID_CODE_SCHEME */
#ifdef USE_INVALID_CODE_SCHEME
/* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
@@ -296,5 +296,7 @@ OnigEncodingType OnigEncodingUTF8 = {
onigenc_always_true_is_allowed_reverse_match,
NULL, /* init */
NULL, /* is_initialized */
- is_valid_mbc_string
+ is_valid_mbc_string,
+ ENC_FLAG_ASCII_COMPATIBLE|ENC_FLAG_UNICODE,
+ 0, 0
};
diff --git a/test-driver b/test-driver
index 0218a01..b8521a4 100755
--- a/test-driver
+++ b/test-driver
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 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
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
# 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
@@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
# 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"
diff --git a/test/Makefile.am b/test/Makefile.am
index 6559a77..2dde7d6 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -9,7 +9,7 @@ TESTS = test_utf8 testc testp testcu
check_PROGRAMS = test_utf8 testc testp testcu
-test: test_utf8 testc testp testcu
+test: test_uchar test_utf8 testc testp testcu
@echo "[Oniguruma API, UTF-8 check]"
@./test_utf8 | grep RESULT
@echo "[Oniguruma API, ASCII/EUC-JP check]"
@@ -19,6 +19,11 @@ test: test_utf8 testc testp testcu
@echo "[Oniguruma API, UTF-16 check]"
@./testcu | grep RESULT
+test_uchar:
+ @echo "[UChar in oniguruma.h check]"
+ @grep "\(^\|[^g]\)UChar" $(top_srcdir)/src/oniguruma.h
+ @echo ""
+
test_utf8_SOURCES = test_utf8.c
test_utf8_LDADD = $(lib_onig)
diff --git a/test/test_utf8.c b/test/test_utf8.c
index 286158d..bd3ed16 100644
--- a/test/test_utf8.c
+++ b/test/test_utf8.c
@@ -595,6 +595,10 @@ extern int main(int argc, char* argv[])
x2("a\\Kb", "ab", 1, 2);
x2("(a\\Kb|ac\\Kd)", "acd", 2, 3);
x2("(a\\Kb|\\Kac\\K)*", "acababacab", 9, 10);
+ x2("(?:()|())*\\1", "abc", 0, 0);
+ x2("(?:()|())*\\2", "abc", 0, 0);
+ x2("(?:()|()|())*\\3\\1", "abc", 0, 0);
+ x2("(|(?:a(?:\\g'1')*))b|", "abc", 0, 2);
x2("(?~)", "", 0, 0);
x2("(?~)", "A", 0, 0);